-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unnecessary If/Unless #89
Conversation
Thanks a lot. I will take a look at the weekend. |
Already not looked at the code, but my suggestion for the name would be To rewrite |
All feedback has been addressed including rewriting the corresponding I'm happy to squash a succinct commit if/when you're happy with it! |
f24eb4f
to
38bcceb
Compare
38bcceb
to
125307a
Compare
503ff18
to
635eb37
Compare
c29423a
to
298454e
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.
Very nice. Thank you.
Pull Request Test Coverage Report for Build 298454e56b33de8ccb84c5e6d60c1c5841f3358b-PR-89Details
💛 - Coveralls |
Do you want me to squash this or does your CI handle that? |
I will handle this with GitHub. |
Here's my first pass at collapsing what I'm calling "redundant booleans," ie:
I don't quite like that name and am still thinking on it but I needed something! It only takes case of
do: true, else: false
because I realized it could be taken further but I decided that isn't worth it.do: false, else: true
could protentially be re-written with theif
expression negated. You have to chose between!
andnot
(possibly making it configurable) and it seems like one of those things that should just be a credo warning.I only dealt with leading comments on the
if
line though I can be more thorough. Again, it just didn't seem worth it since people usually write these "redundant booleans" pretty absent-mindedly and can't imagine they'd be full of comments in thedo/else
bodies. I'm also not exactly sure how to keep comments on the same line. "Leading comments" are comments both above and after a line. I'll study Sourceror a little more but I just wanted to get this up for review.I'm certainly open to different ideas on the name! I was even thinking something as dumb as
NoDoTrueElseFalse
😅 😅 😅Thanks!