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

Feature/add pre commit hook for linting #217

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

4lm
Copy link
Collaborator

@4lm 4lm commented Nov 8, 2022

This PR is based on unmerged PR #197.

Closes #215.

@Bachibouzouk, please review this PR and merge on approval. But first, PR #197 needs to be fixed as spoken by you and merged because this PR depends on it.

This PR uses pre-commit for installing and managing Git hooks.

Initial installation:

  • activate your local Python environment
  • install pre-commit: pip install (app/)requirements.txt
  • install Git hooks: pre-commit install

The config can be found in .pre-commit-config.yaml in the root folder.

Hooks run before every commit.

Run changed files manually:

  • pre-commit

Run all files manually (recommended after installing a new hook):

  • pre-commit

Please note: I configured that hooks shall fail fast. This can result in running the commit (or pre-commit) multiple times. If we realize that this behavior is different from what we want to see, we can change it in the config in the future.

@4lm 4lm requested a review from Bachibouzouk November 8, 2022 16:08
@@ -2,6 +2,7 @@

psycopg2-binary==2.9.3

black==19.3b

Choose a reason for hiding this comment

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

Changing black version now will make a huge black diff

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, as we said in #215. Fine with me, if you merge this PR after the workshop :)

@paulapreuss
Copy link
Collaborator

@Bachibouzouk what is the situation with this PR / issue? I think it would be nice to get the pre-commit hooks set up once before starting back up with development, then it is out of the way :)

@Bachibouzouk
Copy link

Thanks @paulapreuss for taclking this, I think it make sense to tackle precommit at this stage

@Bachibouzouk
Copy link

I think this PR needs rebase

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 this pull request may close these issues.

Add pre-commit hook for linting
3 participants