-
Notifications
You must be signed in to change notification settings - Fork 754
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
154 lines (141 loc) · 4.65 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
154 lines (141 loc) · 4.65 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
default_stages: [pre-commit]
default_install_hook_types: [pre-commit, commit-msg]
exclude: (dimos/models/.*)|(deprecated)
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
files: \.py$
exclude: (__init__\.py$)|(dimos/rxpy_backpressure/)
args:
# use if you want to remove licences from all files
# (for globally changing wording or something)
#- --remove-header
- --license-filepath
- assets/license_file_header.txt
- --use-current-year
- id: insert-license
name: insert-license (rust)
files: \.rs$
types: [rust]
args:
- --license-filepath
- assets/license_file_header.txt
- --comment-style
- "//"
- --use-current-year
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.3
hooks:
- id: ruff-format
stages: [pre-commit]
- id: ruff-check
args: [--fix, --unsafe-fixes]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: trailing-whitespace
language: python
types: [text]
exclude: \.patch$ # patch files contain intentional trailing whitespace
- id: end-of-file-fixer
exclude: \.patch$ # keep patch files byte-identical to upstream diffs
- id: mixed-line-ending
args: [--fix=lf]
exclude: \.patch$ # keep patch files byte-identical to upstream diffs
- id: check-json
exclude: ^misc/DimSim/public/sims/ # LFS-tracked
- id: check-toml
- id: check-yaml
- id: pretty-format-json
name: format json
args: [ --autofix, --no-sort-keys ]
exclude: ^misc/DimSim/public/sims/ # LFS-tracked
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.4.1
hooks:
- id: editorconfig-checker
alias: ec
args: [-disable-max-line-length, -disable-indentation]
# - repo: local
# hooks:
# - id: mypy
# name: Type check
# # possible to also run within the dev image
# #entry: "./bin/dev mypy"
# entry: "./bin/mypy"
# language: python
# additional_dependencies: ["mypy==1.15.0", "numpy>=1.26.4,<2.0.0"]
# types: [python]
- repo: local
hooks:
- id: uv-lock-check
name: Check uv.lock is up-to-date
entry: uv lock --check
language: system
files: ^pyproject\.toml$
pass_filenames: false
- id: lfs_check
name: LFS data
always_run: true
pass_filenames: false
entry: bin/hooks/lfs_check
language: script
- id: largefiles-check
name: Large files check
always_run: true
pass_filenames: false
entry: python bin/hooks/largefiles_check
args: [--all]
language: python
additional_dependencies: ['tomli']
- id: doclinks
name: Doclinks
always_run: true
pass_filenames: false
entry: python -m dimos.utils.docs.doclinks docs/
language: system
files: ^docs/.*\.md$
exclude: ^docs/node_modules/
- id: filter-commit-message
name: Filter generated signatures from commit message
entry: python bin/hooks/filter_commit_message.py
language: python
stages: [commit-msg]
- id: check-commit-message
name: Check commit messages for generated signatures
always_run: true
pass_filenames: false
entry: python bin/hooks/filter_commit_message.py --check
language: python
stages: [pre-commit]
- id: cargo-fmt
name: cargo fmt
entry: |
bash -c '
set -euo pipefail
git ls-files "*Cargo.toml" | while read -r m; do
cargo locate-project --manifest-path "$m" --workspace --message-format plain
done | sort -u | while read -r root; do
cargo fmt --manifest-path "$root" --all
done
'
language: system
types: [rust]
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: |
bash -c '
set -euo pipefail
git ls-files "*Cargo.toml" | while read -r m; do
cargo locate-project --manifest-path "$m" --workspace --message-format plain
done | sort -u | while read -r root; do
cargo clippy --manifest-path "$root" --workspace --all-targets -- -D warnings
done
'
language: system
types: [rust]
pass_filenames: false