-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Editorial: Avoid preceding a multi-step Else with a collapsed single-step If #3043
Conversation
I like all of these, but I would prefer they each be separate PRs. Please remove all but the first commit from this PR and I'll approve. |
6693880
to
4a04fc6
Compare
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.
Nice. @bakkot Could we add an ecmarkup lint rule for this?
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.
lgtm, I agree with this stylistic convention.
To preempt: I very much like single-line 1-armed if
s and would be opposed to changing those.
I believe this PR handles all the cases outlined in the description. In addition to those, the spec has some similar cases that the editors might also like 'fixed'. (But I'm not saying that needs to be done in this PR.)
|
@jmdyck Yes, I would like all of these addressed. |
In this PR or a separate one? |
Fixes for all of those are in #3048. The new lint rule caught all of them (as far as I can tell) other than the NumberBitwiseOp / ByteListBitwiseOp cases, which I addressed manually. |
Closing in favour of #3048. |
4a04fc6
to
f399ee7
Compare
We have a few cases of algorithms with steps like
This makes it unnecessarily difficult to track expected behavior, especially when skimming, and I think the spec should have a convention (ultimately codified as a lint rule) to avoid mixing collapsed an non-collapsed steps at the same level of an If–Else construct.
The first commit of this PR replaces violations of that convention, and
later commits (removable upon request)PRs #3044, #3045, and #3046 apply simplifications in the neighborhood of its changes.