forked from NVDARemote/remote-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
99 lines (91 loc) · 3.7 KB
/
.pre-commit-config.yaml
File metadata and controls
99 lines (91 loc) · 3.7 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
# Copyright 2025 NV Access Limited
#
# This file is part of NVDA Remote Access Relay Server.
#
# NVDA Remote Access Relay Server is free software: you can redistribute it and/or modify it under the terms
# of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# NVDA Remote Access Relay Server is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along with NVDA Remote Access Relay
# Server. If not, see <https://www.gnu.org/licenses/>.
# Pre-commit configuration
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# Configuration for Continuous Integration service
# https://pre-commit.ci/
ci:
skip: [pyright]
autoupdate_schedule: monthly
autoupdate_commit_msg: "Pre-commit auto-update"
autofix_commit_msg: "Pre-commit auto-fix"
submodules: true
default_language_version:
python: python3.13
repos:
- repo: meta
hooks:
# ensures that exclude directives apply to any file in the repository.
- id: check-useless-excludes
# ensures that the configured hooks apply to at least one file in the repository.
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevents commits to certain branches
- id: no-commit-to-branch
args: ["--branch", "main"]
# Checks that large files have not been added. Default cut-off for "large" files is 500kb.
- id: check-added-large-files
# Checks python syntax
- id: check-ast
# Check that docstrings come before code
- id: check-docstring-first
# Checks for filenames that will conflict on case insensitive filesystems (the majority of Windows filesystems, most of the time)
- id: check-case-conflict
# Checks for artifacts from resolving merge conflicts.
- id: check-merge-conflict
# Checks Python files for debug statements, such as python's breakpoint function, or those inserted by some IDEs.
- id: debug-statements
# Removes trailing whitespace.
- id: trailing-whitespace
types_or: [python, markdown, toml, yaml]
# Ensures all files end in 1 (and only 1) newline.
- id: end-of-file-fixer
types_or: [python, markdown, toml, yaml]
# Removes the UTF-8 BOM from files that have it.
# See https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/codingStandards.md#encoding
- id: fix-byte-order-marker
types_or: [python, markdown, toml, yaml]
# Validates TOML files.
- id: check-toml
# Validates YAML files.
- id: check-yaml
# Ensures that links to lines in files under version control point to a particular commit.
- id: check-vcs-permalinks
# Avoids using reserved Windows filenames.
- id: check-illegal-windows-names
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.2.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 pyproject.
rev: v0.11.12
hooks:
- id: ruff-check
name: lint with ruff
args: [ --fix ]
- id: ruff-format
name: format with ruff
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.401
hooks:
- id: pyright
name: Check types with pyright