Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the "Hint" diagnostic category #50796

Open
srawlins opened this issue Dec 20, 2022 · 13 comments
Open

Remove the "Hint" diagnostic category #50796

srawlins opened this issue Dec 20, 2022 · 13 comments
Assignees
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@srawlins
Copy link
Member

Currently in the analyzer we have (approximately) the following diagnostic categories:

  • CompileTimeErrorCode ("error")
  • StaticWarningCode ("warning")
  • HintCode ("hint")
  • LintCode ("lint")

(There are others like ParserErrorCode, TodoCode, FfiCode, etc, but the 4 above are the common, user-visible ones.)

We'd like to remove the HintCode category, and move all "hints" to be either "warnings" or "lints." They will mostly be moved to "warnings."

The categories differ from each other in their default severity (one of ERROR, WARNING, or INFO), and whether they are reported by default (or must be enabled via analysis_options.yaml):

Category Severity Enabled-by-default?
CompileTimeErrorCode ERROR Yes
StaticWarningCode WARNING Yes
HintCode INFO Yes
LintCode INFO No

What do these mean, practically? The difference is primarily in the behavior of dart analyze (used in presubmit checks, continuous integration, and perhaps by humans):

  • If no diagnostics are reported by dart analyze, its exit code is 0.
  • An INFO-severity diagnostic report does not move the exit code away from 0.
  • A WARNING-severity diagnostic report does move the exit code away from 0.
  • An ERROR-severity diagnostic report does move the exit code away from 0.

Note also:

  • The fatality of WARNING-severity diagnostics can be changed with the --[no-]fatal-warnings flag.
  • The fatality of INFO-severity diagnostics can be changed with the --[no-]fatal-infos flag.
  • The severity of any individual diagnostic (like DEAD_CODE or UNUSED_IMPORT or any lint rule) can be changed in analysis_options.yaml from its default to any of the others, or IGNORE.

This proposal is therefore a breaking change: "Hints" which are moved to be "warnings" will become fatal (by default) when reported by dart analyze. (Behavior will not change when --fatal-infos or --no-fatal-warnings is being used.)

Another significant change: users will also no longer get the protection from a "hint" which is moved to be an opt-in "lint" unless they explicitly enable it in their analysis_options.yaml file (or include another analysis options file which does so).

Historical note: We had more "static warnings" defined by the language in previous releases of Dart, but all but a handful of those have been dropped, and the language team has confirmed that it is "fair game" for tools like the analyzer to define their own "warnings."

@srawlins
Copy link
Member Author

@bwilkerson
Copy link
Member

There are others like ParserErrorCode ...

Kind of a minor nit, but I consider ParserErrorCodes and FfiCodes to be errors, just like CompileTimeErrorCode. Both are user-visible and they have the same impact in terms of our tooling.

We didn't always choose the classes based on severity, sometimes it had more to do with where the diagnostics are being generated or who owns the codes. That said, what's important here is not which classes we used in the implementation, but the impact of changing the severities of some of our enabled-by-default diagnostics.

@asashour
Copy link
Contributor

asashour commented Dec 20, 2022

I would consider two things: enablement-by-default, and number of managed diagnostics. I am under the impression that generally hints are non-disabled, while lints are configurable.

A compile-time error (and similar) is an error, and the user would like to see this as early as possible to be fixed. There is no value to disable it, I guess, since the error will surely come later, either during compilation or at run-time.

Moving the current hints (around 127) to lints will make the user be overwhelmed by the number of diagnostics which are configurable. Honestly, I think this might not be adding much value, but actually preventing more productivity. Dart is taking the decision to allow combinations and configuration of very tiny details, but does the user really care?

One of the decisions the formatter took, is to almost disable configuration, so whatever the formatter team decides, everyone follows. The only option is to turn on/off the formatter, life is easy and simple.

Let's compare dead code (currently hint), why should I user configure that? A dead code will never be executed, it is better to show it while coding. Comparing this to unneeded/unnecessary (currently lint), the user may want to use the parentheses or new, but it is optional, and that's user/development team preferences.

Personally, I believe "less is more", and as the language evolves, I guess there is no need to let the users still use the old ways for long time (using new keyword, or not migrating to super parameters). Yes, this is possibly a sensitive area, but I don't think in 10 years the Dart team would still need to carry potentially old deprecated language features, just not to disturb users. Things are made to be changed, and a major change every one/two years wouldn't be that bad. Also, the severity can change, for example, using new is an info for one year, then a warning afterwards. Even if the user uses an old-written package, the diagnostics are shown only for the current package, not for the dependencies.

From the high-level, the user chould have three sets of configurable diagnostics (restrictive/all, medium, low/none). The total number of the configurable diagnostics should not be high (I would say somewhere around 100, if not less). Anything which isn't really needed to be configured, should be non-configurable by default. Configuring every diagnostic is ok, but seeing hundreds of non-categorized diagnostics is not very user-friendly.

