-
Notifications
You must be signed in to change notification settings - Fork 125
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
Formatting and Linting #73
Conversation
Pedantic may be excessive; for example, on my setup, I get:
I think that pedantic warnings are irrelevant for the build, since they're not enforced (they don't cause a build failure); in these conditions, if one's really interested, it's simpler to run clippy locally rather than checking the github action log. There is also another aspect - since there are already many standard level warnings (e.g. |
Well, we could always add |
Let me clarify. Right now, without pedantic, the are already 111 warnings to fix (in master); this PR fixes around 20 (as 91 are still remaining). They're inherently more important, easier to fix, and don't generally require any discussion, when compared to the pedantic ones. Adding pedantic warnings adds other 210 warnings, bring to a total of 321/301. Another problem of pedantic warnings is also that they're not straightforward to fix, and additionally, they may need discussion. For example this:
may require discussion, as splitting function may need to meet guidelines etc. This is a real-world example of this concept. So, while fixing the standard warnings may be a straightforward job, fixing the pedantic ones will necessarily be considerably longer and complex. By separating the two tasks, it's possible to accomplish at least one of them (standard warnings), in a shorter time. If warnings are set as errors now, with pedantic warnings there will be a failing build with a very long laundry list, and it will take some time and discussion to get a successful build. Regarding the performance: AFAIK, clippy performance warnings and pedantic ones are not related - I think perf ones can be run via But anyway, Fedor is the tech lead (I'm not in chage of decisions), so I'm fine with anything 😁 |
Ok, understood your point on pedantic, would you recommend other lint strategy? Maybe |
Is there a reason to use
Maybe add a method |
This is a very good question 😆, in fact, this was one of the oddities I've first noticed in the project. I personally have no idea. I think they've been inherited, style-wise, from the original project. |
I think it would be a productive first step would be:
This way, a few objectives are achieved:
Since this is a limited amount of work, hopefully, it can be done quickly. After that... I think anything can be put on the table in the second step (pedantic, perf, etc.etc.). I'm personally fine with everything after the first step is completed 😄 However, this is just my proposal, and @not-fl3 may have in mind an entirely different course of action 😁 |
So, I tried fixing the So I would go with this PR and change it to |
🤯👍 |
This PR does 3 main things:
cargo fmt
, which can be adjusted in the future with rustfmt.romlTODO:
gamepad-rs