-
Notifications
You must be signed in to change notification settings - Fork 310
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
Disallow compile warnings in CI #720
Conversation
I see that CI is waiting on approval from a maintainer. So we will explain ourselves. Our intention in this PR is to disallow compile warnings in the codebase. And, of course, to eventually "take care" of each existing warning. The reason that this draft PR currently only attempts to make CI fail on compile warnings and does not yet fix the individual warnings is that we wanted to see it fail, first. The warnings are one of:
In the cases of the former kind, we will use fully qualified paths to disambiguate, thereby eliminating the warning. In the cases of the latter kind, we can place If maintainers agree with this intention of not having warnings in the codebase, consider allowing the CI run. And we will attempt to fix all warnings in reasonable ways. |
Hi there, thanks for this. Do you happen to have the fix for the warnings at hand? If so, could you open a PR? |
@phimuemue sorry for taking so long. We do intend to work on this. @warren2k and I. If no one else intends to pick this up, we would appreciate the patience. Also, will our subsequent pull requests CI runs require approval or is it "first contribution"? |
@phimuemue ready! |
I'm no maintainer here but I would surely appreciate to see no warning while experimenting on Itertools.
|
Note that I just removed |
Oh, that's nice. Thank you for your work, @Philippe-Cholet. And thank you for letting us know. We're working on this in mob programming format. We've made progress today. It's not in this branch yet. Another session scheduled for tomorrow. Hey, do you suppose we could get exempt from workflows needing approval, perhaps? |
I just wanted to let you know about the little upcoming conflict. |
@phimuemue it seems done. Should work. So un-drafting. Please approve workflow. |
Converted to draft because requires rebase. |
7c2a5df
to
d3adf4c
Compare
Please approve workflow and review. |
All checks passed! |
wrappers.rs
Outdated
//! This module helps suppress two kinds of warnings: `deprecated` and `unstable_name_collisions`. | ||
//! New items are created that are noop-wrappers of the original items. | ||
//! The items' original paths are preserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer that we didn't create a top-level wrappers.rs file, and instead #[allow(deprecated, unstable_name_collisions)]
as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bit for you to consider, @jswrenn. Other than the sheer number of #[allow()]
s, some of these warnings are in expressions that include multiple chained method calls. So the span of the #[allow()]
is more than we intend. Feels clumsy to me.
Unless, of course, we extract the very call to which it is intended, which gets ugly immediately.
Call it and we'll do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should blanket-allow both deprecated
and unstable_name_collisions
.
For deprecated
:
- We don't care when it's our own deprecated methods.
- We only take a dependency on one other crate, and I'm not particularly worried about it deprecating anything.
- We don't really care when the standard library deprecates methods. It's rare, and the standard library doesn't ever remove deprecated methods.
For unstable_name_collisions
: This is a non-actionable warning at this time. Until RFC 2845 is implemented, both itertools and the standard library is deadlocked on moving forward. We can't remove methods that trigger unstable_name_collisions
without breaking our dependents, and the standard library can't stabilize unstable conflicting methods without breaking itertools dependants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like you've thought it through. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Rebased. Have yet to address the feedback. |
I attempted to fix a merge conflict so I could merge this, but ultimately broke CI. I'm not sure why. Could you roll back to 352bd2d, fix the merge conflict, and re-request my review? |
Sure. Likely this weekend. |
Co-authored-by: Shahar "Dawn" Or <[email protected]>
Co-authored-by: warren2k <[email protected]>
All checks have passed. We think this is ready for merge. |
Co-authored-by: Shahar "Dawn" Or [email protected]