Commit d13da3f
[linter/directives_ordering] Pluralize in Dart code rather than message template.
In a follow-up CL I will be changing the format of the
`problemMessage` templates in `pkg/linter/messages.yaml`, so that
instead of using numeric placeholders like `{0}`, it will use named
placeholders of the form `#IDENTIFIER`. This will make the
analyzer/linter diagnostic message code generation more similar to the
CFE's diagnostic message code generation, which should help pave the
way for one day unifying the two diagnostic message representations.
This poses a problem for the `directives_ordering_dart` and
`directives_ordering_package_before_relative` diagnostic messages:
prior to this CL, they used `{0}s` in their `problemMessage` templates
to pluarlize argument zero. That can't be done using placeholders of
the form `#IDENTIFIER`, since `s` is a valid identifier character.
In an ideal world we would probably fix this by adding support for a
placeholder syntax like `#{IDENTIFIER}`. But since only these two
messages are affected, it's more pragmatic to just do the
pluralization in Dart code rather than in the templates.
Change-Id: Ifbe2008aa1e252375c684b5770848eb143972703
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444386
Reviewed-by: Samuel Rawlins <[email protected]>
Commit-Queue: Paul Berry <[email protected]>1 parent 2206c9b commit d13da3f
File tree
3 files changed
+6
-6
lines changed- pkg/linter
- lib/src
- rules
3 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
| 596 | + | |
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
| 611 | + | |
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4098 | 4098 | | |
4099 | 4099 | | |
4100 | 4100 | | |
4101 | | - | |
| 4101 | + | |
4102 | 4102 | | |
4103 | 4103 | | |
4104 | 4104 | | |
| |||
4108 | 4108 | | |
4109 | 4109 | | |
4110 | 4110 | | |
4111 | | - | |
| 4111 | + | |
4112 | 4112 | | |
4113 | 4113 | | |
4114 | 4114 | | |
| |||
0 commit comments