CC: | efung [...] staff.iinet.net.au |
Subject: | Configuration abbrevation parsing broken since 20120619 (w/ patch) |
Date: | Mon, 21 Apr 2014 14:13:37 +0800 |
To: | bug-Perl-Tidy [...] rt.cpan.org |
From: | Eric Fung <efungsh [...] gmail.com> |
Hi folks,
I've found that abbreviation parsing has been broken since v20120619.
I've provided below what the errors are for once example.
I've also attached a patch to fix the issue + a minor clarification to the
abbreviation docs.
While I was there, I also cleaned up the $saw_* parameter passing.
Also noticed that the code was messy because of the $saw_pbp flag as the
pbp specification also contains operational flags.
I thought about this for a little to see if I could clean this up, but I
think that --perl-best-practices should only contain flags that modify code
layout so the default output modes apply.
I can appreciate that may break some configurations currently out in the
wild, but it just seems silly that a layout abbreviation modifies the
default output behaviour of the program itself.
Anyway, perhaps another discussion for another time.
Cheers.
-----
ericf@dev-billing-rumba1:~$ cat testrc
testing1 { -pbp }
testing2 { -act=2 }
ericf@dev-billing-rumba1:~$ echo 'print "Hello world!\n";' > test.pl
ericf@dev-billing-rumba1:~$ perl test.pl
Hello world!
ericf@dev-billing-rumba1:~$ perltidy -pro=testrc test.pl
No '}' seen after testing1 and before testing2 in config file testrc line 3
ericf@dev-billing-rumba1:~$ perltidy --version
This is perltidy, v20140328
Copyright 2000-2014, Steve Hancock
Perltidy is free software and may be copied under the terms of the GNU
General Public License, which is included in the distribution files.
Complete documentation for perltidy can be found using 'man perltidy'
or on the internet at http://perltidy.sourceforge.net.
-----
Message body is not shown because sender requested not to inline it.