Warn if analysis options are included from a file outside the package - #4855
Open
sigurdm wants to merge 2 commits into
Open
Warn if analysis options are included from a file outside the package#4855sigurdm wants to merge 2 commits into
sigurdm wants to merge 2 commits into
Conversation
jonasfj
reviewed
Aug 12, 2026
Comment on lines
+14
to
+19
| /// Validates that `analysis_options.yaml` (and other analysis options files) | ||
| /// do not include configuration from a local file outside the package. | ||
| /// | ||
| /// Including files outside the package causes analysis errors on `pub.dev` | ||
| /// and for consumers because those external files are not included in the | ||
| /// published archive. |
Member
There was a problem hiding this comment.
It doesn't create issues for consumers.
It is true that the package is not self contained.
It doesn't necessarily create analysis issues on pub.dev, only if the included thing disabled lints / errors. Not if it just add more lints.
This could just as well be a lint in the analyzer. which is triggered whenever:
pubspec.yamlcontainsversion:and,pubspec.yamldoes not containpublish_to: none.
Then it would pretty much only affect people who write packages.
Granted, I doubt we could convince people to land this as a lint :D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4853.
Adds
AnalysisOptionsValidatorto warn whenanalysis_options.yaml(or any other analysis options file in the package) includes a configuration file outside the package directory.