Skip to content
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

Why does dart pub lish -n analyze things in .pubignore? #3696

Open
pq opened this issue Dec 13, 2022 · 6 comments
Open

Why does dart pub lish -n analyze things in .pubignore? #3696

pq opened this issue Dec 13, 2022 · 6 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@pq
Copy link
Member

pq commented Dec 13, 2022

Context: we have a bunch of test data in the linter repo that doesn't analyze cleanly (by design) and that creates noise when we want to publish.

When I learned about .pubignore I thought I was golden and in fact, doubly so, since I don't want to publish this test data anyway but I was surprised to see it still producing warnings when I dart pub lish -n.

Is this by design? Am I just holding things wrong?

Thanks!

@sigurdm
Copy link
Contributor

sigurdm commented Dec 13, 2022

Good question. We probably shouldn't.

I don't know how hard it will be to only analyze the files being published.
If we just invoke with the included files on the command line, I think it will grow too long easily. Maybe we can feed the analyzer a temporary include-file somehow.

@sigurdm sigurdm added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 13, 2022
@sigurdm
Copy link
Contributor

sigurdm commented Dec 13, 2022

Hmm - tried getting the diagnostics via package:analyzer instead of invoking dart analyze- but it seems it has no public access to diagnostics for pubspec.yaml.

If I do analysisSession.getErrors('/path/to/pubspec.yaml') It gets analyzed as a dart library.

Not sure if we should move to driving dart language-server, or push for package:analyzer to support this, or some third solution...

@pq
Copy link
Member Author

pq commented Dec 13, 2022

@sigurdm: is the AnalyzeValidator doing the analysis?

/fyi @bwilkerson

@sigurdm
Copy link
Contributor

sigurdm commented Dec 16, 2022

is the AnalyzeValidator doing the analysis?

Yes, that is it.

@sigurdm
Copy link
Contributor

sigurdm commented Feb 24, 2023

@bwilkerson and @pq do you have any suggestions how to drive the analyzer with an arbitrary (and temporary) exclude-list?

@pq
Copy link
Member Author

pq commented Feb 24, 2023

It looks like AnalyzeValidatorshells out to the dart analyze CLI which I don't think nicely provides what you want. What I don't know is if it would be easier/better to add support there (with a hidden option for example) or if we shouldn't invest in re-writing the validator to use analyzer APIs directly or use analysis server protocols. @bwilkerson?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants