Giter Club home page Giter Club logo

Comments (6)

dsherret avatar dsherret commented on June 16, 2024 2

@cedric-spinergie it will be added soon. For now, the pre-commit hook can be modified to not fail on exit code 14

I'm thinking --allow-no-files similary to git's --allow-empty

from dprint.

dsherret avatar dsherret commented on June 16, 2024 1

dprint will return the 14 exit code specifically for this purpose: https://dprint.dev/cli/#exit-codes

I believe that could be used here instead of adding a flag?

from dprint.

bradzacher avatar bradzacher commented on June 16, 2024

That is helpful as it's more exact than a substring match of the logs - though we would still need to catch the crash, check for the exit code, and pass on the crash in all other cases.

In an ideal scenario dprint would be able to exit 0 here.

from dprint.

cedric-spinergie avatar cedric-spinergie commented on June 16, 2024

Hello, we have the same issue: if a commit doesn't contain a modification to a file included by dprint, we get the error code 14 which blocks our pre-commit hook from passing even though everything went fine.
We would like to be able to disable this behavior with a cli flag.

from dprint.

cedric-spinergie avatar cedric-spinergie commented on June 16, 2024

Thank you!

One workaround I put in place is to mirror the excludes I configured in dprint.json inside my pre-commit config.
Meaning it won't even try to run dprint if there are no files for it to format.
Just telling about this in case it can help someone else in the meantime.

from dprint.

dsherret avatar dsherret commented on June 16, 2024

This is now available in 0.43.0

from dprint.

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.