-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.pre-commit-config.yaml
51 lines (45 loc) · 1.81 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# pre-commit (https://pre-commit.com/) is a tool that runs source code checks
# such as linting, formatting, and code style.
# CI
# pyosMeta uses pre-commit with the precommit.ci bot to check pull requests.
# Configuration reference doc: https://pre-commit.com/#pre-commit-configyaml---top-level
# Developers
# You may want to install pre-commit to run locally on each minimum_pre_commit_version
# See https://pre-commit.com/#install
# To set up pre-commit hooks: pre-commit install
# To run on all files: pre-commit run --all-files
ci:
# We prefer to disable autofixing of PRs to simplify new contributor
# We use the autofix as an option before we merge to run linting if a conributor
# doesn't setup pre-commit (which can be confusing to new contributors)
autofix_prs: false
# Frequency of hook updates
autoupdate_schedule: quarterly
repos:
# Out of the box hooks for pre-commit https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Remove trailing whitespace on code lines
- id: trailing-whitespace
# Spelling hook
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
# Lint code using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Ruff can be used as a code formatter replacing black
# It can also replace isort
- id: ruff-format
args: ["--line-length", "79"]