-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (100 loc) · 3.72 KB
/
.pre-commit-config.yaml
File metadata and controls
103 lines (100 loc) · 3.72 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
100
101
102
103
# Copyright (c) 2025, Steve Morin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# .pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies: ["types-requests", "types-PyYAML", "types-python-dateutil", "click>=8.1.3", # Add click
"types-click>=1.1.0"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: '^py_launch_blueprint/_version\.py$'
- id: trailing-whitespace
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.11
hooks:
- id: ruff
entry: ruff check --force-exclude --no-cache
args: [--fix]
language: python
types_or: [cython, pyi, python]
- id: ruff-format
entry: ruff format --force-exclude --no-cache
language: python
types_or: [cython, pyi, python]
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
name: "Format YAML files"
files: \.ya?ml$
args: ["-conf", ".yamlfmt"]
- repo: local
hooks:
- id: taplo-format
name: Format TOML files
entry: taplo format
language: system
files: "\\.toml$"
args: ["--config", ".taplo.toml"]
- repo: local
hooks:
- id: pytest
name: Run pytest
entry: pytest
language: system
types: [python]
pass_filenames: false # Run full test suite
stages: [pre-commit] # Only run on pre-commit
# Global Exclusion
# If you want to exclude py_launch_blueprint/_version.py from all pre-commit hooks,
# you can use a global exclusion at the top level of your configuration:
# text
# exclude: '^py_launch_blueprint/_version\.py$' # This is the global exclusion
# repos:
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.4.0
# hooks:
# - id: end-of-file-fixer
# Hook-Level Exclusion (Recommended Approach)
# For your specific case where the end-of-file-fixer hook is modifying
# py_launch_blue/print_version.py, the most targeted solution is to add an exclusion
# at the hook level. This approach allows you to exclude the file from only the
# problematic hook while maintaining checks for other hooks that might be beneficial.
# repos:
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.4.0
# hooks:
# - id: end-of-file-fixer
# exclude: '^py_launch_blueprint/_version\.py$'
#
# Example of multiple files excluded from a single hook
# - id: end-of-file-fixer
# exclude: '^(py_launch_blueprint/_version\.py|other/file\.py)$'
#
# Example of Excluding Entire Directories
# - id: end-of-file-fixer
# exclude: '^py_launch_blueprint/'