generated from br3ndonland/template-python
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from pre-commit to Hatch scripts (#89)
pre-commit runs Git hooks. It can run on different Git events like `pre-push` and can also easily run on CI (continuous integration) platforms like GitHub Actions. These pre-commit hooks are often related to code quality and help ensure code quality checks are continuously enforced. While it is helpful for continuously running code quality checks, pre-commit has some downsides. - pre-commit requires separate dependency versions and configuration in its own file `.pre-commit-config.yaml`, even when those dependencies are already configured in a Python requirements file like `pyproject.toml` (84b25bc). - pre-commit requires separate file paths because it identifies files with Python regular expressions ("regexes") instead of globs like many other tools, and disregards file paths present in other configuration files. Translation between globs and regexes can be complicated and files can be unexpectedly excluded as a result. - pre-commit commands sometimes have different behavior than the commands would have normally. - pre-commit issues are often not explained or fixed. Hatch scripts can replace pre-commit. https://hatch.pypa.io/latest/config/environment/overview/#scripts Changes - Add Hatch scripts to replace pre-commit commands - check: - Black - Flake8 - isort - Mypy - Prettier - CSpell - format: - Black - isort - Prettier - Replace other pre-commit hooks where possible - Replace `mixed-line-ending` by adding `* text=auto eol=lf` to a `.gitattributes` file - Update GitHub Actions workflows to run Hatch scripts - Update docs for Hatch scripts - Remove pre-commit from `pyproject.toml` - Remove `.pre-commit-config.yaml`
- Loading branch information
1 parent
03ac3f7
commit 1a5450b
Showing
7 changed files
with
29 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*cache* | ||
*venv* | ||
htmlcov | ||
public | ||
site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters