Skip to content

melvinalmonte/python-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-pre-commit

  1. Install pre-commit: pip install pre-commit will install pre-commit
  2. Add pre-commit to requirements.txt pip freeze | grep pre-commit >> requirements.txt
  3. Define .pre-commit-config.yaml with the hooks you want to include.
  4. Execute pre-commit install to install git hooks in your .git/ directory similar to that of husky.

Example using Black and flake8

Black for formatting (similar to prettier in js) and flake8 for PEP8 compliance (similar to eslint for node apps)

Notes

View .pre-commit-config.yaml for an example of the pre-commit config that will be installed.

View pyproject.toml for an example of a simple Black config.

View .flake8 for the flake8 config.

This is a great article that pretty much sets up a project the same way.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages