Repository navigation
Commit 9e5cd51
committed
docs: Update the wrapping guide to the new deprecation style
The previous commit changed every deprecation notice in the repo but left
the wrapping guide describing the old message form, `"<old FQCN> is
deprecated. Use <new FQCN> instead."`, with no version and no
cross-reference brackets. The guide is what a contributor reads before
writing a new deprecation, so leaving it behind would reintroduce the old
form.
It now describes the form the code uses and why: the version in the
sentence because a separate "since" line cannot be expressed through the
decorator, the replacement as a bare `[name][]` cross-reference so the
generated admonition links to it, no backticks because the same string is
printed as a runtime warning, and implicit concatenation of single-line
strings because a triple-quoted message carries its indentation into both
the cross-reference and the terminal.
The worked example is updated to match, and now escapes the brackets and
dots in its `pytest.deprecated_call()` regex. That is easy to get wrong
silently, because `match` is a search and an unescaped `[...]` is a
character class that still matches something.
Also added is the hand-written `Deprecated:` admonition for the cases the
decorator cannot reach, which the guide never mentioned: an argument, an
enum member, or construction being made stricter, all of which the repo
now has. The `deprecated_member` paragraph says outright that the helper
produces no admonition on its own, since that is the whole reason the
members need one written by hand.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>1 parent 9d09bca commit 9e5cd51
1 file changed
Lines changed: 33 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
| |||
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | | - | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
37 | | - | |
38 | | - | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
43 | 66 | | |
44 | 67 | | |
45 | 68 | | |
| |||
65 | 88 | | |
66 | 89 | | |
67 | 90 | | |
68 | | - | |
69 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
70 | 95 | | |
71 | 96 | | |
72 | 97 | | |
| |||
0 commit comments