perl-tidy

How can I prevent PerlTidy from aligning my assignments?

风格不统一 提交于 2019-12-14 03:45:59
问题 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 from happening? I've trawled the manual but I can't find a solution. Thanks! 回答1: See the discussion of the -aws option ( --add-whitespace ). By default -aws is enabled. You can alter this behavior using -naws (deleting whitespace is OK, but don't add) or

tiding subversion Perl repo with PerlTidy?

佐手、 提交于 2019-12-11 04:01:45
问题 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 the other hand creating a new repo by checking out all old revisions, reformatting with perltidy and checking in will have to keep the original log messages. Are there any tools/recipes to do it? 回答1: What exactly do you want to do? Clean up all the

Perl::Critic: Life after Moose?

若如初见. 提交于 2019-12-04 17:06:35
问题 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 be more appreciative of the Moose dialect? What do most Moose users do? Relax/ditch critic for the more heavy Moose modules? Custom policies? 回答1: Have you seen Perl::Critic::Moose? 回答2: Both of them can be configured into detail. I have no idea

Perl::Critic: Life after Moose?

為{幸葍}努か 提交于 2019-12-03 10:00:19
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 be more appreciative of the Moose dialect? What do most Moose users do? Relax/ditch critic for the more heavy Moose modules? Custom policies? Have you seen Perl::Critic::Moose ? Both of them can be configured into detail. I have no idea why perltidy wouldn't like it, it has nothing to do with it . Perltidy only governs style. You can change the

How can I prevent PerlTidy from aligning assignments but keep adding single spaces?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 20:13:26
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 switch does not work for me. I just do not want multiple spaces to be inserted. Is it possibe with perltidy or some other tool? Perl tidy changes: my $a = 1; my $aa = 2; my $aaa= 3; into my $a = 1; my $aa = 2; my $aaa = 3; with -naws it remains unchanged: my $a = 1; my $aa = 2; my $aaa= 3; I would like this code to be formatted as: my $a = 1; my $aa =

How can I prevent PerlTidy from aligning assignments but keep adding single spaces?

坚强是说给别人听的谎言 提交于 2019-11-30 04:15:00
问题 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 switch does not work for me. I just do not want multiple spaces to be inserted. Is it possibe with perltidy or some other tool? Perl tidy changes: my $a = 1; my $aa = 2; my $aaa= 3; into my $a = 1; my $aa = 2; my $aaa = 3; with -naws it remains