Coder Social home page Coder Social logo

Comments (8)

davidmorgan avatar davidmorgan commented on May 14, 2024 1

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.

a14n avatar a14n commented on May 14, 2024 1

An other option would be to publish an other package containing only the yaml file.

  • pedantic for unawaited...
  • pedantic_yaml (or something else) for analysis_options.yaml - this package will be used exclusively in dev_dependencies and every change can be released by bumping its major version.

from pedantic.

davidmorgan avatar davidmorgan commented on May 14, 2024

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.

devoncarew avatar devoncarew commented on May 14, 2024

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.

grouma avatar grouma commented on May 14, 2024

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.

pq avatar pq commented on May 14, 2024

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.

jakemac53 avatar jakemac53 commented on May 14, 2024

+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.

davidmorgan avatar davidmorgan commented on May 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.