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

Use clippy::disallowed_methods to warn on macros #1628

Open
vilgotf opened this issue Mar 26, 2022 · 1 comment · May be fixed by #2072
Open

Use clippy::disallowed_methods to warn on macros #1628

vilgotf opened this issue Mar 26, 2022 · 1 comment · May be fixed by #2072
Assignees
Labels
c-all Affects all crates or the project as a whole

Comments

@vilgotf
Copy link
Member

vilgotf commented Mar 26, 2022

The clippy lint disallowed_methods would allow us to automatically check for any occurrence of specify macros or methods by generating clippy warnings (getting blocked by CI).

For example vec![] could be blocked, but matches!() and log::{debug, error, info, trace, warn} could be allowed

@vilgotf vilgotf added the c-all Affects all crates or the project as a whole label Mar 26, 2022
@7596ff
Copy link
Contributor

7596ff commented Mar 28, 2022

I can't seem to figure out how to deny the vec macro, when putting disallowed-methods = ["vec"] or vec! or vec![] or std::vec. Unfortunate

@zeylahellyer zeylahellyer self-assigned this Jan 9, 2023
zeylahellyer added a commit that referenced this issue Jan 18, 2023
Add a Clippy denylist for macros. Denies the use of the following
macros:

- `serde_json::json`
- `std::vec`
- `std::write`

Closes #1628.
@zeylahellyer zeylahellyer linked a pull request Jan 18, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-all Affects all crates or the project as a whole
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants