Skip to content

Deny other Clippy lints? #50

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

Closed
joshlf opened this issue Oct 11, 2022 · 7 comments · Fixed by #65
Closed

Deny other Clippy lints? #50

joshlf opened this issue Oct 11, 2022 · 7 comments · Fixed by #65

Comments

@joshlf
Copy link
Member

joshlf commented Oct 11, 2022

Currently, we deny clippy::indexing_slicing. Should we deny others? So far, I've found:

The time crate has a good list.

We're tracking undocumented_unsafe_blocks separately in #61 since it will likely be a substantial change on its own.

joshlf added a commit that referenced this issue Oct 15, 2022
joshlf added a commit that referenced this issue Oct 15, 2022
joshlf added a commit that referenced this issue Oct 15, 2022
@AntoniosBarotsis
Copy link
Contributor

AntoniosBarotsis commented Oct 15, 2022

I know this is closed but in case you are not aware, you can also put all your lints in a cargo config file so that they are grouped together and not in your source code.

I am doing that in a project I am working on here in case you are interested. Perhaps you know this already, just making sure!

Edit: I see that you defined some lints specifically for tests only, not sure if that is possible in the config file but it sounds like it should.

@joshlf
Copy link
Member Author

joshlf commented Oct 15, 2022

Oh interesting. What's the advantage of doing that over doing it in source code?

@AntoniosBarotsis
Copy link
Contributor

In my case, back when I was using macros in my source code, I found some weird cases where the lints would not work properly between my main and my lib files. Other than that, it's just a bit easier to manage IMO but definitely not a big deal 👍

@joshlf
Copy link
Member Author

joshlf commented Oct 17, 2022

Oh gotcha. Good to know about! Not sure we need it now, but I could see a future in which we want to synchronize across, e.g., zerocopy and zerocopy-derive, or across library code and code in tests/, etc.

@joshlf
Copy link
Member Author

joshlf commented Oct 20, 2022

@AntoniosBarotsis in case you hadn't seen this, I just stumbled across the existence of clippy.toml files.

@AntoniosBarotsis
Copy link
Contributor

I'm assuming you meant clippy.toml 😄. I think I tried that at first but realized that there was quite a few limitations to it so I switched to what I mentioned above with the config.toml file instead.

@joshlf
Copy link
Member Author

joshlf commented Oct 20, 2022

Hahaha yes I did.

joshlf added a commit that referenced this issue Aug 3, 2023
@joshlf joshlf mentioned this issue Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants