Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ env:
# For setup-rust, see https://github.com/moonrepo/setup-rust/issues/22
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_GPU_COMMITSH: 31153a8edd3bc626d4b9fb0cd7bdb7a8b30797d3
# Nightly toolchain used for rustfmt in CI and in renderling-build's codegen.
# Bump deliberately: reformat + regenerate shaders in the same PR.
RUST_NIGHTLY_TOOLCHAIN: nightly-2026-07-31

jobs:
# Installs cargo deps and sets the cache directory for subsequent jobs
Expand Down Expand Up @@ -84,8 +87,8 @@ jobs:
${{ needs.install-cargo-gpu.outputs.cachepath-Linux }}
${{ needs.install-cargo-gpu.outputs.cachepath-Windows }}
key: rust-gpu-cache-1-${{ matrix.os }}
- run: rustup install nightly
- run: rustup component add --toolchain nightly rustfmt
- run: rustup install $RUST_NIGHTLY_TOOLCHAIN
- run: rustup component add --toolchain $RUST_NIGHTLY_TOOLCHAIN rustfmt
- run: cargo gpu show commitsh
- run: rm -rf crates/renderling/src/linkage/* crates/renderling/shaders
- run: cargo shaders
Expand All @@ -105,9 +108,9 @@ jobs:
key: renderling-fmt-${{ env.CARGO_GPU_COMMITSH }}-ubuntu-24.04
- run: mkdir -p $HOME/.cargo/bin
- uses: moonrepo/setup-rust@v1
- run: rustup install nightly
- run: rustup component add --toolchain nightly rustfmt
- run: cargo +nightly fmt -- --check
- run: rustup install $RUST_NIGHTLY_TOOLCHAIN
- run: rustup component add --toolchain $RUST_NIGHTLY_TOOLCHAIN rustfmt
- run: cargo +$RUST_NIGHTLY_TOOLCHAIN fmt -- --check

# BAU clippy lints
renderling-clippy:
Expand Down
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@

Always format with `cargo +nightly fmt`.

The fmt toolchain is pinned to `nightly-2026-07-31` via `RUST_NIGHTLY_TOOLCHAIN` in `.github/workflows/push.yaml`. Use that toolchain locally too; bump it deliberately (reformat + regenerate shaders in the same PR).

## Disallowed Methods (clippy.toml)
Avoid: `Vec{2,3,4}::normalize_or_zero`, `Mat4::to_scale_rotation_translation`, `f32::signum`
5 changes: 4 additions & 1 deletion crates/renderling-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,11 @@ impl RenderlingPaths {
// Just format the whole project. I know this is less than ideal,
// but people should be running with a formatter in their editor, and all of
// this is temporary given the wgsl-rs re-stacking happening this year (2026)
let fmt_toolchain =
std::env::var("RUST_NIGHTLY_TOOLCHAIN").unwrap_or_else(|_| "nightly".into());
std::process::Command::new("cargo")
.args(["+nightly", "fmt"])
.arg(format!("+{fmt_toolchain}"))
.arg("fmt")
.output()
.expect("could not format generated code");
log::info!("...done!")
Expand Down
Loading