-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
94 lines (92 loc) · 2.41 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
fail_fast: true
exclude: |
(?x)^(
build/ |
dist/ |
)$
repos:
- repo: meta
hooks:
- id: identity
- id: check-hooks-apply
# Protect secrets using Gitleaks
- repo: https://github.com/zricethezav/gitleaks
rev: v8.21.1
hooks:
- id: gitleaks
# Validate pyproject.toml
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.21
hooks:
- id: validate-pyproject
# Spell check
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
hooks:
- id: typos
# Supported base hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
# Hadolint Dockerfile linter
- repo: https://github.com/hadolint/hadolint
rev: v2.13.1-beta
hooks:
- id: hadolint
# # SQL linter
# - repo: https://github.com/sqlfluff/sqlfluff
# rev: 3.1.0
# hooks:
# - id: sqlfluff-lint
# args: [--dialect, postgres]
# Markdown lint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: [--disable, MD013]
types: [file]
files: .(md|qmd)$
# Add trailing commas to calls and literals.
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
# Lint and format Python files
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.0
hooks:
# Run the Ruff formatter.
- id: ruff-format
args: [--config=pyproject.toml]
# Run the Ruff linter.
- id: ruff
args: [--config=pyproject.toml, --exit-non-zero-on-fix]
# Mypy static type checker
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.1
hooks:
- id: mypy
# Local hooks only
- repo: local
hooks:
# Run unit tests using pytest. May not be a desirable thing to include
# in pre-commit, but the option is there.
- id: pytest
name: pytest
language: python
additional_dependencies: [pytest, pytest-cov, fastapi, httpx] # coverage
entry: pytest -sv --cov=boilerplate
require_serial: true
pass_filenames: false
files: \.py$