Skip to content

'should lint' should not be an analysis options property #61520

@srawlins

Description

@srawlins

Right now, AnalysisOptions has a bool get lint property, that dictates whether lint rules should be run. It is used it oh so very few places:

  1. analysis_update_options.dart, in the legacy protocol; is this ever used? Can we... not?
  2. library_analyzer.dart, which decides whether or not to run lint rules based on this property. Same for pubspec_validator.dart.
  3. dart2wasm's dry_run.dart tool (sets the property to true).
  4. linter's tool/checks/driver.dart and test_linter tools (sets the property to true).
  5. dartdocs package_builder.dart (sets the property to false, for performance).

It is ill-fitting to put this property on AnalysisOptions, because each use treats it as a global/process-wide setting. It is not a property that can be set in an analysis_options.yaml file; it is just bolted onto the side.

Setting this property is also done in AnalysisContextCollectionImpl.new's updateAnalysisOptions4 parameter, in 4, 5. It is manually updated in 1, 3, and 4, by walking all analysis options files found in DriverBasedAnalysisContext.allAnalysisOptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzer-technical-debtarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions