I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to.
Are there docs anywhere on how to make critic/tidy…
A cat at my company walked over a keyboard and has left a valid 1000+ line of executable Perl code for me to maintain.
Thanks to Perl's TMTOWTDI philosophy I find myself searching Google to make sense of every line of code she has produced.
To add…
I'm using Eclipse combined with EPIC to write my Perl code. I configured EPIC to use Perltidy with "-pbp" (perl best practices style) to format my code.
This doesn't work well when using Method::Signatures' named parameters. E.g., func (:$arg1, :…
Is there a straightforward way to configure Perl::Tidy so that it handles correctly custom keywords created with Devel::Declare?
Specifically, I am using Sub::Curried, which creates a keyword curry that works more or less like sub with method…
I have the following code snippet:
my $obj = $class->new({
schema => $schema,
reminder => $reminder,
action => $action,
dt => $dt,
});
My problem is, that perltidy tries to format it into something, like this:
my…
How can I prevent PerlTidy from aligning assignments but keep adding single spaces?
This question is similar to How can I prevent PerlTidy from aligning my assignments? but I would like single spaces to be added where directed. Due to this -naws…
This question is not so much technical than looking for advise to find the proper approach that will not hurt.
Assuming the following:
We have a big application developed in Perl.
We want to start using perltidy on the commandline to impose…
By default, PerlTidy will line up assignments in my code. E.g.
PerlTidy changes this...
my $red = 1;
my $green = 2;
my $yellow = 3;
my $cyan = 4;
...into this...
my $red = 1;
my $green = 2;
my $yellow = 3;
my $cyan = 4;
How do I prevent this…
How can I configure perltidy to format long if statements like this:
if (
('this is an example' =~ /an.*example/ and 1 * 2 * 3 == 6) or
('hello world' =~ /world/ and 6 = 3 * 2 * 1)
) {
print "hello\n";
}
or like this
if (
('this is…
To my knowledge, perltidy is extremely handy and helpful when it comes to code formatting. However, I haven't found a way to fine-tune perltidy. For example, I need the && and || formatted so that there are two spaces before and after them. Like…
My department is currently settling on some general code best practices, which we would like to somewhat enforce, providing developers with Perl::Tidy and Perl::Critic configurations.
Now we are having problems with side comments. The side comment…
I am using Perltidy to reformat a few of my old Perl files to a style that is closer to my current preferences. I encountered an issue with this snippet:
Fcntl::S_IRUSR & $mode
Perltidy insists on removing the space after the & token, resulting…
I have a bash command, get-modified-perl-files, that returns all the Perl files I have modified in my repository. I would like to use perltidy on all of these files.
I created a bash function to do the job:
tidy() {
for f in…
I'm using perlcritic with perltidy and while the other rules are applied, I'm, getting the following error message:
Code is not tidy at line 1, near 'package MyPackage;'.
I've run perltidy to tidy the code but I am still getting the problem. In the…
I am attempting to get perltidy to indent correctly. It works almost perfectly, but there are issues with some lines of code.
For example:
$foo = something()
or Foo->throw(
'a string which is longer than -l line length. Gets wrapped to next…