diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dfef006 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,69 @@ +ci: + autofix_prs: false + autoupdate_schedule: monthly + +# Specify the default version of Ruby in case it is not installed +default_language_version: + ruby: 2.7.2 + +repos: + +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-merge-conflict + name: check for git merge conflicts + exclude: .*\.rst + - id: check-case-conflict + name: check for filename case conflicts + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-json + - id: check-toml + - id: check-yaml + +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + +- repo: https://github.com/sirosen/texthooks + rev: 0.6.4 + hooks: + - id: fix-smartquotes + - id: fix-spaces + - id: fix-ligatures + - id: forbid-bidi-controls + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.12.0 + hooks: + - id: pretty-format-ini + args: [--autofix] + - id: pretty-format-yaml + args: [--autofix] + # For the labeler GitHub Action, labels with spaces in them must + # be put in quotes. However, the pretty-format-yaml hook will + # remove the quotes which will break that action, so we should not + # run this hook on `labeler.yml` (or certain other files). + exclude: .github/labeler.yml|.pre-commit-search-and-replace.yaml + +- repo: https://github.com/mattlqx/pre-commit-search-and-replace + rev: v1.0.5 + hooks: + - id: search-and-replace + exclude: changelog/.*|docs/changelog/.*|.sourcery.yaml|docs/_global_substitutions.py|CHANGELOG.rst + +- repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + name: codespell (add false positives to pyproject.toml) + args: [--write-changes] + additional_dependencies: + - tomli + +- repo: https://github.com/executablebooks/mdformat + rev: 0.7.17 + hooks: + - id: mdformat