-
Notifications
You must be signed in to change notification settings - Fork 64
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 Self #502
base: main
Are you sure you want to change the base?
Use Self #502
Conversation
I've come to the belief that the right thing to do for clippy on generated code is to disable it--the purpose of clippy is to make code more idiomatic, and while I think that's a good goal even for generated code, it is not worth the cost of bifurcation or complicating the code generator. So the code in this commit looks good. The change is simple and doesn't make anything more complicated. However, I think the code here add complexity without adding value. If you disagree with this assessment I would be happy to hear your perspective, and thank you as always for the contribution. |
Sorry for the delay @ahl. I do appreciate the added complexity is a concern. I especially hate the addition of a bool throughout In our situation, we write the progenitor generated code to the In addition our software development process documents state that we'll use clippy & fmt , and so legally we must. Altering these process docs to make it conditional invites problems. The result is we have devs implicitly running build.rs generating non-clippy compliant changes, and these changes often ending up in PRs, causing lots of wasted CI and annoyed devs as they need to revert those changes. Having typify/progenitor comply with the default clippy rules would avoid this. Again I appreciate this is a moving target, and which rules become default enabled is a bit arbitrary, but the benefit of adopting that approach is that there is a defined list, all tools used that list by default, and it is easy to sell to auditors as the appropriate/official set of lints that should be complied with. |
feel free to cherry pick that one, or I can put that in a separate PR. I'm happy to take the wins I can get. |
With regard to your comment about requiring your code (generated or otherwise) to be clippy-clean: are attributes that disable clippy permitted? |
Using |
Removes some clippy warnings about https://rust-lang.github.io/rust-clippy/master/index.html#/use_self
There are others. I'm working on them.