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

Switch from pre-commit to Hatch scripts #89

Merged
merged 2 commits into from Nov 13, 2023
Merged

Conversation

br3ndonland
Copy link
Owner

Description

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.

Hatch scripts can replace pre-commit.

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

Related

- Add Hatch scripts to replace pre-commit commands
  - check:
    - Black
    - isort
    - Flake8
    - 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
    `.gitattributes`
- Update GitHub Actions workflows to run Hatch scripts
- Update docs for Hatch scripts
- Remove pre-commit from `pyproject.toml`
- Remove `.pre-commit-config.yaml`

https://hatch.pypa.io/latest/config/environment/overview/#scripts
Copy link

vercel bot commented Nov 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
inboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2023 0:04am

@br3ndonland br3ndonland merged commit 1a5450b into develop Nov 13, 2023
21 checks passed
@br3ndonland br3ndonland deleted the hatch-scripts branch November 13, 2023 00:11
@ofek
Copy link

ofek commented Nov 13, 2023

I find your writeups incredibly informative, thanks again!

br3ndonland added a commit to br3ndonland/terraform-examples that referenced this pull request Jan 4, 2024
br3ndonland added a commit to br3ndonland/dotfiles that referenced this pull request Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants