-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
69 lines (69 loc) · 1.93 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
69 lines (69 loc) · 1.93 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
default_language_version:
python: python3.11
ci:
# The ty hook shells out to uv to resolve this project's dependencies, and
# pre-commit.ci runs hooks without network access. The Type check workflow
# runs ty in GitHub Actions instead.
skip:
- ty
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v6.0.0
hooks:
- id: check-yaml
args:
- '--unsafe'
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
exclude_types:
- markdown
- id: check-case-conflict
- id: check-ast
- id: check-builtin-literals
- id: check-merge-conflict
- id: no-commit-to-branch
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: check-docstring-first
- repo: 'https://github.com/adrienverge/yamllint'
rev: v1.38.0
hooks:
- id: yamllint
args:
- '-d {extends: default, rules: {line-length: disable, document-start: disable}}'
- '-s'
- repo: 'https://github.com/astral-sh/ruff-pre-commit'
rev: v0.15.20
hooks:
- id: ruff-check
args:
- '--fix'
- id: ruff-check
alias: ruff-check-manual
stages:
- manual
- id: ruff-format
- id: ruff-format
alias: ruff-format-check
stages:
- manual
args:
- '--check'
- '--diff'
# Runs the ty pinned in pyproject.toml, the same command the Type check
# workflow runs, so the version is declared in exactly one place. The hook
# takes no file arguments: an edit in one file can move diagnostics into
# another, so ty rechecks its whole configured scope every run.
- repo: local
hooks:
- id: ty
name: ty
entry: uv run --frozen ty check
language: system
types_or:
- python
- pyi
pass_filenames: false
always_run: true
require_serial: true