Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Feat ] Pass optional arguments to hooks #77

Merged
merged 18 commits into from
Sep 6, 2024

Conversation

ProjektGopher
Copy link
Owner

@ProjektGopher ProjektGopher commented Sep 4, 2024

Resolves #64

Some hooks in git are passed arguments for further analysis.

The commit-msg is one example of that. It's passed the path to the file containing the commit message.

This file can be used by scripts like npm's commitlint to allow or block messages that might not conform to the org's standards.

This should allow the following config:

{
    "hooks": {
        "commit-msg": [
            "npx --no -- commitlint --edit \"$1\""
        ]
    }
}

Tasks

  • Add tests
  • Add documentation, including instructions to follow the docs for commitlint explicitly
  • Move Bugfix to separate PR (hooks added by the Update command were not made executable)

@ProjektGopher
Copy link
Owner Author

I'm totally drawing a blank on how to write some tests for this. Wondering if either @gpibarra or @faissaloux have any ideas. 🙏

@ProjektGopher ProjektGopher merged commit 9d012d7 into main Sep 6, 2024
12 checks passed
@ProjektGopher ProjektGopher deleted the feature/pass_args_to_hooks branch September 6, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Not issue] - commitlint
1 participant