@srawlins
Copy link
Member Author

@asashour I think we agree.

Moving the current hints (around 127) to lints will make the user be overwhelmed by the number of diagnostics which are configurable.

I agree. Note that I wrote:

They will mostly be moved to "warnings."

@bwilkerson wrote up a comprehensive list, and I think it is an extreme minority of "hints" which we may rewrite as "lints." Less than 10. Examples are DIVISION_OPTIMIZATION and PACKAGE_IMPORT_CONTAINS_DOT_DOT. They're largely obscure (or are to me).

@mit-mit
Copy link
Member

mit-mit commented Dec 21, 2022

@bwilkerson wrote up a comprehensive list

Can we put that list somewhere (e.g. in a markdown gist) and link it from this issue? That would make it easier to understand the implications of this proposed change.

@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Dec 21, 2022
@pq pq added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Dec 22, 2022
@srawlins
Copy link
Member Author

srawlins commented Jan 3, 2023

@mit-mit I believe @bwilkerson shared these with you offline. We could move it into a public gist. The internal doc just has lots of discussion.

copybara-service bot pushed a commit that referenced this issue Jan 18, 2023
In dartfuzz_api_table.dart, both `DartType.VOID` and `DartType.VOID_NULLABLE` are added to the Map keys. At runtime, the last value for a given key wins, so I removed the `DartType.VOID` key-value pair.

In gen_api_table.dart, both `assertionErrorEncoding` and `errorEncoding` are added to the Map keys. At runtime, the last value for a given key wins, so I removed the `assertionErrorEncoding` key-value pair.

This CL should be a no-op.

Bug: #50796
Change-Id: Ifcfeb3e84930267f60efd2eb009a722f8ac2453e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279234
Reviewed-by: Tess Strickland <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 18, 2023
Rename StaticWarningCode to WarningCode, leaving the spec ones as StaticWarningCode.

In this CL I do not introduce a new "type" for WarningCode, it is still "STATIC_WARNING". Later, we can make a new type, "WARNING", taking care for pkg/test_runner and DAS clients like IntelliJ.

Bug: #50796
Change-Id: Ife856b2beb7e9b6bf8203f365634f49846d03bf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278997
Reviewed-by: Konstantin Shcheglov <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 19, 2023
Bug: #50796

Change-Id: Id07ac5940eafed58b1473804248381dd933cb311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279229
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 20, 2023
Bug: #50796
Change-Id: Ifa01985beba01298addacf58b576b049ce0918f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279322
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 23, 2023
This is required in order to migrate Hints to Warnings This CL migrates
this code: https://dart-review.googlesource.com/c/sdk/+/279443

TESTED=presubmit

Bug: #50796
Change-Id: I1e0c360e6ed366b6452474338679acc8b1e1399c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279458
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 23, 2023
Bug: #50796
Change-Id: I74625c25f947178b24d3374b0e87d7c89c3b20ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279332
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 24, 2023
This reverts commit b2c26d0.

Reason for revert: linter references this HintCode.

Original change's description:
> [analyzer] Move 4 more Hints to Warnings, OVERRIDE_ON_*
>
> Bug: #50796
> Change-Id: I74625c25f947178b24d3374b0e87d7c89c3b20ba
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279332
> Reviewed-by: Konstantin Shcheglov <[email protected]>
> Commit-Queue: Samuel Rawlins <[email protected]>

[email protected],[email protected],[email protected]

Change-Id: I6f786ae0ebb3727a3eac0c3fdb39523a96d3525a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: #50796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279660
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Samuel Rawlins <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 25, 2023
Bug: #50796
Change-Id: Id8b53ebef2b44d6fe1a436edf796056f60913024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279443
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 27, 2023
This requires introducing the notion of a code alias, into the code generator.

These 10 HintCodes are referenced directly by the linter, and so must be migrated to WarningCodes incrementally.

Bug: #50796
Change-Id: I9223986cb198cb87cec74646ef20c3020c019fdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279472
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jan 30, 2023
Bug: #50796
Change-Id: Ic46261738fbbd5d0e78a60b520283ea38a28b22b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280063
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
@srawlins
Copy link
Member Author

Progress: In early December there were 140 HintCodes. Today there are 109 HintCodes, and 35 WarningCodes.

copybara-service bot pushed a commit that referenced this issue Jan 31, 2023
Bug: #50796
Change-Id: Ia9612f618e2b8e7695ad98bb6b347320d4944efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280077
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 2, 2023
Bug: #50796
Change-Id: I116c957801ab873f2c7bb725008daf80564e7526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280133
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 3, 2023
`NULLABLE_TYPE_IN_CATCH_CLAUSE` is becoming a warning, so these must be
fixed (or ignored).

TEST=presubmit

Bug: #50796
Change-Id: I8343f3e1f49ed3c05dcf2d99a98cef8a953afc7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280563
Auto-Submit: Samuel Rawlins <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 6, 2023
Bug: #50796
Change-Id: I7f2364a4afedd59d481216b37836b46ce5638866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280403
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 7, 2023
Bug: #50796
Change-Id: I949e1f691889ac5a5ff4181b708cfe9e0bb1e1ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281303
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Feb 7, 2023
copybara-service bot pushed a commit that referenced this issue Feb 9, 2023
Bug: #50796
Change-Id: I904b38bbab62800ce2ecb8435d6a1048362e189e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281340
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 9, 2023
Bug: #50796
Change-Id: Ifd52af7553f4a90a536cafb79584ffc0fa623407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281741
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
jason-simmons pushed a commit to flutter/tests that referenced this issue Mar 16, 2023
This contains fixes for moving STRICT_RAW_TYPE to a Warning,
for dart-lang/sdk#50796.
copybara-service bot pushed a commit that referenced this issue Mar 17, 2023
Bug: #50796
Change-Id: I11d1ad107d8da147dd05329938bbe34325dfbb77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289341
Reviewed-by: Phil Quitslund <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 18, 2023
…_CHECK*, STRICT_RAW_TYPE

Bug: #50796
Change-Id: Idcac3ddb582e5b46263fd017c39402b1c11914d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289447
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
srawlins added a commit to flutter/tests that referenced this issue Mar 21, 2023
This includes static analysis fixes required for DEAD_CODE to flip to a Warning,
for dart-lang/sdk#50796
copybara-service bot pushed a commit that referenced this issue Mar 21, 2023
Bug: #50796
Change-Id: Ie7a6cb94cefaf4f551ed766e637bac3606c0f5ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279463
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
@srawlins
Copy link
Member Author

Progress: Today there are 25 HintCodes, and 122 WarningCodes.

copybara-service bot pushed a commit that referenced this issue Mar 23, 2023
I took care to leave code and comments which _does still_ refer to the
remaining Hints. This CL is not super complete, but I think addresses
most of the outdated text refering to Hints. I will do another round
after migrating more to Warnings.

Bug: #50796
Change-Id: Iab58dbbfbdef86e21dd65b2a96d8e34e3e7e54ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290440
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 23, 2023
Bug: #50796
Change-Id: I71291bfa959d7553c64d4a9e1f2918892ae012eb
TEST=trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290403
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 24, 2023
We also stop reporting
`HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE` and
`HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE`
as these are now replaced by the new lint rule.

The biggest change here is in the DEPRECATED_MEMBER_USE tests,
as most of these tests have
`DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE` reported (since it's
easier to write tests with files in one package). We move all
of those tests to `DEPRECATED_MEMBER_USE` tests, without losing
coverage.

Bug: #50796
Change-Id: I7cada44265cd0e1e47ab77d4354de9a5571db614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289444
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Kevin Moore <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 24, 2023
…nd completions.

The presence of errors (and previously, warnings) affects what
completions are offered (or their order?) and what fixes are offered
(or their order?), and the order of re-analysis.

When unused local variables and imports etc are WARNINGS, fixes,
completions, and re-analysis should not regress.

Bug: #50796
Change-Id: If5141eec7df01f50caee5bf245c031b5a51ea590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291100
Reviewed-by: Konstantin Shcheglov <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 27, 2023
Bug: #50796
Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
TEST=presubmit bots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 28, 2023
This reverts commit 0ef7ed2.

Reason for revert: Tests are failing in google3 - linter needs to be bumped

Original change's description:
> [analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*
>
> Bug: #50796
> Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
> TEST=presubmit bots
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
> Reviewed-by: Brian Wilkerson <[email protected]>
> Reviewed-by: Alexander Aprelev <[email protected]>
> Commit-Queue: Samuel Rawlins <[email protected]>
> Reviewed-by: Nate Bosch <[email protected]>

Bug: #50796
Change-Id: If1c460bdcf422033648417da5ba2f5fbc1b459c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291460
Bot-Commit: Rubber Stamper <[email protected]>
Auto-Submit: Oleh Prypin <[email protected]>
Reviewed-by: Alexander Thomas <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Commit-Queue: Oleh Prypin <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 28, 2023
This reverts commit e48f35b.

Reason for revert: linter is fixed.

Original change's description:
> Revert "[analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*"
>
> This reverts commit 0ef7ed2.
>
> Reason for revert: Tests are failing in google3 - linter needs to be bumped
>
> Original change's description:
> > [analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*
> >
> > Bug: #50796
> > Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
> > TEST=presubmit bots
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
> > Reviewed-by: Brian Wilkerson <[email protected]>
> > Reviewed-by: Alexander Aprelev <[email protected]>
> > Commit-Queue: Samuel Rawlins <[email protected]>
> > Reviewed-by: Nate Bosch <[email protected]>
>
> Bug: #50796
> Change-Id: If1c460bdcf422033648417da5ba2f5fbc1b459c2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291460
> Bot-Commit: Rubber Stamper <[email protected]>
> Auto-Submit: Oleh Prypin <[email protected]>
> Reviewed-by: Alexander Thomas <[email protected]>
> Commit-Queue: Alexander Thomas <[email protected]>
> Commit-Queue: Oleh Prypin <[email protected]>

Bug: #50796
Change-Id: Ie503b57a19df1a50cb3dfe50c840d20779310e87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291560
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Oleh Prypin <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
@srawlins srawlins added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Apr 4, 2023
@srawlins srawlins self-assigned this Apr 4, 2023
lrhn added a commit to dart-lang/pub that referenced this issue Apr 5, 2023
Analyzer has changed an info to a warning.
Test was looking for "info -" in output.

The info category is quickly going away (q.v., dart-lang/sdk#50796),
so the test should probably be checking for warnings now.
lrhn added a commit to dart-lang/pub that referenced this issue Apr 5, 2023
Don't extend something which should (and will) be an interface.

Update a test expectation:

Analyzer has changed an info to a warning.
Test was looking for "info -" in output.

The info category is quickly going away (q.v., dart-lang/sdk#50796),
so the test should probably be checking for warnings now.
@srawlins
Copy link
Member Author

Progress: Today there are 19 HintCodes, and 135 WarningCodes. This is probably what is shipping in Dart 3.0.

copybara-service bot pushed a commit that referenced this issue Apr 18, 2023
Bug: #50796
Change-Id: Iddcb1b6d035e9590600e6bfbd8d2133da39bcc35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295803
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jul 28, 2023
Bug: #50796
Change-Id: I7050b4f758976ff555e43f219c6f5c2b0e8d362a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290903
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Samuel Rawlins <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 7, 2023
After this move, there are 10 remaining HintCodes: 3 are deprecated
(only reported in pre Dart 3.0 code), 5 are to be moved; 2 are to be
re-implemented as LintCodes.

Work towards #50796

Change-Id: I230c1c6a4defcdf1a00c0a755eac71baa1d4c9bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324420
Reviewed-by: Konstantin Shcheglov <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 12, 2023
Work towards #50796

Change-Id: Idb8d04eb07beeb4f201ca69d0543d85305d62ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325127
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Brian Wilkerson <[email protected]>
Auto-Submit: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Nov 20, 2023
These Hints and any subsequently unused quick fixes are deleted:

* HintCode.CAN_BE_NULL_AFTER_NULL_AWARE
* HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE
* HintCode.NULL_AWARE_BEFORE_OPERATOR
* HintCode.NULL_AWARE_IN_CONDITION
* HintCode.NULL_AWARE_IN_LOGICAL_OPERATOR

Work towards #50796

Change-Id: I1b9326ae3c83fcc6be7a7ba4a5f493fc08cc75be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336321
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jul 29, 2024
* UNNECESSARY_CAST
* UNUSED_ELEMENT
* UNUSED_ELEMENT_PARAMETER
* UNUSED_LOCAL_VARIABLE

Work towards #50796

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I15c74e5ebc626f7e513c04013aa2f81b36ca39a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377762
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
copybara-service bot pushed a commit that referenced this issue Aug 3, 2024
This is replaced by the use_truncating_division lint rule.

Work towards #50796

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ied034267f4f8e5ea70ed0b4a21c39e88c88240ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378574
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Phil Quitslund <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
@srawlins
Copy link
Member Author

srawlins commented Aug 5, 2024

And there are now 165 WarningCodes and 9 HintCodes. 4 are versions of "DEPRECATED_MEMBER_USE"; 2 are deprecated; the remaining are IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, MACRO_INFO, and UNNECESSARY_IMPORT.

@bwilkerson
Copy link
Member

@jakemac53 @scheglov

I'd be interested to get your input on MACRO_INFO. Do we want to treat this as a lint (so that it retains the INFO severity as the name applies)? Do we want to drop it (and encourage macro authors to write a plugin to produce lints)? Or some other option?

@jakemac53
Copy link
Contributor

Do we want to treat this as a lint (so that it retains the INFO severity as the name applies)?

Yes

Do we want to drop it (and encourage macro authors to write a plugin to produce lints)? Or some other option?

I don't want to force macro authors into writing plugins any more than is necessary. It complicates things unnecessarily imo, both from a user experience perspective and a macro author perspective.

@srawlins srawlins added the analyzer-warning Issues with the analyzer's Warning codes label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants