-
Notifications
You must be signed in to change notification settings - Fork 65
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
Custom lint breaks when analysis_options.yaml is not at package root #148
Comments
That's not the behavior I've seen. I have multiple projects with a root analysis_options but no associated pubspec, and custom_lint works just fine on them. |
So I tried to make a minimal reproducible example, and yet for some reason it was not having the issue either. I kept trying to make it more similar to my package that isn't working (same Dart lints, structure, everything) but to no avail. I think the only difference between them at this point is the number of files/lines of code, and length of time they've existed... Have any ideas what could cause it? I suppose when I get another chance to look into it I can clone and debug custom_lint myself. |
Looking into this a little bit right now. For the package having issues, For the package not having issues, Seems pretty relevant to the issue. I'll continue to debug. |
Kinda embarrassing, but when trying to make the minimal reproducible example, I mistyped |
I can confirm this breaks it. |
TIL that we can put Fair enough then, this does need testing indeed |
@rrousselGit @TimWhiting Thanks for the progress made on the PR so far! It looks like it hasn't been touched for a few months now though. Is there any more progress being made? This seems like a significant issue because it entirely prevents the use of custom lint in some projects, which includes mine. |
Sorry, I've been out of the loop as far as this project goes. I'm unaware of what has changed as far as how custom_lint resolves packages since I last worked on the PR, but it looks like a lot has changed. Feel free to rebase the PR on the main branch and take over it if it is blocking you. I'm no longer actively working on it. |
I also experienced this problem when setting up custom_lint in Patrol repository. Here's the repro: |
This is needed because of bug in custom_lint: invertase/dart_custom_lint#148
* set up `custom_lint` in all packages * gitignore all custom_lint.log files * fix new lint warnings * update prepare-* workflows to run custom_lint * delete analysis_options in directories that do not have pubspec.yaml This is needed because of bug in custom_lint: invertase/dart_custom_lint#148 * fix tests
@rrousselGit I think that this may have regressed lately, my nested analysis options files are not being respected anymore, I jumped from version |
Actually, this is also happening with the |
If a package has additional
analysis_options.yaml
files that are not at the root of the package, then custom lint will attempt to read apubspec.yaml
at the same location as the analysis options. The pubspec doesn't exist, and custom lint fails to start.Example:
Custom lint expects there to be a
pubspec.yaml
with every options file, and will throw the error:PathNotFoundException: Cannot open file, path = 'project/path/my_package/test/pubspec.yaml' (OS Error: No such file or directory, errno = 2)
A PR was made to fix this several months ago, but was eventually abandoned.
#19
The text was updated successfully, but these errors were encountered: