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

Lint for unspecified version constraints on packages #57177

Open
kevmoo opened this issue Feb 14, 2015 · 5 comments
Open

Lint for unspecified version constraints on packages #57177

kevmoo opened this issue Feb 14, 2015 · 5 comments
Labels
area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@kevmoo
Copy link
Member

kevmoo commented Feb 14, 2015

No description provided.

@pq pq added the type-enhancement A request for a change that isn't a bug label Feb 15, 2015
@pq
Copy link
Member

pq commented Feb 15, 2015

Awesome. I've been thinking about pub lints. Glad to have the ball rolling.

Could you fill in some more details? Are there any exceptions?

How strong should this advice be? I'm guessing DO rather than PREFER? In that case, how about:

DO specify version constraints for all package dependencies.

Is there further validation we can do on constraints?

FWIW: here are some rough docs on writing lints. Any additional bits (good/bad examples, etc), greatly appreciated!

@pq
Copy link
Member

pq commented Feb 15, 2015

@kevmoo : Also, is none the same as any?

In particular, I notice the advice for application packages is to specify any for their deps:

https://www.dartlang.org/tools/pub/glossary.html#application-package

@seaneagan
Copy link

@munificent @nex3 I know you were considering adding more package validation features such as this to pub itself at some point. Wanted to loop you in case you have an opinion on this. I think most of the pub lints would not really be "style" issues, more along the lines of of not following best practices or going against pub conventions.

@munificent
Copy link
Member

Natalie and I don't currently have any plans to add linting to pub itself. It would be nice, but it's really unlikely we'll find the time to do it this century. I'd be happy if the linter did this.

@nex3
Copy link
Member

nex3 commented Feb 17, 2015

Well, we do have a system in place to do some validation of packages before they get uploaded, which actually includes this specific issue. I've always wanted to expand that to some degree, but never really had time, and now that we're getting a dedicated linter it may be less necessary. Generally the checks we have are focused on maintaining the integrity of the package ecosystem, since it's possible for one busted package to cause rippling problems.

This particular validation is risky to do without more context, for what it's worth. "Application" packages, which is to say packages that are intended to be run on their own and not used as libraries, are actually encouraged to avoid constraints for their dependencies. The expectation is that everyone working on them will want to have an identical set of dependency versions, so we encourage users to check in their lockfiles and use pub upgrade to handle their dependency versioning.

@srawlins srawlins added the P3 A lower priority bug or feature request label Oct 11, 2022
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
@bwilkerson bwilkerson added area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) and removed area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

8 participants