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
16 changes: 14 additions & 2 deletions .github/workflows/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,29 @@ function clippy_no_features() {
}

# Core crates
clippy_no_features crates/rustc_codegen_spirv-target-specs
clippy_no_features crates/rustc_codegen_spirv-types
clippy crates/rustc_codegen_spirv
clippy crates/spirv-builder
clippy_no_features crates/spirv-std

# Examples

clippy examples/multibuilder
clippy examples/runners/ash
clippy_no_features examples/runners/cpu
clippy examples/runners/wgpu

clippy_no_features examples/runners/cpu
# shaders
clippy_no_features examples/shaders/sky-shader
clippy_no_features examples/shaders/simplest-shader
clippy_no_features examples/shaders/compute-shader
clippy_no_features examples/shaders/mouse-shader
clippy_no_features examples/shaders/reduce

# tests
clippy tests/compiletests
clippy tests/difftests/bin
clippy tests/difftests/lib

# Custom lints

Expand Down
2 changes: 1 addition & 1 deletion tests/compiletests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Runner {
format!("{}-{}", env, variation.name)
};

println!("Testing env: {}\n", stage_id);
println!("Testing env: {stage_id}\n");

let target = format!("{SPIRV_TARGET_PREFIX}{env}");
let libs = build_deps(&self.deps_target_dir, &self.codegen_backend_path, &target);
Expand Down
7 changes: 4 additions & 3 deletions tests/difftests/bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::exit)]

use anyhow::Result;
use std::{
env,
Expand Down Expand Up @@ -26,7 +28,7 @@ fn main() -> Result<()> {
..o
},
Some(Err(e)) => {
eprintln!("Error parsing test options: {}", e);
eprintln!("Error parsing test options: {e}");
process::exit(1);
}
None => TestOpts {
Expand Down Expand Up @@ -120,8 +122,7 @@ fn main() -> Result<()> {
.map(|filter| {
if filter.contains('/') {
// Convert path-like filter to test name format
let path_filter = filter.replace('/', "::");
format!("{}", path_filter)
filter.replace('/', "::")
} else {
filter
}
Expand Down
6 changes: 3 additions & 3 deletions tests/difftests/bin/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl Runner {
let config_json = serde_json::to_string(&config)
.map_err(|e| RunnerError::Config { msg: e.to_string() })?;
let mut config_file = NamedTempFile::new()?;
write!(config_file, "{}", config_json).map_err(|e| RunnerError::Io { source: e })?;
write!(config_file, "{config_json}").map_err(|e| RunnerError::Io { source: e })?;
trace!("Config file created at {}", config_file.path().display());

let mut cmd = Command::new("cargo");
Expand Down Expand Up @@ -294,7 +294,7 @@ impl Runner {
.join("::")
},
);
format!("difftests::{}", name)
format!("difftests::{name}")
}

pub fn collect_test_dirs(root: &Path) -> RunnerResult<Vec<PathBuf>> {
Expand Down Expand Up @@ -383,7 +383,7 @@ mod tests {
version = "0.1.0"
edition = "2021"
"#;
write!(temp, "{}", cargo_toml).expect("failed to write to temp file");
write!(temp, "{cargo_toml}").expect("failed to write to temp file");
let runner = Runner::new(PathBuf::from("dummy_base"));
let pkg_name = runner
.get_package_name(temp.path())
Expand Down
2 changes: 1 addition & 1 deletion tests/difftests/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod tests {
fn test_config_from_path() {
let mut tmp = NamedTempFile::new().unwrap();
let config_json = r#"{ "output_path": "/tmp/output.txt" }"#;
write!(tmp, "{}", config_json).unwrap();
write!(tmp, "{config_json}").unwrap();
let config = Config::from_path(tmp.path()).unwrap();
assert_eq!(config.output_path.to_str().unwrap(), "/tmp/output.txt");
}
Expand Down