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

Use https://pre-commit.com/ #1192

Closed
JoranAngevaare opened this issue Jun 5, 2023 · 0 comments · Fixed by #1240
Closed

Use https://pre-commit.com/ #1192

JoranAngevaare opened this issue Jun 5, 2023 · 0 comments · Fixed by #1240

Comments

@JoranAngevaare
Copy link
Contributor

Hi next-gen straxen maintainers!

Long ago I added https://github.com/XENONnT/straxen/blob/master/.github/workflows/code_style.yml, which is a bit... flaky. For starters, it has to modify the source code to run at all (using pre_pyflakes.sh) at that time I was looking for a slightly nicer tool, but did not find any. This pre-commit tool is in my view a nice tool that automatically fixes tedious code style formalities, decreasing time and frustration on both reviewer and developer side.

You can add it as an automation super easily following their documentation. Just to give you an idea:

git clone https://github.com/XENONnT/straxen
cd straxen
pip install pre-commit
pre-commit sample-config >>.pre-commit-config.yaml
pre-commit run --all-files
git diff
rm .github/scripts/pre_pyflakes.sh .github/workflows/code_style.yml  # get rid of the home grown tools

Of course, totally up to you if it's useful 😉.

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 a pull request may close this issue.

1 participant