1- # File from https://github.com/nvaccess/nvda
1+ # Copied from https://github.com/nvaccess/nvda
22# https://pre-commit.ci/
33# Configuration for Continuous Integration service
44ci :
5- # Can't run Windows scons scripts on Linux.
6- # unit testing requires our python environment,
7- # which cannot be configured with pre-commit.ci:
8- # https://stackoverflow.com/questions/70778806/pre-commit-not-using-virtual-environment .
9- # Can't run licenseCheck as it relies on telemetry,
10- # which CI blocks.
115 # Pyright does not seem to work in pre-commit CI
12- skip : [checkPo, scons-source, checkPot, unitTest, licenseCheck, pyright]
6+ skip : [pyright]
137 autoupdate_schedule : monthly
148 autoupdate_commit_msg : " Pre-commit auto-update"
159 autofix_commit_msg : " Pre-commit auto-fix"
@@ -36,13 +30,9 @@ repos:
3630 hooks :
3731 # Prevents commits to certain branches
3832 - id : no-commit-to-branch
39- args : ["--branch", "master ", "--branch", "beta ", "--branch", "rc" ]
33+ args : ["--branch", "main ", "--branch", "master ", ]
4034 # Checks that large files have not been added. Default cut-off for "large" files is 500kb.
4135 - id : check-added-large-files
42- # POFiles and TTF fonts can't be made smaller
43- exclude_types : ["pofile", "ttf"]
44- # Same applies for NVDA dictionary (.dic) files and Spline Font Database (.SFD) files, but these aren't recognised by the Identify library.
45- exclude : " \\ .(dic|sfd)$"
4636 # Checks python syntax
4737 - id : check-ast
4838 # Checks for filenames that will conflict on case insensitive filesystems (the majority of Windows filesystems, most of the time)
@@ -65,31 +55,10 @@ repos:
6555 - id : check-toml
6656 # Validates YAML files.
6757 - id : check-yaml
68- # Validates XML files.
69- - id : check-xml
7058 # Ensures that links to lines in files under version control point to a particular commit.
7159 - id : check-vcs-permalinks
7260 # Avoids using reserved Windows filenames.
7361 - id : check-illegal-windows-names
74- # Checks that tests are named test_*.py.
75- - id : name-tests-test
76- args : ["--unittest"]
77- # Exclude Python files under `tests/` that aren't unittest files.
78- # This is a Python verbose regular expression.
79- # See https://docs.python.org/3/library/re.html#re.VERBOSE
80- exclude : |
81- (?x)^tests/(
82- checkPot.py | # Doesn't use unittest
83- system | # Uses robot
84- unit/ (
85- # Test helpers
86- textProvider.py |
87- extensionPointTestHelpers.py |
88- objectProvider.py |
89- test_speechManager/speechManagerTestHarness.py
90- )
91- )
92-
9362- repo : https://github.com/asottile/add-trailing-comma
9463 rev : v3.2.0
9564 hooks :
@@ -108,57 +77,11 @@ repos:
10877 - id : ruff-format
10978 name : format with ruff
11079
111- - repo : https://github.com/RobertCraigie/pyright-python
112- rev : v1.1.406
113- hooks :
114- - id : pyright
115- name : Check types with pyright
116- additional_dependencies : [ "pyright[nodejs]==1.1.406" ]
117-
118- - repo : https://github.com/astral-sh/uv-pre-commit
119- rev : 0.8.4
120- hooks :
121- - id : uv-lock
122- name : Verify uv lock file
123- # Override python interpreter from .python-versions as that is too strict for pre-commit.ci
124- args : ["-p3.13"]
125-
126- - repo : https://github.com/DavidAnson/markdownlint-cli2
127- rev : v0.18.1
128- hooks :
129- - id : markdownlint-cli2
130- name : Lint markdown files
131- args : ["--fix"]
132-
13380- repo : local
13481 hooks :
135- - id : checkPo
136- name : Check po files
137- entry : uv run source/l10nUtil.py checkPo
138- language : python
139- types : [pofile]
140- - id : scons-source
141- name : build c/c++ files
142- entry : cmd.exe /c "scons source --all-cores"
143- language : system
144- pass_filenames : false
145- types_or : [c, c++]
146- - id : checkPot
147- name : translation string check
148- entry : cmd.exe /c "scons checkPot --all-cores"
82+
83+ - id : pyright
84+ name : type check with pyright
85+ entry : uv run pyright
14986 language : system
150- pass_filenames : false
15187 types : [python]
152- files : ^source/.*$
153- - id : unitTest
154- name : unit tests
155- entry : ./rununittests.bat
156- language : script
157- pass_filenames : false
158- types_or : [python, c, c++, batch]
159- - id : licenseCheck
160- name : Check license compatibility of pip dependencies
161- files : ^(runlicensecheck\.bat|pyproject\.toml)$
162- entry : ./runlicensecheck.bat
163- language : script
164- pass_filenames : false
0 commit comments