Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Run clippy on all targets #1588

Merged
merged 3 commits into from
Jul 9, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uses: mozilla-actions/sccache-action@v0.0.5

- name: Run clippy
run: cargo clippy
run: cargo clippy --all-targets

crate_metadata:
name: Extract crate metadata
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ repos:
name: clippy
language: system
types: [file, rust]
entry: cargo clippy --all -- -D warnings -Dclippy::dbg_macro # Use -D warnings option to ensure the job fails when encountering warnings
entry: cargo clippy --all-targets -- -D warnings -Dclippy::dbg_macro # Use -D warnings option to ensure the job fails when encountering warnings
pass_filenames: false
- id: test
name: test
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ tls-no-verify = true
detached-environments = "{}"
UNUSED = "unused"
"#,
env!("CARGO_MANIFEST_DIR").replace("\\", "\\\\").as_str()
env!("CARGO_MANIFEST_DIR").replace('\\', "\\\\").as_str()
);
let (config, unused) = Config::from_toml(toml.as_str()).unwrap();
assert_eq!(config.default_channels, vec!["conda-forge"]);
Expand Down
2 changes: 1 addition & 1 deletion src/project/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ mod tests {
bar = { features = ["foo"], no-default-feature = true }
"##;

let manifest = Project::from_str(Path::new("pixi.toml"), &contents).unwrap();
let manifest = Project::from_str(Path::new("pixi.toml"), contents).unwrap();
assert_eq!(
manifest
.default_environment()
Expand Down
6 changes: 3 additions & 3 deletions src/project/manifest/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,12 @@ platforms = ["linux-64", "win-64"]
source
.add_environment("bar", Some(vec![String::from("default")]), None, false)
.unwrap();
assert_eq!(source.remove_environment("default").unwrap(), false);
assert!(!source.remove_environment("default").unwrap());
source
.add_environment("default", Some(vec![String::from("default")]), None, false)
.unwrap();
assert_eq!(source.remove_environment("default").unwrap(), true);
assert_eq!(source.remove_environment("foo").unwrap(), true);
assert!(source.remove_environment("default").unwrap());
assert!(source.remove_environment("foo").unwrap());
assert_snapshot!(
format!("test_remove_environment_{}", source.file_name()),
source.to_string()
Expand Down
2 changes: 1 addition & 1 deletion tests/install_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ async fn install_locked_with_config() {
let line = result.stdout.lines().next().unwrap();
let target_dir_canonical = target_dir.canonicalize().unwrap();
let line_path = PathBuf::from(line).canonicalize().unwrap();
assert!(line_path.starts_with(&target_dir_canonical));
assert!(line_path.starts_with(target_dir_canonical));
}

/// Test `pixi install/run --frozen` functionality
Expand Down
Loading