Skip to content

Comments

Add pre-commit hook for formatting, linting, and sorting#172

Merged
jking-aus merged 5 commits intosigp:unstablefrom
diegomrsantos:git-pre-commit-hook
Mar 11, 2025
Merged

Add pre-commit hook for formatting, linting, and sorting#172
jking-aus merged 5 commits intosigp:unstablefrom
diegomrsantos:git-pre-commit-hook

Conversation

@diegomrsantos
Copy link
Member

@diegomrsantos diegomrsantos commented Mar 5, 2025

Proposed Changes

Create a pre-commit file in .githooks. You only need to run git config core.hooksPath .githooks and the old days of CI failures are over.

@diegomrsantos diegomrsantos self-assigned this Mar 5, 2025
@diegomrsantos diegomrsantos added chore ready-for-review This PR is ready to be reviewed labels Mar 5, 2025
@dknopik
Copy link
Member

dknopik commented Mar 6, 2025

I think invoking the appropriate commands in the Makefile would be more appropriate, in order to use the flags specified there. i.e. make lint

@diegomrsantos
Copy link
Member Author

I think invoking the appropriate commands in the Makefile would be more appropriate, in order to use the flags specified there. i.e. make lint

I agree. Are they make cargo-fmt, make lint, and make sort?

@diegomrsantos
Copy link
Member Author

@dknopik should we get it merged like this?

@dknopik
Copy link
Member

dknopik commented Mar 10, 2025

@diegomrsantos how about the switch to invoking the make targets?

@diegomrsantos
Copy link
Member Author

@diegomrsantos how about the switch to invoking the make targets?

The make targets have an error that causes the script to fail. Additionally, the fmt and lint ones only check and don't apply fixes.

@dknopik
Copy link
Member

dknopik commented Mar 10, 2025

The make targets work fine on my end, and are also what's used in CI. But I will likely not use this anyway 🤷‍♂️

Copy link
Member

@jking-aus jking-aus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - I have my own local pre-commit hooks but happy to merge if this is easier

@jking-aus jking-aus merged commit 8dc8d83 into sigp:unstable Mar 11, 2025
10 checks passed
@dknopik dknopik removed the ready-for-review This PR is ready to be reviewed label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants