Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
1165 lines (1074 loc) · 41.7 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
1165 lines (1074 loc) · 41.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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SKIP=pytest-unit,mypy,basedpyright uv run prek run -a
# prek run -a prettier typos committed detect-secrets add-trailing-comma uv-export uv-lock uv-sync pyupgrade markdownlint-cli2 ruff-format pytest-unit pytest-gherkin-unit pytest-quality-metrics pytest-coverage pytest-mutation pytest-sdk-python ty-check trailing-whitespace check-yaml check-json check-toml end-of-file-fixer detect-private-key check-case-conflict check-builtin-literals check-merge-conflict check-docstring-first debug-statements name-tests-test codespell check-filenames
fail_fast: false
default_language_version:
python: "3.13"
# Generated SBOM artifacts (scripts/deps/export-rust-sbom.sh):
# sdk/rust/cyt-indexer/cyt-indexer.cdx.json
# sdk/rust/cyt-indexer/cyt-indexer.snyk.json
# Exclude pattern (auto-fix / spell / secret scanners / verify-pins trigger):
# ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
# Only export-rust-sbom may rewrite these files (on Cargo.toml/Cargo.lock changes).
repos:
# 1year old
# - repo: https://github.com/backplane/pre-commit-rust-hooks
# rev: v1.2.1
# hooks:
# - id: fmt
# - id: check
# - id: clippy
# - id: test
# - repo: https://github.com/EmbarkStudios/cargo-deny
# rev: 0.19.8
# hooks:
# - id: cargo-deny
# args: ["--all-features", "check"]
# - repo: https://github.com/drahnr/cargo-spellcheck
# rev: v0.15.7
# hooks:
# - id: cargo-spellcheck
- repo: https://github.com/DevinR528/cargo-sort
rev: v2.1.4
hooks:
- id: cargo-sort
# 1year old
# - repo: https://github.com/rockmagma02/rust-pre-commit-hooks
# rev: v0.2.0
# hooks:
# - id: rustfmt
# - id: cargo-fmt
# - id: clippy
# 4years old — use local nopatch wrappers so [patch.crates-io] does not touch Cargo.lock
# - repo: https://github.com/cathiele/pre-commit-rust
# rev: v0.1.0
# hooks:
# - id: cargo-audit
# - id: cargo-udeps
# - id: cargo-check
# - id: cargo-test
# 1year old
- repo: local
hooks:
- id: shellcheck
name: ShellCheck v0.11.0
entry: bash scripts/pre-commit-hooks/shellcheck-precommit.sh
language: system
types: [shell]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.13.1-1
hooks:
- id: shfmt
- repo: local
hooks:
- id: psscriptanalyzer-check
name: check PowerShell code using PSScriptAnalyzer
language: system
entry: bash scripts/pre-commit-hooks/psscriptanalyzer-docker.sh
files: \.ps[dm]?1$
args:
- -Check
- -ExcludeRule
- PSAvoidUsingWriteHost
- -Fix
- id: psscriptanalyzer-format
name: format PowerShell code using PSScriptAnalyzer
language: system
entry: bash scripts/pre-commit-hooks/psscriptanalyzer-docker.sh
files: \.ps[dm]?1$
args:
- -Format
# Legacy ophiosdev hook (null Path crash with --all-files); kept for reference.
# - repo: https://github.com/ophiosdev/pre-commit-psscriptanalyzer.git
# rev: v2.0.0
# hooks:
# - id: psscriptanalyzer-check
# - id: psscriptanalyzer-format
# export PSSA_DOCKER_IMAGE=mcr.microsoft.com/powershell:7.5-debian-12
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml, json5, bash, javascript, ts, tsx]
exclude: ^(\.github/workflows/.*\.ya?ml$|sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json)$
- id: prettier
name: prettier github workflow yaml
files: ^\.github/workflows/.*\.ya?ml$
types_or: [yaml]
- repo: https://github.com/crate-ci/typos
rev: v1.47.0
hooks:
- id: typos
args: ["--force-exclude", "--locale", "en"]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell # See pyproject.toml for args
additional_dependencies:
- tomli
- repo: https://github.com/crate-ci/committed
rev: v1.1.11
hooks:
- id: committed
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args:
[
"--baseline",
".secrets.baseline",
"--exclude-files",
"app/migrations/versions/.*|ast-grep/rule-tests/.*|app/tests/test_bm25_migration.py|.env.example|.ast-grep/.*|.talismanrc|sdk/rust/cyt-indexer/cyt-indexer\\.cdx\\.json|sdk/rust/cyt-indexer/cyt-indexer\\.snyk\\.json",
]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- repo: https://github.com/trufflesecurity/trufflehog
rev: v3.92.3
hooks:
- id: trufflehog
args: ["--only-verified", "--trust-local-git-config"]
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- repo: https://github.com/thoughtworks/talisman
rev: v1.37.0
hooks:
- id: talisman-commit
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.10
hooks:
- id: actionlint
files: ^\.github/workflows/.*\.ya?ml$
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.0
hooks:
- id: check-github-workflows
files: ^\.github/workflows/
- id: check-jsonschema
name: check pre-commit config
files: ^\.pre-commit-config\.yaml$
args:
- --schemafile
- https://json.schemastore.org/pre-commit-config.json
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- repo: https://github.com/oxipng/oxipng
rev: v9.1.5
hooks:
- id: oxipng
files: ^assets/.*\.png$
- repo: local
hooks:
- id: clang-format
name: clang-format (sdk/c)
entry: bash scripts/pre-commit-hooks/c-sdk-precommit.sh clang-format
language: system
files: ^sdk/c/.*\.(c|h)$
exclude: ^sdk/c/include/cyt_indexer\.h$
args: ["-i", "--style=file"]
- id: cppcheck
name: cppcheck (sdk/c)
entry: bash scripts/pre-commit-hooks/c-sdk-precommit.sh cppcheck
language: system
files: ^sdk/c/.*\.(c|h)$
exclude: ^sdk/c/include/cyt_indexer\.h$
args: ["--suppress=missingIncludeSystem", "--error-exitcode=1"]
- id: clang-tidy
name: clang-tidy (sdk/c)
entry: bash scripts/pre-commit-hooks/c-sdk-precommit.sh clang-tidy
language: system
files: ^sdk/c/.*\.(c|h)$
exclude: ^sdk/c/include/cyt_indexer\.h$
args:
- "-p=sdk/c/build"
- "--warnings-as-errors=*"
- id: cpplint
name: cpplint (sdk/c examples)
entry: bash scripts/pre-commit-hooks/c-sdk-precommit.sh cpplint
language: system
files: ^sdk/c/examples/.*\.c$
args: ["--filter=-legal/copyright"]
- id: go-fumpt
name: go-fumpt (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh fumpt
language: system
files: ^sdk/go/.*\.go$
- id: go-imports
name: go-imports (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh imports
language: system
files: ^sdk/go/.*\.go$
- id: go-mod-tidy-repo
name: go-mod-tidy (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh tidy
language: system
files: ^sdk/go/
pass_filenames: false
- id: go-staticcheck-repo-mod
name: go-staticcheck (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh staticcheck
language: system
files: ^sdk/go/
pass_filenames: false
- id: go-critic
name: go-critic (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh critic
language: system
files: ^sdk/go/.*\.go$
- id: go-sec-repo-mod
name: go-sec (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh sec
language: system
files: ^sdk/go/
pass_filenames: false
- id: go-build-repo-mod
name: go-build (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh build
language: system
files: ^sdk/go/
pass_filenames: false
- id: go-test-repo-mod
name: go-test (sdk/go)
entry: bash scripts/pre-commit-hooks/go-sdk-precommit.sh test
language: system
files: ^sdk/go/
pass_filenames: false
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
args: ["--max-line-length", "140", "--extend-ignore=E203"]
exclude: ^test_data/|bumpity.py$
- repo: local
hooks:
- id: heal-cargo-lock
name: heal Cargo.lock chunk registry pins
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/heal-cargo-lock.sh',
]
language: system
files: ^Cargo\.(toml|lock)$
pass_filenames: false
- id: sync-version
name: sync-version
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args: ["rtk bash scripts/publish/sync-version.sh"]
language: system
verbose: true
pass_filenames: false
- repo: local
hooks:
- id: export-requirements
name: export-requirements
entry: bash scripts/deps/export-requirements.sh
language: system
files: ^(pyproject\.toml|uv\.lock)$
pass_filenames: false
- repo: local
hooks:
- id: export-rust-sbom
name: export-rust-sbom
entry: bash scripts/deps/export-rust-sbom-precommit.sh
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/)
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
pass_filenames: false
- repo: local
hooks:
- id: verify-pins
name: verify-pins
entry: bash scripts/deps/verify-pins.sh
args: ["--short", "--no-report"]
language: system
pass_filenames: false
files: ^(pyproject\.toml|uv\.lock|requirements\.txt|dev-requirements\.txt|fossa-deps\.yml|Cargo\.toml|Cargo\.lock|sdk/c/CMakeLists\.txt|sdk/go/go\.(mod|sum)|sdk/typescript/package(-lock)?\.json|package(-lock)?\.json|scripts/pre-commit-hooks/go-sdk-tools\.sh)$
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.17
hooks:
- id: uv-lock
args: ["--project", "."]
files: pyproject.toml
- id: uv-sync
args: ["--project", ".", "--locked", "--all-packages"]
files: pyproject.toml
additional_dependencies: []
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py313-plus]
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.22.1
hooks:
- id: markdownlint-cli2
language_version: lts
args: [--fix]
exclude: ^(CLAUDE|AGENTS|GEMINI|MCPC_RESEARCH)\.md$|^backlog/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.15
hooks:
# Run the Ruff formatter.
- id: ruff-format
name: "ruff-format"
args: [--config=pyproject.toml]
files: '^src/.*\.(py|ipynb)$'
# Run the Ruff linter.
- id: ruff
name: "ruff"
args:
[
--exit-non-zero-on-fix,
--fix,
--config=pyproject.toml,
--output-format,
concise,
]
files: '^src/.*\.(py|ipynb)$'
# Should be after ruff!
- repo: https://github.com/asottile/add-trailing-comma
rev: v4.0.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: trailing-whitespace
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- id: check-yaml
exclude: ^(.ast-grep/rules/.*|\.github/workflows/.*)$
- id: check-yaml
name: check github workflow yaml
files: ^\.github/workflows/.*\.ya?ml$
always_run: true
- id: check-json
- id: check-toml
- id: end-of-file-fixer
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- id: mixed-line-ending
exclude: ^sdk/rust/cyt-indexer/cyt-indexer\.(cdx|snyk)\.json$
- id: detect-private-key
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-builtin-literals
args: ["--no-allow-dict-kwargs"]
exclude: bumpity.py$
- id: check-docstring-first
- id: debug-statements
exclude: bumpity.py$
# Conflicts with ruff
# - id: double-quote-string-fixer
- id: name-tests-test
args: [--pytest-test-first]
exclude: ^(sdk/e2e/python/tests/(.*)\.py$|src/tests/support/.*\.py$|src/tests/qa/.*\.py$|scripts/local/tests/.*\.py$)
- repo: local
hooks:
- id: ty-check
name: Ty type checker
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
"source scripts/pre-commit-hooks/activate-venv.sh && rtk uv run ty check src/ --project . --output-format concise",
]
language: system
types: [python]
pass_filenames: false
exclude: |
(?x)^(
latex/
src/catalog/
.ruff_cache/
.mypy_cache/
.venv/
__pycache__/
src/__pycache__/
)
- id: check-filenames
name: Check for spaces in all filenames
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- |
rtk git ls-files \
| grep -vE '^"?(postman/|documents/|backlog/|dirs/)' \
| grep " " \
&& echo "Filenames should not contain spaces!" && exit 1 \
|| exit 0
language: system
always_run: true
pass_filenames: false
- id: mypy
name: mypy
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
"source scripts/pre-commit-hooks/activate-venv.sh && cd src && rtk mypy .",
]
pass_filenames: false
language: system
files: '^src/.*\.py$'
- id: check-cyt-client-imports
name: check-cyt-client-imports
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && uv run python scripts/pre-commit-hooks/check_cyt_client_imports.py',
]
pass_filenames: false
language: system
files: ^(src/cyt_client/.*\.py|scripts/pre-commit-hooks/check_cyt_client_imports\.py)$
- id: check-cyt-mcp-imports
name: check-cyt-mcp-imports
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && uv run python scripts/pre-commit-hooks/check_cyt_mcp_imports.py',
]
pass_filenames: false
language: system
files: ^(src/cyt_mcp/.*\.py|scripts/pre-commit-hooks/check_cyt_mcp_imports\.py)$
- id: check-agent-imports
name: check-agent-imports
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && uv run python scripts/pre-commit-hooks/check_agent_imports.py',
]
pass_filenames: false
language: system
files: ^(src/cyt/agents/.*\.py|src/cyt/skills/.*\.py|src/cyt/proxy/reverse\.py|scripts/pre-commit-hooks/check_agent_imports\.py)$
- id: maturin-develop
name: maturin develop (cyt-indexer _native)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/maturin-develop.sh',
]
language: system
files: ^(sdk/(rust/cyt-indexer/|python/)|Cargo\.(toml|lock))
pass_filenames: false
- id: pytest-unit
name: pytest (unit)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-0
name: pytest (unit shard 0)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 0 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-1
name: pytest (unit shard 1)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 1 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-2
name: pytest (unit shard 2)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 2 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-3
name: pytest (unit shard 3)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 3 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-4
name: pytest (unit shard 4)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 4 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-5
name: pytest (unit shard 5)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 5 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-6
name: pytest (unit shard 6)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 6 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-unit-shard-7
name: pytest (unit shard 7)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh unit-shard 7 "${PREK_PYTEST_UNIT_SHARDS:-4}"',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/.*)$
- id: pytest-gherkin-unit
name: pytest (gherkin unit)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh gherkin-unit',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/unit/gherkin/.*)$
- id: pytest-quality-metrics
name: pytest (quality_metrics)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh quality_metrics',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/quality_metrics/.*)$
- id: pytest-coverage
name: pytest (coverage)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh coverage',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/coverage/.*|sdk/e2e/fixtures/bm25_catalog\.json)$
- id: pytest-mutation
name: pytest (mutation)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh mutation',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/mutation/.*)$
- id: pytest-qa
name: pytest (qa)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-category.sh qa',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/qa/.*|sdk/e2e/fixtures/bm25_catalog\.json)$
- id: pytest-runtime
name: pytest (runtime)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && CYT_RUN_RUNTIME_TESTS=1 rtk bash scripts/local/tests/pytest-category.sh runtime',
]
pass_filenames: false
language: system
files: ^(src/.*\.py|src/tests/runtime/.*)$
- id: pytest-sdk-python
name: pytest (sdk/python unit)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/pytest-sdk-python.sh',
]
pass_filenames: false
language: system
files: ^(sdk/python/|sdk/rust/cyt-indexer/)
- repo: https://github.com/DetachHead/basedpyright-pre-commit-mirror
rev: 1.39.6
hooks:
- id: basedpyright
name: basedpyright
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
"source scripts/pre-commit-hooks/activate-venv.sh && rtk basedpyright src sdk/python/src",
]
language: system
pass_filenames: false
files: '^(src/.*\.py|sdk/python/.*\.py)$'
- repo: local
hooks:
- id: ast-test
name: ast-grep rule tests
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args: ["rtk ast-grep test --skip-snapshot-tests"]
language: system
files: ^\.ast-grep/
pass_filenames: false
- id: uv-build
name: Python package build
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args: ['cd "$(git rev-parse --show-toplevel)" && rtk uv build']
language: system
files: ^(pyproject\.toml|src/)
pass_filenames: false
- id: verify-sdk
name: Verify cyt-indexer-sdk native import
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk uv run python -c "from cyt_indexer._native import build_catalog_index; assert callable(build_catalog_index)"',
]
language: system
files: ^(sdk/(rust|python)/|pyproject\.toml)
pass_filenames: false
- id: verify-app-python
name: Verify app re-exports local cyt-indexer-sdk
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/workflow.sh app-verify',
]
language: system
files: ^(src/|pyproject\.toml)$
pass_filenames: false
- id: cargo-clippy-cyt-indexer-core
name: cargo clippy (cyt-indexer core)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-clippy-cyt-indexer.sh core',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/|sdk/c/|sdk/go/)
pass_filenames: false
- id: cargo-clippy-cyt-indexer-cli
name: cargo clippy (cyt-indexer cli)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-clippy-cyt-indexer.sh cli',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/|sdk/c/|sdk/go/)
pass_filenames: false
- id: cargo-clippy-cyt-indexer
name: cargo clippy (cyt-indexer all)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-clippy-cyt-indexer.sh all',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/|sdk/c/|sdk/go/)
pass_filenames: false
- id: cargo-deny
name: cargo deny (nopatch workspace)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-deny.sh',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/|deny\.toml)
pass_filenames: false
- id: cargo-fmt
name: cargo fmt (cyt-indexer)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk cargo fmt --all -- --check',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/|rustfmt\.toml$)
pass_filenames: false
- id: cargo-audit
name: cargo audit (nopatch workspace)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-locked.sh audit',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/)
pass_filenames: false
- id: cargo-udeps
name: cargo udeps (nopatch workspace)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/dev/cargo-udeps.sh',
]
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/)
pass_filenames: false
- id: cbindgen-header-drift
name: cbindgen header drift check
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- |
set -euo pipefail
root="$(git rev-parse --show-toplevel)"
cd "$root"
rtk bash scripts/local/dev/cargo-locked.sh build -p cyt-indexer --no-default-features --features ffi --locked
git diff --exit-code sdk/rust/cyt-indexer/cyt_indexer.h
language: system
files: ^sdk/rust/cyt-indexer/(src/ffi/|cbindgen\.toml|build\.rs)
pass_filenames: false
- id: c-header-sync
name: sdk/c header sync check
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- cmp sdk/rust/cyt-indexer/cyt_indexer.h sdk/c/include/cyt_indexer.h
language: system
files: ^sdk/(rust/cyt-indexer/cyt_indexer\.h|c/include/cyt_indexer\.h)
pass_filenames: false
- id: cargo-test-unit
name: cargo test (unit)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh unit
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-warm-build
name: cargo warm build (cyt-indexer tests)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-warm-build.sh
language: system
files: ^(Cargo\.(toml|lock)|sdk/rust/cyt-indexer/)
pass_filenames: false
- id: cargo-test-unit-shard-0
name: cargo test (unit shard 0)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 0 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-1
name: cargo test (unit shard 1)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 1 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-2
name: cargo test (unit shard 2)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 2 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-3
name: cargo test (unit shard 3)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 3 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-4
name: cargo test (unit shard 4)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 4 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-5
name: cargo test (unit shard 5)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 5 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-6
name: cargo test (unit shard 6)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 6 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-unit-shard-7
name: cargo test (unit shard 7)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- 'cd "$(git rev-parse --show-toplevel)" && rtk bash scripts/local/tests/cargo-test-category.sh unit-shard 7 "${PREK_RUST_UNIT_SHARDS:-4}"'
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/unit/)
pass_filenames: false
- id: cargo-test-integration
name: cargo test (integration)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh integration
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/integration/)
pass_filenames: false
- id: cargo-test-cucumber
name: cargo test (cucumber)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh cucumber
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/integration/features/|tests/integration/cucumber/)
pass_filenames: false
- id: cargo-test-ffi
name: cargo test (ffi)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh ffi
language: system
files: ^sdk/rust/cyt-indexer/(src/ffi/|tests/ffi/|cyt_indexer\.h)
pass_filenames: false
- id: cargo-test-coverage
name: cargo test (coverage)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh coverage
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/coverage/)|sdk/e2e/fixtures/(cohesion_sample\.md|cohesion_config\.json|bm25_catalog\.json)
pass_filenames: false
- id: cargo-test-mutation
name: cargo test (mutation)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh mutation
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/mutation/)
pass_filenames: false
- id: cargo-test-quality-metrics
name: cargo test (quality_metrics)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh quality_metrics
language: system
files: ^(sdk/rust/cyt-indexer/(src/|tests/quality_metrics/)|sdk/(python/pyproject\.toml|typescript/package\.json|rust/cyt-indexer/Cargo\.toml))
pass_filenames: false
- id: cargo-test-qa
name: cargo test (qa)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- rtk bash scripts/local/tests/cargo-test-category.sh qa
language: system
files: ^sdk/rust/cyt-indexer/(src/|tests/qa/)|sdk/e2e/fixtures/bm25_catalog\.json
pass_filenames: false
- id: cmake-compile-db
name: Generate sdk/c compile_commands.json
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
- bash scripts/pre-commit-hooks/cmake-compile-db.sh
language: system
files: ^sdk/c/
pass_filenames: false
- id: build-c-lib-for-go
name: build C lib for Go CGO
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args: ["bash sdk/c/scripts/build-c-lib.sh --no-sync-header"]
language: system
files: ^(sdk/(go/|rust/cyt-indexer/src/ffi/)|sdk/c/include/)
pass_filenames: false
- id: typescript-typecheck
name: TypeScript SDK typecheck
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args:
[
"cd sdk/typescript && rtk npx tsc --noEmit && rtk npx tsc --noEmit -p ../e2e/typescript",
]
language: system
files: ^sdk/(typescript|e2e/typescript)/
pass_filenames: false
- id: typescript-test-unit
name: TypeScript SDK test (unit)
entry: bash scripts/pre-commit-hooks/prek-hook.sh
args: