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

Adding in an opinionated pre-commit #188

Open
ericmjl opened this issue Oct 29, 2019 · 7 comments
Open

Adding in an opinionated pre-commit #188

ericmjl opened this issue Oct 29, 2019 · 7 comments
Milestone

Comments

@ericmjl
Copy link

ericmjl commented Oct 29, 2019

I would like to propose adding in an opinionated .pre-commit-config.yaml, to enable pre-commit hooks in the project. Doing so would help push automated code checks directly to the local repo clone, and can help with ensuring code quality.

In terms of whether or not this should be enabled by default, I would lean towards not enabling it by default, as the use of pre-commit is not commonly taught in introductory git courses. However, I am quite sure that seasoned git users will appreciate its availability in the repository nonetheless.

Before I get working on it, was wondering what you all might think about this contribution? As this would be my first contribution to the repo, I am happy to follow your guidance on what else should be added.

@sobolevn
Copy link

sobolevn commented Feb 21, 2020

I would also love to see this feature! Consider adding wemake-python-styleguide as a part of the pre-commit pipeline

@fgriberi
Copy link

Hi guys, can I take this issue? What I have in mind is a pre-commit with the following plugin:

  • flake8
  • isort
  • wemake-python-styleguide
  • black

please, let me know your thoughts

@sobolevn
Copy link

@fgriberi feel free to ping me for review / help 👍

@pjbull
Copy link
Member

pjbull commented Apr 18, 2020

I like the idea of this. A few additional thoughts:

  • We've done a register-hook make command for easy installation in the past. I think by default that command should be optional (but, our team often makes it a dependency of requirements).
  • If the precommit hook runs make commands, then committing updated make commands updates the hook for everyone, which is convenient.
  • A few opinions: wemake-python-styleguide is too opinionated for a default. flake8 is a definite for me, black is probably, isort I could take or leave but don't feel strongly.

Also, it is worth noting that the current project template is supposed to be VCS agnositic, so it almost makes more sense once #162 is in. (Which we are pushing right now to get CI working for, if anyone wants to look at #205 where @jayqi was exploring ways to test virtualenvwrapper on Windows).

@fgriberi
Copy link

@pjbull I've been thinking about using pre-commit instead of a bash script. The integration with the mentioned tools is awesome. What do you think?

@pjbull
Copy link
Member

pjbull commented Apr 19, 2020

I didn't find the increase in complexity to be worth it for our team, and I think that it sacrifices the flexibility that a project template like this should have.

@smb-h
Copy link

smb-h commented Sep 28, 2023

Hi everyone,

I've created a pull request (#323) that addresses this issue. It adds pre-commit hooks for code formatting and linting to enhance code quality and consistency in the project. The pre-commit hooks include tools such as pre-commit-hooks, mirrors-prettier, black, isort, and flake8.

You can review the pull request here: Pull Request #323

Your feedback and suggestions are greatly appreciated. Please take a look at the changes, and if everything looks good, your approval would be fantastic. If you have any comments or questions, feel free to share them in the PR discussion.

Let's work together to improve the code quality of this project! Thank you for your attention to this matter.

@chrisjkuch chrisjkuch added this to the v2.1 milestone Oct 9, 2023
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

No branches or pull requests

6 participants