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

Tidy up all files #353

Merged
merged 2 commits into from
Jun 30, 2018
Merged

Tidy up all files #353

merged 2 commits into from
Jun 30, 2018

Conversation

ldidry
Copy link
Contributor

@ldidry ldidry commented Jun 23, 2018

The interest in having perltidy tests in Travis is to check for non-tidy code introduction, but it can only be achieved if Sympa itself passes the test. This PR makes Sympa passes the test successfully.

Use git diff --ignore-all-space on the commit to show only non-spaces changes (there is a lot of space changes)

@@ -965,7 +963,9 @@ sub _merge_changes_paragraph {

sub get_id {
my $that = shift->{context};
(ref $that eq 'Sympa::List') ? $that->get_id : (defined $that) ? $that : '';
(ref $that eq 'Sympa::List') ? $that->get_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird indentation (I tried perltidy-ing again, but this was not fixed). Bug (or feature) of Perl::Tidy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, IMHO, that's not the weirdest indentation that Perl::Tidy asked for. I'm not a big fan of src/lib/Sympa/Database.pm L.77 for ex.

Also, I can't find it anymore (too much changed files), but I remember there's an if that have its closing ) { not on the same level of indentation and that was weird since Perl::Tidy made me change a lot of closing ) { indentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. How weird perltidy does, it does its best.

@ikedas
Copy link
Member

ikedas commented Jun 25, 2018

I checked with Perl 5.26.0 + Perl::Tidy-20180220, and all on modules were OK.

  • Executables would also be better to be tidied.

I executed as below:

$ perltidy -pro=doc/dot.perltidyrc -it=2 -b \
cpanfile \
src/*/*.{pl,fcgi}.in \
`find src -name '*.pm'` \
src/lib/Sympa/Constants.pm.in

@ldidry
Copy link
Contributor Author

ldidry commented Jun 25, 2018

Just a thought: we could avoid quite a lot of carriage return just by using a max line width of 80 cols. It may improve readability. Should we use that value?

@ikedas
Copy link
Member

ikedas commented Jun 28, 2018

I forgot exact reason, but there might be a consideration for general terminals. On 80-cols display, newline of a line with 80-cols might run over into the next line.

@ldidry
Copy link
Contributor Author

ldidry commented Jun 28, 2018

Ok.

@ikedas ikedas merged commit 4f949af into sympa-community:sympa-6.2 Jun 30, 2018
@ldidry ldidry deleted the tidy-up branch June 25, 2019 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants