Files
sdk/pkg/_fe_analyzer_shared/analysis_options.yaml
T
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

23 lines
680 B
YAML

# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
include: analysis_options_no_lints.yaml
linter:
rules:
- analyzer_public_api
- annotate_overrides
- collection_methods_unrelated_type
- curly_braces_in_flow_control_structures
- prefer_adjacent_string_concatenation
- unawaited_futures
- recursive_getters
- avoid_empty_else
- empty_statements
- valid_regexps
- lines_longer_than_80_chars
# - always_specify_types
- use_super_parameters
- comment_references