-
Notifications
You must be signed in to change notification settings - Fork 521
CHAD-17043: Created pre-commit script to check for newline and copyright on all staged lua files #2601
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
base: main
Are you sure you want to change the base?
Conversation
…ght on all staged lua files
tools/pre-commit
Outdated
| # - Copy to .git/hooks/pre-commit | ||
| # - Ensure executable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest just making sure this is committed as executable to avoid the hassle.
Also I would suggest to use a softlink instead of copying, so that you don't need to re-copy it later (ln -s ../../tools/pre-commit .git/hooks/pre-commit (use a relative link so you can move the directory later)).
| # pre-commit | ||
| # | ||
| # - Soft link into .git/hooks/pre-commit | ||
| # - $ ln -s tools/pre-commit .git/hooks/pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's different with your version of ln, but usually the first argument is assigned to the symlink verbatim, rather than computed from where you invoked the command. So, it should be ../../tools/pre-commit.
Description of Change
Created a script to check all staged lua files that they end with a newline character and begin with the current year's copyright header. This file should be made executable and copied to
.git/hooks/pre-commit.Type of Change