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
43 changes: 24 additions & 19 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,36 @@ edition = "2024"
default-run = "biois-server"

[workspace.lints.clippy]
cargo = { level = "warn", priority = 0 }
complexity = { level = "warn", priority = 0 }
style = { level = "warn", priority = 0 }
perf = { level = "warn", priority = 0 }
pedantic = { level = "warn", priority = 0 }
correctness = "deny"
# Set group priorities to -1 so individual lints (default priority 0) override them cleanly
cargo = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
correctness = { level = "deny", priority = -1 }
pedantic = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }

# disable some pedantic lints
default_trait_access = { level = "allow", priority = 1 }
missing_errors_doc = { level = "allow", priority = 1 }
module_name_repetitions = { level = "allow", priority = 1 }
non_ascii_literal = { level = "allow", priority = 1 }
option_if_let_else = { level = "allow", priority = 1 }
similar_names = { level = "allow", priority = 1 }
wildcard_imports = { level = "allow", priority = 1 }
default_trait_access = "allow"
missing_errors_doc = "allow"
module_name_repetitions = "allow"
non_ascii_literal = "allow"
option_if_let_else = "allow"
similar_names = "allow"
wildcard_imports = "allow"

# enable some restriction lints
dbg_macro = { level = "warn", priority = 1 }
print_stderr = { level = "warn", priority = 1 }
print_stdout = { level = "warn", priority = 1 }
unimplemented = { level = "warn", priority = 1 }
unwrap_used = { level = "warn", priority = 1 }
dbg_macro = "warn"
exit = "warn"
panic = "warn"
print_stderr = "warn"
print_stdout = "warn"
todo = "warn"
unimplemented = "warn"
unreachable = "warn"
unwrap_used = "warn"

# disable some cargo lints
multiple_crate_versions = { level = "allow", priority = 1 }
multiple_crate_versions = "allow"

[[bin]]
name = "biois-server"
Expand Down
2 changes: 2 additions & 0 deletions backend/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ doc-valid-idents = ["OpenAPI", "PostgreSQL", ".."]

# It is okay to being able to easily write tests.
allow-unwrap-in-tests = true
allow-expect-in-tests = true
allow-panic-in-tests = true
2 changes: 1 addition & 1 deletion backend/src/processes/biodiversity_sensitive_areas/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ mod tests {
match opt {
JobControlOptions::SyncExecute => has_sync = true,
JobControlOptions::AsyncExecute => has_async = true,
JobControlOptions::Dismiss => todo!(),
JobControlOptions::Dismiss => panic!("not implemented in test"),
}
}
assert!(has_sync, "expected SyncExecute in job_control_options");
Expand Down
2 changes: 1 addition & 1 deletion backend/src/processes/habitat_distance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ mod tests {
match opt {
JobControlOptions::SyncExecute => has_sync = true,
JobControlOptions::AsyncExecute => has_async = true,
JobControlOptions::Dismiss => todo!(),
JobControlOptions::Dismiss => panic!("not implemented in test"),
}
}
assert!(has_sync, "expected SyncExecute in job_control_options");
Expand Down
2 changes: 1 addition & 1 deletion backend/src/processes/ndvi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ mod tests {
match opt {
JobControlOptions::SyncExecute => has_sync = true,
JobControlOptions::AsyncExecute => has_async = true,
JobControlOptions::Dismiss => todo!(),
JobControlOptions::Dismiss => panic!("not implemented in test"),
}
}
assert!(has_sync, "expected SyncExecute in job_control_options");
Expand Down
Loading