Open niklasmohrin opened 3 years ago
What about adding an option that will be enabled on CI replacing the definitions of these macros with compile_error!("some error message")
?
What about adding an option that will be enabled on CI replacing the definitions of these macros with
compile_error!("some error message")
?
Good idea! It could be gated by a feature or env variable
How about a checkpatch.pl rule?
That would trigger on the pr_log!
call in the dbg!
definition too, right? Even if dbg!
isn't called.
We just need to add #[rustc_diagnostic_item = "dbg_macro"]
to our dbg
macro and then enable clippy's dbg_macro
lint.
(Alternatively I can add a similar lint to klint)
See https://github.com/Rust-for-Linux/linux/pull/483#discussion_r722518188
A CI job could ensure that there are no
dbg!
(orpr_info!
, etc.) calls left in pushed code would be a nice addition to the test suite. I have three high level ideas for how to accomplish this, but I haven't checked the applicability of any of them:disallowed-methods
or so, relatively new) that could potentially be used*.rs
filesWhile the last option is probably simplest, it may not be the cleanest. (note that these are just my first ideas, anyone implementing this can of course diverge from them :D ).