sdk icon indicating copy to clipboard operation
sdk copied to clipboard

`// ignore: plugin/code` not working in some scenarios

Open rrousselGit opened this issue 1 week ago • 2 comments

Using the new Analyzer plugins, I found a scenario where // ignore doesn't work This appears to be tied to the fact that I have multiple analysis_options.yaml in my project. But I didn't manage to reproduce it on a standalone project.

To reproduce the project:

  • Clone https://github.com/rrousselGit/riverpod/
  • Switch to the branch ignore-bug. This is a branch dedicated to help you reproduce the issue
  • Run flutter pub get anywhere in the project
  • Wait for plugins to start
  • Observe how warnings will appear in the following files:
    • packages/riverpod_generator/integration/build_yaml/lib/dependencies.dart
    • packages/riverpod_generator/test/integration/dependencies2.dart

Both of those files contain an // ignore and // ignore_for_file, which aren't respected by Analyzer.

Image

I've tried changing the ignored code to many things, such as // ignore: provider_dependencies, // ignore: riverpod_lint/provider_dependencies, and a few other. Nothing works.

This appears to be specific to packages/riverpod_generator, as packages/riverpod_lint_flutter_test also uses the plugin, but ignores work fine there.

rrousselGit avatar Dec 04 '25 22:12 rrousselGit