enable the dbg_macro clippy rule - #4821
Closed
DetachHead wants to merge 1 commit into
Closed
Conversation
Contributor
|
@stroxler has imported this pull request. If you are a Meta employee, you can view this in D118959745. (Because this pull request was imported automatically, there will not be any future comments.) |
stroxler
approved these changes
Sep 5, 2026
stroxler
left a comment
Contributor
There was a problem hiding this comment.
Thanks!
Don't worry about the red internal signal, I had to patch this because cargo config is derived from our internal buck build setup but the change is good. I'll try to get this in soon, merging requires a second review and it's a holiday weekend so I'm not sure how soon
samwgoldman
approved these changes
Sep 5, 2026
samwgoldman
left a comment
Member
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
after @connernilsen pointed out that i accidentally committed a
dbg!macro, i wondered if there was a clippy rule to prevent such mistakes (see #4729 (comment)). turns out there is!note that enabling a rule globally seems to be nowhere near as straightforward as it is in most other linters, so i had to make some other changes:
workspace = truein each package (Consider disabling collapsible_if or providing a convenient way to disable collapsible_if globally. rust-lang/rust-clippy#16541 (comment))unexpected_cfgsconfig out of the individual packages into the global config, to workaround Packages overriding inherited lints in Cargo.toml + adding lints rust-lang/cargo#13157Test Plan
intentionally inserted a
dbg!macro and rancargo clippy: