Commit Graph

7 Commits

Author SHA1 Message Date
Paul Berry d3de420bf8 Add a custom lint to sanity check the analyzer public API.
The new lint, called `analyzer_public_api`, verifies that the analyzer
public API satisfies the following properties:

- No method, function, getter, setter, or supertype in the public API
  refers to a non-public type.

- No `export` declaration in the public API shows a non-public name.

- No declaration in the public API has a name ending in `Impl`.

- No file in the public API has a `part` declaration that points to a
  file that's not in the public API. (If it did, then the other checks
  could be circumvented.)

A new annotation is added, `@AnalyzerPublicApi()`, allowing
declarations in `package:analyzer/src` or
`package:_fe_analyzer_shared/src` to be marked as part of the analyzer
public API. This is necessary because some parts of the analyzer
public API need to be declared elsewhere and then exported by the
analyzer.

A few lint violations have been ignored using `ignore:` comments. I
will try to clean these up in follow-up CLs.

Fixes https://github.com/dart-lang/sdk/issues/60058.

Bug: https://github.com/dart-lang/sdk/issues/60058
Change-Id: I0047a73dec8a29e2ffe03dd3a90f7e41ca2e27b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-14 05:24:22 -08:00
Parker Lougheed ffc82e6f17 Stop enabling the package_api_docs lint
The lint is non-functional and will be deprecated soon.

Bug: https://github.com/dart-lang/linter/issues/5107
Change-Id: I4d4b75a6c7978f584bef37351514391f55761c55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389594
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-10-14 21:22:19 +00:00
Paul Berry afa787da5a Enable the “comment_references” lint in _fe_analyzer_shared.
This should help keep documentation comments up to date and
meaningful, and it will ensure that when parts of _fe_analyzer_shared
are re-exported as part of the analyzer API, the generated
documentation will have working links.

Change-Id: I9296db3a142a690e4191eb9443d1818d05279fa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376463
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-07-24 19:05:42 +00:00
Sam Rawlins f292b20dfd Replace deprecated lint rules in front-end packages
Two rules, `iterable_contains_unrelated_type` and
`list_remove_unrelated_type` are deprecated (which fails the CI) and
replaced with `collection_methods_unrelated_type`.

See https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780614474452305057/+/u/analyze_pkg_/stdout for the failures resulting from referencing deprecated rules.

Change-Id: I00087e684bfb230b5dc94ab832c969ed67a631f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304780
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-05-23 14:01:49 +00:00
Konstantin Shcheglov d4c443cfb7 Enable annotate_overrides lint in _fe_analyzer_shared/
Change-Id: Ic8e34af296368e8159fa75887ed54cbb4b550648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270226
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2022-11-17 15:13:39 +00:00
Paul Berry 1b31046363 Change SDK constraint for _fe_analyzer_shared to 2.17.0.
This allows the _fe_analyzer_shared package to make use of the new
"super parameters" feature.

Change-Id: Iebea526cd91563a0ba603796d2df8af633adfaae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250180
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-06-29 19:31:55 +00:00
Paul Berry 499815842c Create a package to hold code shared between front_end and analyzer.
Previously such shared code was in the front_end package, but that
created problems because there is a lot of code in front_end that
isn't intended to be shared with the analyzer (including, notably, the
dependency on kernel).

This CL just moves over the flow_analysis logic to the new shared
package.  Follow-up CLs will move over other shared logic and tests.
The end goal is that the analyzer package will no longer have a
dependency on front_end.

Change-Id: I5642d6565204422d79808ca47648462db85e442a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123624
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-31 13:05:53 +00:00