-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
129 lines (113 loc) · 3.63 KB
/
.pre-commit-config.yaml
File metadata and controls
129 lines (113 loc) · 3.63 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
repos:
- repo: https://github.com/arkinmodi/add-license-header
rev: 36c225c4bed76d7612040d3d3be9dd70357ac55a # frozen: v2.4.1
hooks:
- id: add-license-header
name: Update Python File Headers
args:
- --unmanaged
- --single-year-if-same
- --year-delimiter=-
- --author-name
- Andreas Griffin
- --license-file
- tools/license_header.txt
types: [python]
files: '\.py$'
- repo: local
hooks:
- id: ensure-desktop-newline
name: Ensure desktop files end with newline
entry: python tools/ensure_desktop_newline.py
language: system
files: ^tools/resources/linux-bitcoin-safe\.desktop$
# - repo: https://github.com/asmeurer/removestar
# rev: "1.5.2"
# hooks:
# - id: removestar
# args: [-i] # See docs for all args (-i edits file in-place)
# exclude: ^(bitcoin_safe/stubs)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.8
hooks:
# Lint + auto-fix (includes import sorting, unused imports, etc.)
- id: ruff-format
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
# If you don't want to run on notebooks, uncomment:
# types_or: [python, pyi]
# Formatter (Black-compatible)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1 # Use the latest MyPy version
hooks:
- id: mypy
files: ^bitcoin_safe/|^tools/
args:
- --check-untyped-defs
# - --disallow-untyped-defs
# - --disallow-untyped-calls
# - --disallow-incomplete-defs
# - --strict-optional
- --implicit-optional
- --strict-equality
# - --warn-return-any
- --warn-redundant-casts
- --warn-unreachable
# - --disallow-any-generics
# - --strict
- --install-types
- --non-interactive
- --ignore-missing-imports
- --show-error-codes
additional_dependencies:
- types-requests
- types-PyYAML
- types-toml
- pytest-mypy
- types-Pillow
- types-reportlab
- pyqt6
- repo: local
hooks:
- id: pyright
name: Pyright Type Check (npm install -g pyright)
entry: bash -c 'if command -v pyright >/dev/null; then pyright; else echo "pyright not installed, skipping..."; exit 0; fi'
language: system
types: [python]
pass_filenames: false
- repo: local
hooks:
- id: update-poetry-version
name: Update Poetry Version
entry: python .update_version.py
language: python
always_run: true
files: pyproject.toml
additional_dependencies:
- tomlkit
- id: optional-precommit-checks
name: Optional Precommit Checks
entry: python .optional_precommit_checks.py
language: python
always_run: true
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.6 # Use the latest version
# hooks:
# - id: bandit
# args: ['--exclude', 'tests', '-f', 'json', '-o', 'report-bandit.json']
# - repo: https://github.com/pylint-dev/pylint
# rev: v3.0.3 # Use the latest version
# hooks:
# - id: pylint
# - repo: local
# hooks:
# - id: pytest
# name: pytest
# entry: pytest
# language: system
# types: [python]
# - repo: https://github.com/myint/docformatter
# rev: v1.7.5 # Use the latest version
# hooks:
# - id: docformatter
# args: [--in-place]