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

Pre-commit git hook helper script #818

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Pre-commit git hook helper script #818

wants to merge 3 commits into from

Conversation

biddisco
Copy link
Collaborator

No description provided.

# ln -s -f ../../tools/pre-commit .git/hooks/pre-commit
# ----------------------------------------------------------------

CLANG_FORMAT_VERSION=clang-format-12
Copy link
Collaborator

Choose a reason for hiding this comment

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

DLAF requires version 10. It might make sense to reuse the scripts that are being used in https://github.com/eth-cscs/DLA-Future/blob/master/.github/workflows/check_format.yml, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ooh. I didn't see that stuff in .github I like the test script - except that it doesn't show the user which files to reformat etc. I will investigate further.

@rasolca rasolca marked this pull request as draft April 11, 2023 12:39
@biddisco biddisco marked this pull request as ready for review December 4, 2023 16:47
@biddisco
Copy link
Collaborator Author

biddisco commented Dec 4, 2023

I have modified the primary .github/format.sh script to allow git precommit use.
Instead of reformatting the user's files, when used as a hook, the script builds a list of files that are incorrectly formatted and outputs the list along with a command line that can be invoked to fix the files. (Same as pika pre-commit hook).

When run as a pre-commit hook, the script will output the names
of any badly formatted cpp or cmake files and supply a command line
than can be used to fix them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants