[analyzer] Adds new diagnostic for `unsupported_lint`
This is a step towards better handling lints for specific features. In a future CL we will review all lints and add the feature tag where appropriate.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Adding @paul...@google.com as CC mostly because of the changes to `messages.yaml`.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Added some drive-by comments to `pkg/analyzer/messages.yaml`. Let me know if you want me to do a full review.
String p0: the rule name
The reason all the existing messages have parameters called `p0`, `p1`, etc. is because when I added the ability to give parameters names, I didn't want to stall my progress by thinking carefully about good names for all of the existing parameters. I intend to go back and assign better names for parameters over time.
For new messages, we should go ahead and give them good parameter names from the outset. Consider something like:
```
parameters:
String ruleName: the rule name
String featureName: the feature name
problemMessage: "'#ruleName' can't be active because it requires the '#featureName' experiment."
...
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
String p0: the rule name
The reason all the existing messages have parameters called `p0`, `p1`, etc. is because when I added the ability to give parameters names, I didn't want to stall my progress by thinking carefully about good names for all of the existing parameters. I intend to go back and assign better names for parameters over time.
For new messages, we should go ahead and give them good parameter names from the outset. Consider something like:
```
parameters:
String ruleName: the rule name
String featureName: the feature name
problemMessage: "'#ruleName' can't be active because it requires the '#featureName' experiment."
...
```
Ohh! That makes so much more sense! I should've realized it sooner!
At least this and https://dart-review.googlesource.com/c/sdk/+/448601 will have that but I'll have to send a new CL for https://dart-review.googlesource.com/c/sdk/+/429240 hahaha.
Thanks! I'll update this later.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
var requiredFeature = _readFeature(data);
@paul...@google.com not a full review but the CC was mostly because of these changes (around this file). Just to make sure you have seen them.
String p0: the rule name
Felipe MorschelThe reason all the existing messages have parameters called `p0`, `p1`, etc. is because when I added the ability to give parameters names, I didn't want to stall my progress by thinking carefully about good names for all of the existing parameters. I intend to go back and assign better names for parameters over time.
For new messages, we should go ahead and give them good parameter names from the outset. Consider something like:
```
parameters:
String ruleName: the rule name
String featureName: the feature name
problemMessage: "'#ruleName' can't be active because it requires the '#featureName' experiment."
...
```
Ohh! That makes so much more sense! I should've realized it sooner!
At least this and https://dart-review.googlesource.com/c/sdk/+/448601 will have that but I'll have to send a new CL for https://dart-review.googlesource.com/c/sdk/+/429240 hahaha.
Thanks! I'll update this later.
Acknowledged
String p0: the rule name
Paul BerrySimilar issue here
Marking this as "resolved" because I'm fine with it happening either in this CL or a future CL; your choice.
var requiredFeature = _readFeature(data);
@paul...@google.com not a full review but the CC was mostly because of these changes (around this file). Just to make sure you have seen them.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I added a couple of minor comments as I was trying to get the context to review this CL, but you should ignore them in favor of addressing the bigger issue, for which I added notes to the issue.
problemMessage: "'#p0' can't be active because it requires the '#p1' experiment."
"active" --> "enabled"
problemMessage: "'#p0' can't be active because it requires the '#p1' experiment."
"experiment" --> "experiment to be enabled"
correctionMessage: "Try using Dart '#p2' or later or enabling the '#p1' experiment."
This seems like the wrong fix for what I think this diagnostic is for. I don't know whether the message is bad or whether my understanding is off.
I'm guessing that `unsupported_lint` is generated when a lint rule requires that a given experiment be enabled and it isn't. I'd then guess that `unsupported_lint_version` is generated when a lint rule requires a certain version or above and the minimum SDK constraints are below that version.
If that's true, then the fix is to change the minimum sdk constraint, not to enable an experiment.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |