Commit Graph

876 Commits

Author SHA1 Message Date
Sam Rawlins 43e01310a4 analyzer_testing: Rename PubPackageResolutionTest.ignoredErrorCodes to ignoredDiagnosticCodes
Change-Id: I0a951ecbf8aa74d1c00df99e0f5bdab84bb00dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430542
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:12:18 -07:00
Sam Rawlins 2dc94ee84a analyzer: Rename DiagnosticCode.errorSeverity to DiagnosticCode.severity
Change-Id: I244a96a940f82902a20e817fd13fe32026607ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:25:01 -07:00
Sam Rawlins 612c9f6834 analyzer: rename AnalysisRule 'errorCode' parameters
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I3d5a55f6638b18e2941a574a71c89fc142f0c206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-22 11:27:21 -07:00
Sam Rawlins e4810025ad Remove RuleState type hierarchy with an enum and condensed constructors
Change-Id: I07ee606b00467b8113f1722dba21b8c16cfe85b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 09:53:18 -07:00
Sam Rawlins 9d2df84973 analyzer_testing: add more default-ignored codes
UNUSED_ELEMENT and UNUSED_FIELD were added to the "ignore list" for
the tests of a dozen lint rules. I think it is pretty harmless to ignore
them by default, and save plugin authors some `// ignore:` comments, or
hand-wringing about how to get rid of an "unused" field in a test which
is needed in order to test an analysis rule.

Change-Id: Ic35fead8a44d8d3341f9e32e92b53610b517edf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430121
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-05-22 09:23:50 -07:00
Sam Rawlins 4ef189a513 linter: Rename State to RuleState, and sub-classes
Change-Id: Id74c1a34e0a3154e1720d323bf4002aceb092dd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-20 15:52:54 -07:00
Konstantin Shcheglov 5d175fa43c Elements. Deprecate InterfaceElement.constructors2, use constructors.
Change-Id: I78faea1fdbc55e46cdb7fc0b187d12561736cec2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429822
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-20 15:11:42 -07:00
Sam Rawlins 3a08da01af analyzer: Support comment references of members of aliased type
Work towards https://github.com/dart-lang/sdk/issues/56109
(specifically support for
https://github.com/dart-lang/sdk/issues/56109#issuecomment-2292355457).

Currently, instance (and static) members of a type can be referenced in
a comment reference. This change adds support to referencing instance
(and static) members of a type via a type alias.

Change-Id: Ic789a0185cb8c56236346ef3ae658481fbd4cd70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429226
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-20 11:35:29 -07:00
Sam Rawlins f81079035f analyzer_testing: Move LintRuleTest and linter's PubPackageResolutionTest
Most of the behavior of LintRuleTest is extracted into a public class
in analyzer_testing, AnalysisRuleTest. A little bit of code is left in
LintRuleTest, so that first-party lint rules can be tested by
registering the first-party lint rules. And those lint rules can
declare the `lintRule` that each is concerned with, rather than the
new `analysisRule` getter.

PubPackageResolutionTest is left as private impl, because I think it
may undergo some changes, and we may be merging more shared code, and
the name may change. A few first-party lint rules have tests that
refer to this class, which is OK.

Other than that, no code or behavior changes are in this CL.

Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I447850c438af7d0fe90889d2eaec6f2f8b4f8281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-20 10:25:50 -07:00
Erik Ernst 4e7ea4f4b5 Make type_annotate_public_apis/omit_obvious_property_types incompatible
Change-Id: I6a703160772291f07e6df93cdc51df9ddebe0115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-05-20 07:49:43 -07:00
Sam Rawlins 540efbbb5d analyzer: Extract some public API from WorkspacePackage
Fixes https://github.com/dart-lang/sdk/issues/60725

Change-Id: I63e79075d6538810ddc518e96b5bb7430e55496b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428564
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-19 16:24:19 -07:00
Parker Lougheed 640d9a760f [linter] Update lint changelog for 3.8 and 3.9
Also mark recently published lint docs as published.

Change-Id: If2fba38b6c6cae5764691803d9359dffca8ddf33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429281
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-19 14:54:26 -07:00
Sam Rawlins 750ecda6b3 Remove two underused methods from ResourceProviderMixin
Change-Id: I41f288f216e7db5a744d10a38074e104321e49f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-17 10:39:12 -07:00
Sam Rawlins 0e5f60e80a linter: enforce unnecessary_async
Change-Id: If5d025ccf2d1a6d80256579bee7a7b3a4d039dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429061
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-17 07:21:41 -07:00
Sam Rawlins 53f21134d7 linter: add isEnabled to LinterContext directly
This was previously available as an extension on this class, but we
control the class quite directly. Seems like it should just be an API
of LinterContext.

Change-Id: I9fb61ab4471e859c39d9fa963eed2a3839fca617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428925
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-17 06:42:54 -07:00
FMorschel 83eb816e51 [linter] Adds new switch_on_type lint
Fixes: https://github.com/dart-lang/sdk/issues/59546
Change-Id: Ib78714e03c1487376c961214910d10c24ec9f8ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-05-16 16:00:54 -07:00
Sam Rawlins dfaf1514ea linter: discarded_futures: do not report on await-in-synchronous function
When a synchronous function body has an `await` expression, we report
an error. We don't need to _also_ report a lint.

The noted error, `CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT`, already
is associated with the "add async" fix. Reporting a lint when an error
is also definitely reported is just double reporting.

Change-Id: If6d260a01cc654c87897480996d3f6f4b61373dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 15:34:20 -07:00
Konstantin Shcheglov 78bc6da66c Elements. Deprecate InstanceElement.xyz2, use 'xyz' instead.
Change-Id: Ie12b7596b70c77fd2f08520a423eeaf3b6978326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 10:24:25 -07:00
Sam Rawlins aa5f130ce8 linter: Remove analyzer impl export
This reduce's linter's exposure of private analyzer API, which will
help with making LintRule public API.

Change-Id: I5af1961cf6e7e6c8554962d055a2f311256e3895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428901
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 07:14:11 -07:00
Konstantin Shcheglov 2db49488c1 CodeGen. Generate members of most leaf AstNodeImpl classes.
Every declaration annotated with `@generated` was generated. In the
current version there are `2180` such declarations. For comparison,
there are `2167` instances of `@override` in total, and `@generated +
@override` has `1576` instances, so we generate `72%` of all overrides.

The generator automatically formats and sorts `ast.dart` after applying
changes, so the result is nice and clean. We run a separate DAS instance
from the script to do this.

Things to improve in the future:

1. Generate for non-leaf classes.

2. Support for `DoNotGenerate`.

Change-Id: I05e6356c9aac68449d5117ad8fd533735f130c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 18:05:42 -07:00
Sam Rawlins bd700772ff analyzer: move testing utilities to analyzer_testing package
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: Iae062d95e5cf3b94b540496242b3627268ac2612
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428844
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 16:28:50 -07:00
Sam Rawlins 22453ba77f linter: deprecate AnalysisRule.lintCode
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: Iedf1127b9f04aec910647c7f35597f38c6bfe1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428846
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-15 16:20:11 -07:00
Konstantin Shcheglov 05da3e1f22 Elements. Deprecate Element.enclosingElement2, use enclosingElement.
Change-Id: I055b1f9dd1c00605d813effcbbadb9cea874129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 13:47:32 -07:00
Sam Rawlins 0da88371bb linter: remove DriverBasedAnalysisContext to use less private API
Change-Id: I5fb7686539c3a7db39c1fc027868c927e1d5d676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428342
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 11:47:44 -07:00
Sam Rawlins 701c6113c2 analyzer: Simplify interface of WorkspacePackage, use File for root
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I56c14bc941e1204b9d9cc13086f5ed92a1228585
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428623
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-15 11:35:42 -07:00
Sam Rawlins a3b1b4f172 analyzer: Deprecate AbstractAnalysisRule.lintCodes
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I4c86dbf806964c98f4a1c5854eb53c6c8cfe002b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428624
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 11:04:43 -07:00
Sam Rawlins 20755e2eb7 linter: Add documentation to the 'unnecessary_unawaited' lint rule
Change-Id: I2e46a3bdbbe40ae3e0e383eb75357ea38ea95596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-14 14:07:09 -07:00
Sam Rawlins d67a7d879e linter: Remove unused ast utilities
Change-Id: I4a436a77a69cc4a78ceb1ca27b95a81ab55dc868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428422
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-05-14 09:04:01 -07:00
Sam Rawlins 06d2071504 linter: Remove an export before it becomes cross-package
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I5ffe612695be725e0af0497f9b2917da3d52ec7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428420
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-14 07:12:19 -07:00
Sam Rawlins 0d1fe0fc3a analyzer: Remove unnecessary InheritanceManager3 from LinterContext
Work towards https://github.com/dart-lang/sdk/issues/50986

At the same time, migrate `redeclare_verifier` from InheritanceManager3,
so that the impl is the same as the `annotate_redeclares` lint rule.

Change-Id: I9c5c77dcf50aa54820473874327bc3a7b93fd987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428380
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-13 15:21:52 -07:00
Sam Rawlins 77d673c841 linter: Reduce usage of InheritanceManager3
Change-Id: Ifb33d26de1223a575cf29b7904f1cf1269f4a3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428063
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-13 09:47:11 -07:00
Sam Rawlins da58ca0060 analyzer: Convert getPubspecVisitor to a getter named pubspecVisitor
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I1bcdc6b32efef0f7e70bbb49c3cce046f95351fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428225
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-13 09:01:59 -07:00
Sam Rawlins 444f8ebedb linter: Move 'overriddenMember' off of InheritanceManager3
This was an extension method on InheritanceManager3. But that class
may be disappearing in favor of methods on InterfaceElement. So this
change keeps the method as an extension method, but takes
InheritanceManager3 out of the picture.

Change-Id: I79147f7c39e0e7d94f0e65231e36a2baf2f54362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428162
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-12 16:54:50 -07:00
Sam Rawlins 27e819f4cc linter: combine test classes into one
Work towards https://github.com/dart-lang/sdk/issues/55660

The only direct subclass of `_ContextResolutionTest` is
`PubPackageResolutionTest`, so they can be combined. I keep all of the
API the same, with a few exceptions:

* Make `addTestFile`, `testFilePath`, `resolveTestFile` private. They
  were very lightly used outside of `rule_test_support.dart`, in
  exceptional situations, where they can be replaced with local members.
* This allows for a much more idiomatic impl for `file_names_test.dart`.

Change-Id: Icfa63ca488c4722067fc7d471343afd398a9dddc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-12 16:50:59 -07:00
Sam Rawlins aebc7fd74c analyzer: Tidy up Spelunker API
Work towards https://github.com/dart-lang/sdk/issues/55660

Spelunker will move to the analyzer_testing package, so we must first
clean it up.

Spelunker had two subclasses, but their only differentiation was the
calculation of a getter, which could be a final field. So I remove the
subclasses, move the "File"-based one to the spelunk utility script,
and change the Spelunker constructor to take in a source string.
Additionally:

* Make all of the fields private.
* Remove isDartFileName and isPubspecFileName. These calculations can
  be inlined into their call sites and make use of the `file_paths`
  library.

Change-Id: I4b97ed03a2845440dabd3a9ab0aa3b3ba4af5959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-12 14:10:20 -07:00
Konstantin Shcheglov 7eea262f06 Deprecate NamedType.name2, use 'name' instead.
Change-Id: I27725e1530c60a6aa2e197b97e027de1238c964a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-12 08:35:59 -07:00
Sam Rawlins c4c9854b9b analyzer_testing: Move ResourceProviderMixin to analyzer_testing
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I31932409e495369793dd16c017385c98b86cf44c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427480
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 16:56:29 -07:00
Paul Berry a757d2af41 Enable sound-flow-analysis for Dart 3.9.
Bug: https://github.com/dart-lang/sdk/issues/60438
Change-Id: I908d4e4a9143142281d8198870f40eba6cf6f67f
Tested: trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427500
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-09 14:50:26 -07:00
Sam Rawlins f2d4ca7968 linter: unawaited_futures: catch Future subtypes
Change-Id: Iabdfc1ec4984d6717cc3d85729b577fb2385e749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 11:04:36 -07:00
Sam Rawlins 3021cc4913 analyzer: Move PackageConfigFileBuilder to public API.
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I3df2cd374f6b3ef9e027f0e07c748be6ea21ebb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427586
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 10:57:55 -07:00
Sam Rawlins abd4e7754c Introduce two subclasses of 'LintRule' for handling multiple lint codes
Before this change, we had an enforcement that either 'get lintCode' or
'get lintCodes' is implemented, but it was a runtime enforcement. And it
was a little roundabout.

The new system is simpler and more typical:
* `AbstractLintRule` is the parent type, and it's sealed. It provides
  `get lintCodes` as an interface. Code outside of the lint rules
  requires this getter, in registering codes, etc.
* `LintRule` is the new subclass which is the "90% case." It declares
  a `get lintRule`, and offers simpler reporting methods for reporting
  a single code everywhere.
* `MultiLintRule` is the new subclass which represents that last
  "10% case." It only declares the reporting methods which all require
  a LintCode parameter, since there is no concept of a "default lint
  code among all my lint codes."

Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I63cbbfc1d936bb4428aa0b8f5fb0638c9b61b3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-08 16:10:57 -07:00
Sam Rawlins f9c5944a33 linter: public_member_api_docs: dont report internal top-level variable
Fixes https://github.com/dart-lang/sdk/issues/60617

This includes a bit of clean-up of the other cases where we are concerned with
`@internal`.

Change-Id: I506725c2280ab90fd5e1014eb8478497de8a0480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-08 07:39:53 -07:00
Sam Rawlins 2f706c4290 analyzer_testing: move experiments library to analyzer_testing
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I9c5aa920e9f96f99ea00d6993b5f4dafd415f831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426986
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-07 13:12:13 -07:00
Konstantin Shcheglov ad7b242f31 Remove analyzer_use_new_elements lint.
Change-Id: I32370c4c1092f945d2fc079ad92dff3b176c17e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-06 13:48:50 -07:00
Sam Rawlins 7431e885e8 analyzer_testing: Move in the mock packages.
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: Ic789b8347d3bfc71a02af423fbb1a8c58da7b32d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424921
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-06 11:32:22 -07:00
Sam Rawlins 8aa021f31e linter: Use Diagnostic instead of deprecated AnalysisError
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I225bcbe2c0033872b0349258f7f2135aab6a8d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-05 15:44:14 -07:00
Sam Rawlins cfa4be3d93 analyzer: Use DiagnosticSeverity in analyzer packages
Work towards https://github.com/dart-lang/sdk/issues/60635

DiagnosticSeverity is the new name for ErrorSeverity.

Change-Id: I9d1040f23d4fe8affb234ff62527133e439adf50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-03 17:14:04 -07:00
FMorschel 95741cdc4f [DAS] Adds new fix to prefer_foreach lint
Fixes: https://github.com/dart-lang/sdk/issues/56995
Change-Id: Idc3788de241e27a568c1a0c2a26a0ce8f70fee62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422160
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-02 14:52:13 -07:00
Sam Rawlins b6508124a4 linter: add unnecessary_unawaited lint rule
Work towards https://github.com/dart-lang/sdk/issues/46218

Change-Id: I0c6953463d053205cc1110f554578e6b85eac0db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426240
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-02 14:36:20 -07:00
Sam Rawlins a913c61186 linter: Use new DiagnosticCode name
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I3f53e1c7db21047665e1a286673d624c2d48c834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-01 07:47:38 -07:00