sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Analyzer ignores analysis_options excludes when file is passed directly

Open EArminjon opened this issue 2 days ago • 0 comments

Dart: 3.7.2 Platform: MacOS

When running dart analyze, the CLI will check what's inside analysis_options.yaml and will ignore file mentioned in the analyzer.exclude section.

When one or many files are directly given to dart analyze, the analyzer.exclude section is ignored. Maybe this respond to a specific use case, anyway it could be useful to expose a flag in order to have the default behavior in this situation.

Example for illustration :

analyzer:
  exclude:
    - '**.g.dart'
dart analyze . // no issues
dart analyze lib/main.dart lib/gen/main.g.dart // issues from main.g.dart not ignored

EArminjon avatar Dec 09 '25 13:12 EArminjon