Skip to content

Commit 7c9983a

Browse files
authored
Fix rust linting failures by tweaking mise config (#187)
* Fix rust linting failures by tweaking mise config * Always run ci:install-deps on postinstall
1 parent 9ecec85 commit 7c9983a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: Swatinem/rust-cache@v2
1818
with:
1919
cache-on-failure: true
20-
shared-key: "lint"
20+
shared-key: mise-{{hashFiles('mise.toml')}}
2121

2222
- name: Lint
2323
run: mise lint
@@ -48,7 +48,7 @@ jobs:
4848
uses: Swatinem/rust-cache@v2
4949
with:
5050
cache-on-failure: true
51-
shared-key: "codegen"
51+
shared-key: "mise-{{hashFiles('mise.toml')}}"
5252

5353
- name: Run codegen
5454
run: mise run gen

mise.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
[tools]
22
deno = "2.4.2"
33
"npm:@ast-grep/cli" = "0.39.6"
4-
rust = { version = "1.90.0", postinstall = "rustup component add rustfmt clippy rust-analyzer" }
4+
rust = { version = "1.90.0", components="rustfmt,clippy,rust-analyzer" }
55
ruff = "0.14.0"
66
uv = "0.9.2"
77

88
[settings]
99
experimental = true
1010
pin = true
1111

12+
[hooks]
13+
postinstall = "mise run ci:install-deps"
14+
1215
[tasks."ci:install-deps"]
1316
hide = true
1417
description = "Install CI dependencies (only runs on CI)"
1518
run = """
1619
{% if env.CI and os() == "linux" %}
1720
sudo apt-get update
18-
sudo apt-get install -y libwebkit2gtk-4.1-dev
21+
sudo apt-get install -y libwebkit2gtk-4.1-dev
1922
{% endif %}
2023
"""
2124

@@ -26,7 +29,6 @@ run = "deno run -A scripts/sync-versions.ts"
2629
## Gen
2730

2831
[tasks."gen:rust"]
29-
depends = ["ci:install-deps"]
3032
description = "Generate JSON schemas from the rust code"
3133
run = "cargo run --bin generate_schemas"
3234
sources = ["src/**/*.rs", "Cargo.toml", "Cargo.lock"]
@@ -120,7 +122,6 @@ depends = ["format:*"]
120122

121123
[tasks."lint:rust"]
122124
description = "Run clippy against rust code"
123-
depends = ["ci:install-deps"]
124125
run = ["rustfmt --check src/**/*.rs", "cargo clippy"]
125126

126127
[tasks."lint:deno"]

0 commit comments

Comments
 (0)