-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Analyzer does not navigate up in the directory tree looking for closest analysis_options.yaml file #56552
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
Summary: The analyzer is no longer navigating up the directory tree to find the closest |
Do you mind sharing what is the status of this ticket? Since there is no activity on it for the last few days I'm wondering if it is being worked on or if the priority is low. We have a big mono repository project that cannot really upgrade to latest flutter because of this issue. I just would like to know what is status so I know how to proceed from our side (implement some workaround or wait for the fix) |
Can you give us some details of your monrepo structure. Where are the |
I am opening the folder
Prior to dart 3.5.0, and according to the document I shared, everything inside pkg1, pkg2 and pkg3 should consume the analysis_options.yaml that is in the parent folder. |
I would like to know what is the status of this ticket. Does it help if I create some minimal project showing the problem or were you able to reproduce the issue already? |
This seems like a fairly significant regression in behavior, affecting users with large repos. I would think this should be at the very least P1 rather than P2 and be treated accordingly. |
@gabrielgarciagava: sorry for the inconvenience and the slow response!
If that's easy for you to do, it would be greatly appreciated. Thanks! |
This should do: https://github.com/gabrielgarciagava/dart_issue_56552 Notice that only the exclusion of .g.dart files is not working. The linter rule In dart 3.4.0 the |
Thank you! |
Thanks again @gabrielgarciagava! @keertip was able to use your repro locally but we're still trying to get the failure to show up in our tests (https://dart-review.googlesource.com/c/sdk/+/388642)... We'll do some more investigating. |
Thanks. Taking a quick look to the test assert for multiple context, the only difference I can see in the setup is that in my example the analysis_options.yaml file is located one level deeper. I.e inside "/home/test/lib" instead of "/home/test". |
BUG: #56552 Change-Id: Ic0588c4f5eaea2aead0546d148f848802b15499b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388642 Commit-Queue: Keerti Parthasarathy <keertip@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Phil Quitslund <pquitslund@google.com>
@keertip Maybe try to change The lines with |
Hey @gabrielgarciagava!
Do you mine line 301?: newAnalysisOptionsYamlFile(testPackageLibPath, r'''
analyzer:
exclude:
- "**/*.g.dart"
'''); Here's the output making that change:
This is still not quite the layout that you have in your repro but at first blush it does look like it gets at a problem: note that |
Yes, 301 Hmm, interesting. In the other hard, it looks like the I mean, it is not the same as my example since in my example the |
Ahh, I see, the reason for Changed to
And I get
And as you can see, the only difference between the 2 folders (nested and nestedNoYaml), is that the "buggy" one contains a pubspec.yaml file. |
Yeah. That's a good catch! @keertip: maybe we can take a look together when you're back? |
Thanks for the input on the test @gabrielgarciagava . Can see the failure, now to figure out why. |
@keertip @pq This fix was removed in the stable release 3.27. So we cannot upgrade to latest flutter stable once again. We are still stuck on 3.22 :( I can see that this commit is part of the history, but the code was later removed. The test |
@mraleph I thought I saw the commit in the history. Maybe I got confused. But for example, I can see the entire |
Ahh the other part of the test is in this commit: f4a09ee I guess this also needs to be cherry picked then. |
@keertip: do you want to do a CP? If not, let me know and I'll pick it up. Sorry for the hassle @gabrielgarciagava! |
Working on a CP here: https://dart-review.googlesource.com/c/sdk/+/403203 |
Bug: #56552 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/390082 Cherry-pick-request: #59848 Change-Id: I1cf8ec10203a2b1bb11eafd16938ceb4f965c03c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403203 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
According to https://dart.dev/tools/analysis#the-analysis-options-file, the analyzer should navigate up in the directory tree looking for the closest analysis_options.yaml file.
It was working as described in dart 3.4.0. It is not happening in dart 3.5.0 and 3.5.1.
Do I need to create a minimal sample project to demonstrate it?
The text was updated successfully, but these errors were encountered: