Giter Club home page Giter Club logo

Comments (10)

jvarness avatar jvarness commented on August 12, 2024 1

dartfmt has an option to do a dry run and set the exit code to 1 if there are changes. That might be a good option.

from dart.

Stargator avatar Stargator commented on August 12, 2024

@jvarness We ran it via the check_formatting scripting, so it runs on all platforms.

from dart.

jvarness avatar jvarness commented on August 12, 2024

@Stargator if your environment has the dart sdk installed though, won't it have dartfmt installed by default? Are there installations that don't include dartfmt?

from dart.

Stargator avatar Stargator commented on August 12, 2024

@jvarness You are right, the script allows checks the formatting of the config.json. So instead of a single line for each command we rolled similar commands together in the check_formatting.dart and the presubmit.dart scripts.

from dart.

Stargator avatar Stargator commented on August 12, 2024

We're not set in stone, but we wanted to run one script versus two commands to check formatting of the project and the config file. Anyone that wants this, can take it. I'm trying to wrap up a few things I had on the back burner.

from dart.

Stargator avatar Stargator commented on August 12, 2024

@Stargator if your environment has the dart sdk installed though, won't it have dartfmt installed by default? Are there installations that don't include dartfmt?

An additional point to make is that the SDK has a set version of the dartfmt package (dart_style). So if you want a newer version you'd have to run pub global activate dart_style. So if we add that to the script, then it would more justify manually running the dartfmt executable since it would follow updating the global package version.

from dart.

jvarness avatar jvarness commented on August 12, 2024

@Stargator I've been working on this but I've hit some snags.

Looks like the Dart runner for Travis doesn't honor when exit codes are set within a Dart script. I'll need to investigate a little more and get back to you.

I figured out how to make formatting fail and how to run all the tests, but there's weird stuff happening with setting exit codes.

from dart.

Stargator avatar Stargator commented on August 12, 2024

I've experienced this with Jenkins. I resolved it by throwing an error when the exit code was non-zero.

from dart.

jvarness avatar jvarness commented on August 12, 2024

Throwing the error is fine, but after rebasing with master, it looks like the jobs are now stalling when the formatting of all the files is checked:

https://travis-ci.org/jvarness/dart

from dart.

Stargator avatar Stargator commented on August 12, 2024

Resolved in #129

from dart.

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.