File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 with :
2828 cache : false
2929
30- # switch git branches so we don't trip the branch pre-commit check
31- - name : Switch branches
32- run : git checkout -b check-source HEAD
33-
3430 - name : ✅ Check that pre-commit is clean
3531 run : |
3632 hk check --all
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ htmlcov/
2424perf.data *
2525* .linux-perf.txt
2626* .speedscope.json
27- * .pkl
2827* .zst
2928* .gz
3029* .bz2
Original file line number Diff line number Diff line change 1+ amends "package://github.com/jdx/hk/releases/download/v1.49.0/hk@1.49.0#/Config.pkl"
2+ import "package://github.com/jdx/hk/releases/download/v1.49.0/hk@1.49.0#/Builtins.pkl"
3+
4+ local linters = new Mapping<String, Step> {
5+ ["large-files" ] = (Builtins.check_added_large_files) {
6+ exclude = Regex(#"(^uv\.lock|\.ipynb|\.csv)$"# )
7+ }
8+ ["end-of-file-fixer" ] = Builtins.newlines
9+ ["mixed-line-ending" ] = Builtins.mixed_line_ending
10+ ["trailing-whitespace" ] = Builtins.trailing_whitespace
11+ // ["check-merge-conflict"] = Builtins.check_merge_conflict
12+ ["check-toml" ] = Builtins.taplo
13+ }
14+
15+ local formatters = new Mapping<String, Step> {
16+ ["format-rust" ] = Builtins.rustfmt
17+ // ["format-toml"] = Builtins.taplo_format
18+ ["dprint" ] = (Builtins.dprint) {
19+ glob = Regex(#"(.*\.yaml$|.*\.yml$|.*\.toml$|.*\.json$)"# )
20+ }
21+ ["license-headers" ] {
22+ glob = Regex(#"(.*\.py$|.*\.rs$)"# )
23+ check = "uv run utils/update-headers.py --check-only {{ files }}"
24+ fix = "uv run utils/update-headers.py {{ files }}"
25+ }
26+ ["pkl-format" ] = Builtins.pkl_format
27+ }
28+
29+ hooks {
30+ ["pre-commit" ] {
31+ fix = true
32+ stash = "git"
33+ steps {
34+ ["commit-branch" ] = Builtins.no_commit_to_branch
35+ ...linters
36+ ...formatters
37+ }
38+ }
39+ ["check" ] {
40+ steps {
41+ ...linters
42+ ...formatters
43+ }
44+ }
45+ ["fix" ] {
46+ fix = true
47+ steps {
48+ ...linters
49+ ...formatters
50+ }
51+ }
52+ }
You can’t perform that action at this time.
0 commit comments