Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tidy check for dbg #106327

Merged
merged 1 commit into from
Jan 4, 2023
Merged

Add tidy check for dbg #106327

merged 1 commit into from
Jan 4, 2023

Conversation

gimbling-away
Copy link
Contributor

Fixes #106169

@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2022

r? @jyn514

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 31, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Noratrieb Noratrieb removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Dec 31, 2022
@gimbling-away
Copy link
Contributor Author

One possible nit: dbg! in multi line block comments (/* */) are detected as normal macro calls, I don't really have a idea how to detect that without parsing the source itself

@gimbling-away
Copy link
Contributor Author

@jyn514 Any idea how to detect that? 😄

@albertlarsan68
Copy link
Member

I know there is a clippy lint for that, but it is not what is intended for now.

@gimbling-away
Copy link
Contributor Author

There is a clippy lint for dbg yeah + Is there any specific reason we aren't running clippy with default and a few others in CI?

@jyn514
Copy link
Member

jyn514 commented Dec 31, 2022

x.py clippy doesn't really work 😅 it uses your rustup install of clippy and just hopes that the versions are close enough. It's not reliable enough I'd want to gate on it in CI.

If you want, uplifting that lint to rustc seems reasonable (as an allow-by-default lint).

cc #97443

@gimbling-away
Copy link
Contributor Author

gimbling-away commented Jan 1, 2023

The block comment issue doesn't seem that annoying considering that the lint is suppressable, if you (for some reason) have to have a dbg! in a block comment, suppress it

And cc @jyn514 considering uplifting that lint into rustc or running clippy in CI is a much bigger rock to throw, the current solution should work okay

@jyn514
Copy link
Member

jyn514 commented Jan 2, 2023

Looks great, thanks! Ideally it would use the clippy lint, but I understand getting clippy working will be a pain 😓 I don't mind landing this in the meantime.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 2, 2023

📌 Commit cc28813 has been approved by jyn514

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 2, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 4, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions)
 - rust-lang#106274 (Add JSON output to -Zdump-mono-stats)
 - rust-lang#106292 (Add codegen test for `Box::new(uninit)` of big arrays)
 - rust-lang#106327 (Add tidy check for dbg)
 - rust-lang#106361 (Note maximum integer literal for `IntLiteralTooLarge`)
 - rust-lang#106396 (Allow passing a specific date to `bump-stage0`)
 - rust-lang#106436 (Enable doctests for rustc_query_impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d24b229 into rust-lang:master Jan 4, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint on dbg! in tidy
7 participants