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

Add a pre-commit hook to expand relative ticket refs to absolute #123

Open
bswck opened this issue Apr 20, 2024 · 2 comments
Open

Add a pre-commit hook to expand relative ticket refs to absolute #123

bswck opened this issue Apr 20, 2024 · 2 comments

Comments

@bswck
Copy link
Contributor

bswck commented Apr 20, 2024

The hook would possibly change commit messages to ensure absolute ticket refs.

E.g.

  • #27jaraco/skeleton#27, if we commit in skeleton,
  • #27jaraco/tempora#27, if we commit in tempora.

Addresses commit integrations mismatch.

@jaraco
Copy link
Owner

jaraco commented Apr 22, 2024

Yes, that sounds wise!

I'm a little worried about a pre-commit hook, because it requires the developer to have the hook installed (which in turn requires the developer to have the tool installed somewhere) and doesn't affect contributions through GitHub. What I'd like more is something like branch protection that would reject a push that mentions a bare issue number.

@Avasam
Copy link
Contributor

Avasam commented Sep 24, 2024

I'd love to see this as a proejct-wide, file-extension-agnostic check too ! It's an issue when working in forks. It would also make it easier to copy the issue reference outside the repo.
And yeah, doesn't have to be pre-commit.ci to be autofixable #109 (comment)
However, I can't think of any existing tool to be leveraged that I use other than pre-commit (the tool, not the git hook) which runs on all files. So it might have to be standalone.

A CI check w/o autofixes could probably easily be done with a grep script.

Btw I'm using https://marketplace.visualstudio.com/items?itemName=dt.ghlink to make those actual clickable links in VSCode

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

No branches or pull requests

3 participants