-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-lintArea: New lintsArea: New lintsL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-macrosType: Issues with macros and macro expansionType: Issues with macros and macro expansiongood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
At Rust v1.32, dbg!
macro was added.
https://doc.rust-lang.org/std/macro.dbg.html
This macro is supposed to be used for print debugging. So it should not be contained in final code (e.g. when git commit
).
From doc, it says:
Note that the macro is intended as a debugging tool and therefore you should avoid having uses of it in version control for longer periods. Use cases involving debug output that should be added to version control may be better served by macros such as debug! from the log crate.
I want to suggest to make clippy warn dbg!()
macro use in code.
As related works, eslint, most popular linter for JavaScript, has rule no-console
which prevents use of console.log
.
swfsql, phansch and chenl
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-macrosType: Issues with macros and macro expansionType: Issues with macros and macro expansiongood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy