Skip to content

Diagnostics in analysis_options.yaml about include #61147

@FMorschel

Description

@FMorschel

Somewhat related to #60125 (analysis_options.yaml diagnostics):

  • Create a Flutter project
  • Add lints as a dev dependency
  • In your analysis_options.yaml do:
include:
  - package:flutter_lints/flutter.yaml
  - package:lints/recommended.yaml
  - package:lints/recommended.yml # Intentionally wrong here

Now you'll see:

Warning in the included options file C:\Users\felip_0vh5fa6\.puro\shared\pub_cache\hosted\pub.dev\lints-5.1.1\lib\recommended.yaml(71..30): The file includes itself recursively.dart(included_file_warning)
The include file 'package:lints/recommended.yml' in 'D:\dev\flutter\bug\analysis_options.yaml' can't be found when analyzing 'D:\dev\flutter\bug'.dart(include_file_not_found)
  1. The first diagnostic is incorrect, we are including the same file (package:lints/recommended.yaml) as the first include.
  2. All diagnostics show at the range of the first include (which is very unfortunate in cases where the user has incorrectly spelt the include).

CC @bwilkerson @pq

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions