-
Notifications
You must be signed in to change notification settings - Fork 1.7k
The "exclude" list in .analysis_options is ignored by the dartanalyzer cli #25551
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
Comments
Analyzer has to analyze every file that is imported in order to know which names are and are not defined in the importing library, but you're right that errors and warnings should not be reported for explicitly excluded files. |
Exactly. The rules defined in my |
Is there an update for this? I know that there are more exciting things to do than fixing the exclude flag, but it is really annoying and there is no real solution to work around it. |
@enyo, can you attach a small project that repros this issue? We use |
@devoncarew yes! Glad to help, I'll do it ASAP. |
This is actually a issue that I have hit in my own angular_analyzer_plugin. It's surprisingly nontrivial to fix, but it's only an issue in analyzer_cli. So if we make the switch to use server as the backend for that, this will go away. |
That would be great :) |
I'd like to give additional feedback on this, but it is probably a completely separate issue. Although normally excluded files are properly excluded in IDEs (which, if I understood correctly use the server — tested on both IntelliJ and VSCode), sometimes excluded files reappear. |
When you open a file, it gets analyzed, and Analysis Server sends errors, semantic highlighting, etc to the IDE. When you close the file (so, it stops being a priority file), you should stop getting more data about this file. What is missing now is sending the empty list of errors so that IDE removed red squiggles. |
@scheglov Ah! That makes sense. Thanks |
Leaving a note that this affects part files as well. |
Is there any news on this ? 3 years it's a bit long ^^ :( @MichaelRFairhurst didn't quite understand your message, did you have a hack around this issue ? |
The title can be more generic as it's not just imports but all rules |
We're also seeing this issue after upgrading to Dart 2.13. We have three/four layers of
in a different layer. |
Could you be a bit more specific? Where did you add the exclude for it to work? |
Ok, so I was able to find a solution to, thanks to @spkersten . I too was using multiple |
@pruthvi145 I think the issue @enyo and I encountered is that excludes that start with path (e.g., I don't see any excludes in the lint packages, so I'm not sure you're experiencing the same problem. |
@spkersten Right! can you help me to figure out my issue? Here is my According to the rules, the file Here is the output of the At both places, it seems like |
|
Any news about this ? I am still having the issue on @dnfield could we reopen the issue ? |
Please upload an example, which causes unexpected diagnostics reported. scheglov@scheglov-macbookpro2:~/dart$
scheglov@scheglov-macbookpro2:~/dart/test2$ dart analyze
Analyzing test2... 0.9s
No issues found! I use never Dart SDK, but AFAIK nothing was changed there recently. scheglov@scheglov-macbookpro2:~/dart/test2$ dart --version
Dart SDK version: 2.15.0-edge.888e41b5a259f13aa66dd700ae92a757fa4a2123 (be) (Thu Aug 26 17:39:38 2021 +0000) on "macos_x64" |
Here's what i found after investigation. I have a
I do the exclude in # This does not work on core, but works on package_a
# Working on sdk 2.12 but not after
analyzer:
exclude:
- lib/generated/*.dart
# This work on core, but not package_a
analyzer:
exclude:
- generated/*.dart Other issue on |
OK, I see why it happens. So, name it something differently than |
Thanks @scheglov It fix my issue ! Don't know if it the same for everyone |
In my case, it was due to brackets |
The dartanalyzer has a bug when excluding files that have been around for a long time now, and since it is now deprecated in flavour of `dart analyze` it is very unlikely to be fixed any time soon. Since this action uses dartanalyzer and we need to exclude mocks, we can't use it anymore. dart-lang/sdk#25551
The dartanalyzer has a bug when excluding files that have been around for a long time now, and since it is now deprecated in flavour of `dart analyze` it is very unlikely to be fixed any time soon. Since this action uses dartanalyzer and we need to exclude mocks, we can't use it anymore. dart-lang/sdk#25551
The dartanalyzer has a bug when excluding files that have been around for a long time now, and since it is now deprecated in flavour of `dart analyze` it is very unlikely to be fixed any time soon. Since this action uses dartanalyzer and we need to exclude mocks, we can't use it anymore. dart-lang/sdk#25551
The dartanalyzer has a bug when excluding files that have been around for a long time now, and since it is now deprecated in flavour of `dart analyze` it is very unlikely to be fixed any time soon. Since this action uses dartanalyzer and we need to exclude mocks, we can't use it anymore. dart-lang/sdk#25551
Please note that
|
|
Closing this for now, as |
Would be great to fix the |
@ptheofan this issue is now closed. If you are still seeing issues with recent builds, please file a new issue with details and repro steps. |
When I define excludes in my
.analysis_options
file like this:files in
lib/generated_library
are still analyzed, when they are imported by other libraries in my project.I would expect not to get strong-mode warnings or lint errors in any files excluded in the
exclude:
listThe text was updated successfully, but these errors were encountered: