Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible lint doesnt trigger for included yaml #60125

Open
FMorschel opened this issue Feb 13, 2025 · 2 comments
Open

Incompatible lint doesnt trigger for included yaml #60125

FMorschel opened this issue Feb 13, 2025 · 2 comments
Labels
analyzer-analysis-options analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@FMorschel
Copy link
Contributor

Steps:

  1. Create new Dart project
  2. Add very_good_analysis to dependencies (can be dev)
  3. Swap the content of the analysis_option.yaml with:
include: package:very_good_analysis/analysis_options.7.0.0.yaml

linter:
  rules:
    prefer_relative_imports: true

If you look at https://pub.dev/packages/very_good_analysis they say they prefer the usage of always_use_package_imports. But this triggers nothing, only this way you'll have both lints triggering on a loop. I think we either should trigger incompatible_lint here or prefer the user manually written lint (prefered IMO).

CC @pq

@FMorschel FMorschel added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Feb 13, 2025
@bwilkerson
Copy link
Member

I think we should let users know when they have conflicting lints enabled, and shouldn't silently ignore what's enabled in included options files.

For example, if the included options file enables the lint in a newer version so that the conflict didn't exist until the version of the defining package was updated, then the user should have the opportunity to explicitly decide whether they want to continue to use their previous style or to conform to using the newly enabled style. They can't do that if we ignore the conflict.

@pq
Copy link
Member

pq commented Feb 13, 2025

I'm in full agreement. If a lint you have registered locally conflicts with one you have included, I'd expect a warning.

Thanks for tracking this down, @FMorschel!

@pq pq added analyzer-analysis-options analyzer-warning Issues with the analyzer's Warning codes P2 A bug or feature request we're likely to work on labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-analysis-options analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants