Coder Social home page Coder Social logo

Usage with `pre-commit` about gitlint HOT 3 CLOSED

jorisroovers avatar jorisroovers commented on May 18, 2024
Usage with `pre-commit`

from gitlint.

Comments (3)

asottile avatar asottile commented on May 18, 2024

The interface for pre-commit is to pass a single argument on the commandline that is the commit-msg filename. It seems that gitlint doesn't have an interface which enables this -- I'll see if I can't craft a PR.

A workaround would be to use the interface that gitlint uses in its hook file, something like this:

-   id: gitlint
    name: gitlint
    language: python
    entry: bash -c 'cat "$@" | python -m gitlint.cli' --
    stages: [commit-msg]

from gitlint.

sobolevn avatar sobolevn commented on May 18, 2024

@asottile thanks! That's almost the same I came up with.

Take a look: https://github.com/wemake-services/wemake-django-template/blob/master/%7B%7B%20cookiecutter.project_name%20%7D%7D/.pre-commit-config.yaml

from gitlint.

asottile avatar asottile commented on May 18, 2024

@sobolevn the problem with that definition is it'll be linting the commit that already happened and you really want it to be checking the in-progress commit :)

from gitlint.

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.