-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
107 lines (101 loc) · 2.72 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
95
96
97
98
99
100
101
102
103
104
105
106
107
repos:
# General checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- name: Prevent committing to main
id: no-commit-to-branch
args: [--branch, main]
- name: Make sure files end with a newline character
id: end-of-file-fixer
- name: Remove trailing whitespace
id: trailing-whitespace
- name: Check for files that would conflict on case-insensitive filesystem
id: check-case-conflict
- name: Check for merge conflicts
id: check-merge-conflict
- name: Check executable files have a shebang
id: check-executables-have-shebangs
- name: Check scripts with a shebang are executable
id: check-shebang-scripts-are-executable
- name: Don't allow adding large files
id: check-added-large-files
# Python
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- name: Validate Python
id: check-ast
- repo: local
hooks:
- name: Format Python files
id: ruff-format
language: system
entry: ruff format
types: [python]
- repo: local
hooks:
- name: Lint Python files
id: ruff
language: system
entry: ruff check --fix
types: [python]
- repo: local
hooks:
- name: Type-check Python files
id: mypy
language: system
entry: mypy
types: [python]
# SCSS
- repo: local
hooks:
- name: Format SCSS files
id: prettier
language: system
entry: prettier --write
types: [scss]
# YAML
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- name: Validate YAML
id: check-yaml
- repo: local
hooks:
- name: Format YAML files
id: prettier
language: system
entry: prettier --write
types: [yaml]
# TOML
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- name: Validate TOML
id: check-toml
- repo: local
hooks:
- name: Format TOML files
id: taplo
language: system
entry: taplo format
types: [toml]
# GitHub Actions
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
hooks:
- name: Validate GitHub Actions workflow files
id: check-github-workflows
# Pre-commit
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
hooks:
- name: Validate Pre-commit config
id: check-jsonschema
files: ^.*\.pre-commit-config.yaml$
args:
[
"--schemafile",
"https://json.schemastore.org/pre-commit-config.json",
]