Coming from Perl I've been used to hitting C-c t to reformat my code according to pre-defined Perl::Tidy rules. Now, with Python I'm astonished to learn that there is nothing that even remotely resembles the power of Perl::Tidy. PythonTidy 1.20…
Assuming a Perl script such:
my @a = (
1,
2,
3
) ;
my @b = qw(
foo
bar
baz
) ;
executing perltidy with options: perltidy -nopro -ci=4 -boc -sts, I get a different closing parens alignment between the array and the qw…
My Perltidy always prints to standard out instead of the default test.pl.tdy:
perltidy test.pl
And here is my .perltidyrc:
-pbp # Start with Perl Best Practices
-w
-l=100 # 100 characters per line
-ce # 'cuddled' elses. elses appear on the same…
What setting in .perltidyrc will make that chained methods will apear in new line?
Got:
$t->post_ok("/foo")->status_is(200)->json_is('/data',"bar");
Expected:
$t->post_ok("/foo")
->status_is(200)
->json_is('/data',"bar");
If I want to an in-place update of a file with perltidy, how can I do it? Let's say I want to run perl-tidy on foo.pl but I want to the changes to be in foo.pl
I would like to clean up an existing subversion repository containing badly formatted Perl code.
Since I am not sure if some comparisons with fairly old code will be necessary, ideally I would like to have the same formatting for all revisions.
On…
$fs->traverse('/foo')->filter(sub ($name, $dir) { $name !~ /^\./; });
$fs->traverse('/foo')->filter(sub { $_[0] !~ /^\./; });
Is there any option to keep the first line as is? Because with -pbp perltidy breaks it into 5 lines because of a…
I have a small elisp script which applies Perl::Tidy on region or whole file. For reference, here's the script (borrowed from EmacsWiki):
(defun perltidy-command(start end)
"The perltidy command we pass markers to."
(shell-command-on-region start
…
I'm just configuring Perl::Tidy to match my preference. I have only one issue left which I can't find a fix.
Sample script:
#!/usr/bin/perl
# | | | | | < "|" indicates first five "tabs" (1 tab 4 spaces).
use strict; # Enable strict…
I'm using Module::Build to perform build, test, testpod, html, & install actions on my Perl module that I'm developing. The HTML files that are generated are okay, but I'd be much happier if I could somehow configure Module::Build to use the…
I have code that was previous formatted by perltidy. It has assignment operators aligned. How can I get perltidy to unalign the assignment operators. I've been all over the manual, trying and experimenting. Here's my current argument list:
-i=2 -nt…
I am using Perl::Tidy and Perl::Critic while testing my software on several platforms (different Linux distributions and macOS).
I now get different formatting from Perl::Tidy on Linux and macOS which makes Perl::Critic fail because the code is not…
Suppose I have some Perl code that looks like this
use Data::Dump q[pp];
sub something{
return 2 + 2;
}
I want it to be formatted by perltidy as
use Data::Dump q[pp];
sub something{
return 2 + 2;
}
That is, all leading…
We would like to sort use statements alphabetically in the beginning of our classes automatically via perltidy or maybe other tool if available. We already use Test::PerlTidy to test if the code is formatted before committing.
I found that…