Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgzones
Copy link
Contributor

@cgzones cgzones commented Aug 27, 2018

  • format with perltidy
  • fix some perlciritc warnings

@coveralls
Copy link

coveralls commented Aug 27, 2018

Pull Request Test Coverage Report for Build 2428

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 62.424%

Files with Coverage Reduction New Missed Lines %
lib/Munin/Master/UpdateWorker.pm 5 77.37%
Totals Coverage Status
Change from base Build 2425: -0.3%
Covered Lines: 1020
Relevant Lines: 1634

💛 - Coveralls

@steveschnepp
Copy link
Member

There's a lot of whitespace changes here...

@cgzones
Copy link
Contributor Author

cgzones commented Aug 27, 2018

I split it up

Copy link
Collaborator

@sumpfralle sumpfralle left a 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,
Copy link
Collaborator

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)

Copy link
Contributor Author

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

Copy link
Member

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...

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Collaborator

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?

Copy link
Member

@steveschnepp steveschnepp Aug 29, 2018

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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Collaborator

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?

Copy link
Contributor Author

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 :-(

Copy link
Collaborator

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 :)

@cgzones cgzones mentioned this pull request Aug 27, 2018
@cgzones
Copy link
Contributor Author

cgzones commented Aug 29, 2018

dropped perltidy changes

@cgzones
Copy link
Contributor Author

cgzones commented Sep 21, 2018

ping

@sumpfralle
Copy link
Collaborator

@steveschnepp: what do you think about the remaining changes?

@sumpfralle
Copy link
Collaborator

@steveschnepp: the rest looks OK to me. Should we merge it?

@steveschnepp steveschnepp self-assigned this Jun 9, 2019
@steveschnepp steveschnepp added this to the 2.999.13 milestone Jun 9, 2019
@sumpfralle
Copy link
Collaborator

@steveschnepp: there are only a few lines of changes left in the discussion. Should we merge these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants