aliases:
- precommit
tags:
- Type/Tech/Platform/Tool
- area/tech
publish: true
version: 1.1
dateCreated: 2022-07-25, 17:09
dateModified: 2024-09-23, 11:34
from:
- "[[Tech]]"
related:
contra:
to:
.pre-commit-config.yaml
to the root of your projectrepos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
git add .pre-commit-config.yaml
and commit to your repo and it should work.pre-commit
will only run on the changed files during git hooks)pre-commit run --all-files
.pre-commit-config.yaml
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false