-
Notifications
You must be signed in to change notification settings - Fork 474
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
[munin-run] cleanup #1061
base: master
Are you sure you want to change the base?
[munin-run] cleanup #1061
Conversation
cgzones
commented
Aug 27, 2018
- format with perltidy
- fix some perlciritc warnings
Pull Request Test Coverage Report for Build 2428
💛 - Coveralls |
There's a lot of whitespace changes here... |
e8608d1
to
b700f18
Compare
I split it up |
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.
Please see my two comments below.
script/munin-run
Outdated
require Pod::Usage; | ||
Pod::Usage::pod2usage( | ||
-verbose => 99, | ||
-verbose => 99, |
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.
Is this alignment of operators really a common style recommendation?
(Python's PEP8 defines exactly the opposite)
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.
It's the default perltidy setting
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 used to be very fond of it, as it makes the code a little more readable. But it has to be automated, which is okay with perltidy
.
But what I prefer nowadays is the cleanliness of diffs, and usually this adds a lot of whitespace noise. It also makes git blame
a headache to work with. Which is a tool that I use a lot ot understand the context of when the current code was written.
This is invaluable to be able to patch things efficiently according to the original intend. Moreover, code that I wrote 6 months ago feels just like code someone else wrote 😉 so...
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.
Instead of git blame
you could use git log -p -M --follow --stat -- path/to/your/file
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.
Err... Not really.
I don't really want to spend brain cycles on something that could be easily automated for me ;)
That said, a git blame can be enhanced to cope with it. But let's do it once for all just prior to releasing.
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.
Anyway: thank you both for sharing your hints :)
What shall we do about the alignment of operators?
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.
What shall we do about the alignment of operators?
Let's defer all tidy changes to when we'll enforce the usage of perltidy
.
paranoia => $paranoia, | ||
}); | ||
$config->reinitialize( { | ||
%{$config}, ## no critic qw(ValuesAndExpressions::ProhibitCommaSeparatedStatements) |
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 wild guessing: is this expression supposed to merge the config
hash together with the additional hash value and supply this new hash as an argument to the reinitialize
method?
Maybe there is a better way to achieve this without overriding the policy?
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.
Yeah, that would be better, but I did not yet find a way, input welcome.
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.
Using a temporary var is always possible, and usually even preferred
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.
@cgzones: would you try to work around this (by using a separate variable?) one in order to save the warning override?
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 do not see a way to use a temporary variable :-(
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.
@steveschnepp: I think, it is time to prove your a temporary var is always possible claim :)
b700f18
to
a02819a
Compare
a02819a
to
6dc1897
Compare
dropped perltidy changes |
ping |
@steveschnepp: what do you think about the remaining changes? |
@steveschnepp: the rest looks OK to me. Should we merge it? |
@steveschnepp: there are only a few lines of changes left in the discussion. Should we merge these? |