-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
52 lines (48 loc) · 1.5 KB
/
.pre-commit-config.yaml
File metadata and controls
52 lines (48 loc) · 1.5 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
repos:
# Ruff - Linter & Formatter (Python only)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff-check
args: [--fix]
files: ^(huawei_solar_modbus_mqtt/bridge|tests)/.*\.py$
- id: ruff-format
files: ^(huawei_solar_modbus_mqtt/bridge|tests)/.*\.py$
# MyPy - Type Checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --check-untyped-defs]
additional_dependencies: [types-paho-mqtt, types-PyYAML]
files: ^(huawei_solar_modbus_mqtt/bridge|tests)/.*\.py$
# Pre-Commit Hooks - Standard Checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: '\.md$'
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict
- id: check-toml
- id: mixed-line-ending
args: ["--fix=lf"]
# Local Hooks
- repo: local
hooks:
- id: check-version-sync
name: Check version synchronization
entry: python scripts/check_version_sync.py
language: python
pass_filenames: false
always_run: true
stages: [pre-commit]
- id: sync-version
name: Sync version from config.yaml
entry: python scripts/update_version.py
language: python
pass_filenames: false
stages: [manual]