## Summary AFAIK, many of us on the team are using prek now. It seems appropriate to modify the docs to formalize it.
139 lines
4.3 KiB
YAML
139 lines
4.3 KiB
YAML
fail_fast: false
|
|
|
|
exclude: |
|
|
(?x)^(
|
|
.github/workflows/release.yml|
|
|
crates/ty_vendored/vendor/.*|
|
|
crates/ty_project/resources/.*|
|
|
crates/ty_python_semantic/resources/corpus/.*|
|
|
crates/ty/docs/(configuration|rules|cli|environment).md|
|
|
crates/ruff_benchmark/resources/.*|
|
|
crates/ruff_linter/resources/.*|
|
|
crates/ruff_linter/src/rules/.*/snapshots/.*|
|
|
crates/ruff_notebook/resources/.*|
|
|
crates/ruff_server/resources/.*|
|
|
crates/ruff/resources/.*|
|
|
crates/ruff_python_formatter/resources/.*|
|
|
crates/ruff_python_formatter/tests/snapshots/.*|
|
|
crates/ruff_python_resolver/resources/.*|
|
|
crates/ruff_python_resolver/tests/snapshots/.*|
|
|
crates/ty_completion_eval/truth/.*
|
|
)$
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v6.0.0
|
|
hooks:
|
|
- id: check-merge-conflict
|
|
|
|
- repo: https://github.com/abravalheri/validate-pyproject
|
|
rev: v0.24.1
|
|
hooks:
|
|
- id: validate-pyproject
|
|
|
|
- repo: https://github.com/executablebooks/mdformat
|
|
rev: 1.0.0
|
|
hooks:
|
|
- id: mdformat
|
|
language: python # means renovate will also update `additional_dependencies`
|
|
additional_dependencies:
|
|
- mdformat-mkdocs==5.0.0
|
|
- mdformat-footnote==0.1.2
|
|
exclude: |
|
|
(?x)^(
|
|
docs/formatter/black\.md
|
|
| docs/\w+\.md
|
|
)$
|
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: v0.47.0
|
|
hooks:
|
|
- id: markdownlint-fix
|
|
exclude: |
|
|
(?x)^(
|
|
docs/formatter/black\.md
|
|
| docs/\w+\.md
|
|
)$
|
|
|
|
- repo: https://github.com/adamchainz/blacken-docs
|
|
rev: 1.20.0
|
|
hooks:
|
|
- id: blacken-docs
|
|
language: python # means renovate will also update `additional_dependencies`
|
|
args: ["--pyi", "--line-length", "130"]
|
|
files: '^crates/.*/resources/mdtest/.*\.md'
|
|
exclude: |
|
|
(?x)^(
|
|
.*?invalid(_.+)*_syntax\.md
|
|
)$
|
|
additional_dependencies:
|
|
- black==25.12.0
|
|
|
|
- repo: https://github.com/crate-ci/typos
|
|
rev: v1.40.0
|
|
hooks:
|
|
- id: typos
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: cargo-fmt
|
|
name: cargo fmt
|
|
entry: cargo fmt --
|
|
language: system
|
|
types: [rust]
|
|
pass_filenames: false # This makes it a lot faster
|
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.14.10
|
|
hooks:
|
|
- id: ruff-format
|
|
- id: ruff-check
|
|
args: [--fix, --exit-non-zero-on-fix]
|
|
types_or: [python, pyi]
|
|
require_serial: true
|
|
|
|
# Prettier
|
|
- repo: https://github.com/rbubley/mirrors-prettier
|
|
rev: v3.7.4
|
|
hooks:
|
|
- id: prettier
|
|
types: [yaml]
|
|
|
|
# zizmor detects security vulnerabilities in GitHub Actions workflows.
|
|
# Additional configuration for the tool is found in `.github/zizmor.yml`
|
|
- repo: https://github.com/zizmorcore/zizmor-pre-commit
|
|
rev: v1.19.0
|
|
hooks:
|
|
- id: zizmor
|
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
rev: 0.36.0
|
|
hooks:
|
|
- id: check-github-workflows
|
|
|
|
# `actionlint` hook, for verifying correct syntax in GitHub Actions workflows.
|
|
# Some additional configuration for `actionlint` can be found in `.github/actionlint.yaml`.
|
|
- repo: https://github.com/rhysd/actionlint
|
|
rev: v1.7.9
|
|
hooks:
|
|
- id: actionlint
|
|
stages:
|
|
# This hook is disabled by default, since it's quite slow.
|
|
# To run all hooks *including* this hook, use `uvx prek run -a --hook-stage=manual`.
|
|
# To run *just* this hook, use `uvx prek run -a actionlint --hook-stage=manual`.
|
|
- manual
|
|
args:
|
|
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck
|
|
- "-ignore=SC2016" # another shellcheck lint: seems to have false positives?
|
|
language: golang # means renovate will also update `additional_dependencies`
|
|
additional_dependencies:
|
|
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
|
|
# and checks these with shellcheck. This is arguably its most useful feature,
|
|
# but the integration only works if shellcheck is installed
|
|
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"
|
|
|
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
rev: v0.11.0.1
|
|
hooks:
|
|
- id: shellcheck
|