Skip to content

Commit

Permalink
Use clippy to disallow e/print/ln macros
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyrosRoum committed Nov 8, 2023
1 parent cd0bb24 commit b5e0bc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
13 changes: 8 additions & 5 deletions anvil/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ fn main() {
tracing::error!("Unknown backend: {}", other);
}
None => {
println!("USAGE: anvil --backend");
println!();
println!("Possible backends are:");
for b in POSSIBLE_BACKENDS {
println!("\t{}", b);
#[allow(clippy::disallowed_macros)]
{
println!("USAGE: anvil --backend");
println!();
println!("Possible backends are:");
for b in POSSIBLE_BACKENDS {
println!("\t{}", b);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::disallowed_macros)]
#[cfg(any(feature = "backend_egl", feature = "renderer_gl"))]
fn gl_generate() {
use gl_generator::{Api, Fallbacks, Profile, Registry};
Expand Down
7 changes: 7 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
msrv = "1.65.0"
type-complexity-threshold = 400

disallowed-macros = [
{ path = "std::print", reason = "We use tracing for logging" },
{ path = "std::println", reason = "We use tracing for logging" },
{ path = "std::eprint", reason = "We use tracing for logging" },
{ path = "std::eprintln", reason = "We use tracing for logging" },
]

0 comments on commit b5e0bc8

Please sign in to comment.