Comments (8)
There's actually a nasty problem here :/ ... because we have conflated the analysis options with the tiny amount of code in lib/pedantic.dart
.
dev_dependencies
are not a problem, but anyone using unawaited
needs a normal dependency. If two packages both use unawaited
, and want different pinned versions of lints, then they can't be used together. They will be forced to move to the same version of the lints, first.
Here's one possible solution. We could include all versions of the analysis options in the package:
lib/analysis_options.1.2.0.yaml
lib/analysis_options.1.3.0.yaml
lib/analysis_options.1.4.0.yaml
then, also include an analysis_options.yaml
file that points to the latest version. So for most people behaviour is unchanged. If you want to pin
your analysis options version, you do that by including a specific yaml file; it's no longer anything to do with pub.
What do you think?
from pedantic.
An other option would be to publish an other package containing only the yaml file.
pedantic
forunawaited
...pedantic_yaml
(or something else) foranalysis_options.yaml
- this package will be used exclusively indev_dependencies
and every change can be released by bumping its major version.
from pedantic.
Yes. I'm not a huge fan of the idea, partly because of overhead in migrating to and maintaining an additional package, and partly because the yaml files don't really seem to fit with pub: they're not dart code, and every new version is incompatible.
But it would solve the problem :)
from pedantic.
Having versioned sets of analysis options files seems great - it would let projects pin on specific versions, and migrate to new ones as they wanted to.
from pedantic.
I'll be a voice in the other direction on this one. It's definitely annoying that changes to package:pedantic
can break our packages. However, these breaks are often trivial to fix and are a good alert that there is a new standard to adopt. I don't see us actively upgrading to the newer lints otherwise. If we really want to enable users to pin to a version I suggest providing lib/analysis_options.latest.yaml
or something.
edit
Looks like the linked PR keeps the latest version under lib/analysis_options.yaml
so there is no need for lib/analysis_options.latest.yaml
.
from pedantic.
One reason not to pin versions is if you care about your pana scoring. I'm guessing there you'll always be graded on latest? (@jonasfj?)
Awareness of new rules is a known, acute but as of yet unsolved problem. 😬 (See also: dart-lang/linter#1390.)
from pedantic.
+1 for providing versioned files with the regular analysis_options.yaml
as an alias for the latest one.
That allows you to keep up with the latest lints, while also providing a low friction path to temporarily pinning to a previous version if you don't have time to update immediately when you get broken by the new lints.
from pedantic.
Thanks for the input everyone. Let's see how this works. I think giving people choice makes sense--the default is still to pin to head, but I know that will annoy some people, particularly on big projects.
from pedantic.
Related Issues (20)
- Rephrase README - the lints reach outside the scope of effective Dart HOT 1
- Tag the v1.9.0 release HOT 2
- Ignore rules in yaml config HOT 4
- Omit type annotations for local variables make code harder to understand. HOT 49
- Unable to use 1.9.0 on Flutter stable 1.12.13+hotfix.5 HOT 7
- prefer_single_quotes needs an automatic fix HOT 5
- Getting dart analyses warning for auto generated file HOT 3
- Omit type annotation for local variable lint warning is only shown in certain situation. HOT 20
- Don't allow `as` to be used in casting, it does more harm than good. HOT 2
- 'flutter pub get' fails for pedantic 1.9.1 HOT 4
- Re-add back the definition of `unawaited` to this package
- Invalid include_file_not_found when pedantic added to dev_dependencies HOT 5
- What does "does not reflect common usage" mean? HOT 4
- Exclude option doesn't work HOT 1
- Feature request: find hardcoded strings HOT 1
- Allow future.unawaited aside unawaited(future) HOT 12
- Remove unsafe_html HOT 2
- Show lint warning when a late marked field is final and initialized when declaring. HOT 3
- sort_constructors_first gives false positives for factories HOT 2
- Provide an options file which includes `package:lints/recommended.yaml` HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pedantic.