-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (56 loc) · 1.66 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (56 loc) · 1.66 KB
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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-symlinks
- id: destroyed-symlinks
- id: trailing-whitespace
exclude: '\.expected(?:$|_[^/]+$)'
- id: end-of-file-fixer
exclude: '\.expected$'
- id: check-yaml
- id: check-toml
- id: check-ast
- id: check-added-large-files
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: requirements-txt-fixer
- id: detect-private-key
- id: debug-statements
exclude: 'test/test_breakpoint\.py$'
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.12
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: check-main-in-examples
name: ensure all example scripts have main()
entry: python scripts/lint_examples_main.py
language: system
files: ^examples/.*\.py$
- id: check-no-hardcoded-device
name: disallow hard-coded device kwarg outside of DEVICE
entry: python scripts/lint_no_hardcoded_device.py
language: system
files: ^(?:examples|test)/.*\.py$
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/facebook/pyrefly-pre-commit
rev: 0.63.1
hooks:
- id: pyrefly-check
name: Pyrefly (type checking)
pass_filenames: false
language: system
entry: scripts/pyrefly_check.sh