forked from espressif/sync-jira-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
69 lines (59 loc) · 2.55 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
# Run `pre-commit autoupdate` to update to the latest pre-commit hooks version.
# When changing the version of tools that are also installed as development dependencies (e.g., black, mypy, ruff),
# please ensure the same versions are pinned in this file as in `pyproject.toml`.
---
minimum_pre_commit_version: 3.3.0 # Specifies the minimum version of pre-commit required for this configuration
default_install_hook_types: [pre-commit, commit-msg] # Default hook types to install if not specified in individual hooks
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace # Removes trailing whitespaces from lines
- id: end-of-file-fixer # Ensures files end with a newline
- id: check-executables-have-shebangs # Checks executables have a proper shebang
- id: mixed-line-ending # Detects mixed line endings (CRLF/LF)
args: ['-f=lf'] # Forces files to use LF line endings
- id: double-quote-string-fixer # Converts single quotes to double quotes in strings
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff # Runs ruff linter (replaces flake8)
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
hooks:
- id: reorder-python-imports # Reorders Python imports to a standard format (replaces isort)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy # Runs mypy for Python type checking
additional_dependencies: ['types-all']
- repo: https://github.com/espressif/conventional-precommit-linter
rev: v1.6.0
hooks:
- id: conventional-precommit-linter # Lints commit messages for conventional format
stages: [commit-msg]
- repo: https://github.com/psf/black
rev: '24.1.1'
hooks:
- id: black # Formats Python code using black
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.3
hooks:
- id: pylint # Runs pylint on Python code
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell # Code spell checker
args: ["--write-changes"]
additional_dependencies: [tomli]
# Local hooks
- repo: local
hooks:
- id: pip-compile
name: compile requirements.txt
entry: bash -c 'pip-compile --output-file=requirements.txt pyproject.toml > /dev/null'
language: system
pass_filenames: false
files: requirements.txt|pyproject.toml