forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
73 lines (67 loc) · 2.16 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
exclude: ^user_docs/(?!en/).*$
# https://pre-commit.ci/
# Configuration for Continuous Integration service
ci:
# Can't run Windows scripts on Linux
# These also do not apply fixes, only run tests
skip: [scons-source, checkPot, unitTest, licenseCheck]
submodules: true
autoupdate_commit_msg: "Pre-commit auto-update"
autofix_commit_msg: "Pre-commit auto-fix"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Checks python syntax
- id: check-ast
# File uses encoding not supported in Linux
exclude: source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
types_or: [python, c, c++, batch, markdown]
- id: end-of-file-fixer
types_or: [python, c, c++, batch, markdown]
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
# Ruff preserves indent/new-line formatting of function arguments, list items, and similar iterables,
# if a trailing comma is added.
# This adds a trailing comma to args/iterable items in case it was missed.
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit
# Matches Ruff version in requirements.
rev: v0.5.5
hooks:
- id: ruff
name: lint with ruff
args: [ --fix ]
- id: ruff-format
name: format with ruff
- repo: local
hooks:
- id: scons-source
name: build c/c++ files
entry: cmd.exe /c "scons source --all-cores"
language: system
pass_filenames: false
types_or: [c, c++]
- id: checkPot
name: translation string check
entry: cmd.exe /c "scons checkPot --all-cores"
language: system
pass_filenames: false
types: [python]
files: ^source/.*$
- id: unitTest
name: unit tests
entry: ./rununittests.bat
language: script
pass_filenames: false
types_or: [python, c, c++, batch]
- id: licenseCheck
name: Check license compatibility of pip dependencies
files: ^(requirements\.txt|runlicensecheck\.bat)$
entry: ./runlicensecheck.bat
language: script
pass_filenames: false