Skip to content

Commit

Permalink
Codify linting toolchain in a toolchain file
Browse files Browse the repository at this point in the history
Moves the nightly toolchain we use for linting out of a GitHub action
and into a dedicated `rust-toolchain.lint.toml` file.

rustup doesn't currently support specifying a toolchain file, though
[it will soon](rust-lang/rustup#2686), so we
hack around it by moving the toolchain file back and forth as part of
the GitHub action for Rust.
  • Loading branch information
Twey committed Nov 16, 2023
1 parent 4ba192d commit ad2eec3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ jobs:
run: >
find linera-* -name '*.rs' -a -not -wholename '*/target/*' -print0
| xargs -0 -L1 ./scripts/target/release/check_copyright_header
- name: Put lint toolchain file in place
run: |
ln -sf rust-toolchain.lint.toml rust-toolchain.toml
- uses: Twey/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-10-22
target: wasm32-unknown-unknown
components: clippy rustfmt
working-directory: toolchains/lint
- name: Install cargo-machete
run: |
cargo install cargo-machete --locked
Expand Down
5 changes: 0 additions & 5 deletions rust-toolchain.toml

This file was deleted.

1 change: 1 addition & 0 deletions rust-toolchain.toml
5 changes: 5 additions & 0 deletions toolchains/build/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
channel = "1.73.0"
components = [ "clippy", "rustfmt", "rust-src" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
4 changes: 4 additions & 0 deletions toolchains/lint/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly-2023-10-23"
components = [ "clippy", "rustfmt" ]
profile = "minimal"

0 comments on commit ad2eec3

Please sign in to comment.