59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
# .pre-commit-config.yaml
|
|
|
|
# Optional: Set a minimum pre-commit version
|
|
# min_pre_commit_version: '2.9.0'
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0 # Use the latest stable version
|
|
hooks:
|
|
- id: check-yaml
|
|
- id: end-of-file-fixer
|
|
- id: trailing-whitespace
|
|
# - id: check-added-large-files # Optional: good for catching accidental large file commits
|
|
|
|
- repo: https://github.com/pycqa/flake8
|
|
rev: 7.0.0 # Use the latest stable version of flake8
|
|
hooks:
|
|
- id: flake8
|
|
# Optional: specify arguments for flake8
|
|
# args: ['--max-line-length=88', '--extend-ignore=E203']
|
|
# It's often better to configure flake8 via .flake8, setup.cfg, or pyproject.toml
|
|
# so it's consistent whether run via pre-commit or manually.
|
|
additional_dependencies: [
|
|
# Add any flake8 plugins you use here, e.g.:
|
|
# 'flake8-bugbear',
|
|
# 'flake8-comprehensions',
|
|
# 'flake8-docstrings',
|
|
# 'pep8-naming'
|
|
]
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
rev: v2.2.6 # Use the latest stable version
|
|
hooks:
|
|
- id: codespell
|
|
args: [
|
|
# "--ignore-words-list=your,custom,words,here",
|
|
# Or point to a file:
|
|
# "--ignore-words=.codespellignore",
|
|
"--skip=*.json,*.lock,*.svg,*.css,*.html", # Skip file types less likely to need it
|
|
# "--check-filenames",
|
|
# "--check-hidden"
|
|
]
|
|
# You can create a .codespellignore file with one word per line for words to ignore.
|
|
|
|
# --- Version checking ---
|
|
- repo: local
|
|
hooks:
|
|
- id: version-check
|
|
name: check for version consistency
|
|
# The command to execute. It's a Python script.
|
|
entry: python3 tool/check_versions.py
|
|
# Use 'system' to run it with the current environment's Python
|
|
language: system
|
|
# This hook doesn't need to run on every file.
|
|
# It should run if either of the version files change.
|
|
# This makes it very fast.
|
|
files: ^(pyproject\.toml|src/nodes/__init__\.py)$
|
|
# The regex `^...$` ensures it matches the full path from the repo root.
|