Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Keep It Simple, Stupid
 
PerlMonks  

Re: perltidy 20101217 not detecting errors

by thezip (Vicar)
on Feb 07, 2011 at 17:15 UTC ( #886760=note: print w/ replies, xml ) Need Help??


in reply to perltidy 20101217 not detecting errors

Dandello,

My advice to you is to step back and figure out what assumptions you are making about your script and/or environment.

Write a short script to prove that PerlTidy *is* working. Once you do that, then you can run PerlTidy against your scripts to find out why they are failing.

General stuff, yeah, but IME problems like these are always because of a bad assumption. Just step back and take a deep breath...


What can be asserted without proof can be dismissed without proof. - Christopher Hitchens


Comment on Re: perltidy 20101217 not detecting errors
Re^2: perltidy 20101217 not detecting errors
by Dandello (Beadle) on Feb 07, 2011 at 18:24 UTC

    Well, my assumption is that the current version of Perltidy should detect the same issues as the old version - missing brackets, especially - and give me an .ERR file.

    Since I know the file I'm sending to Tidy has errors because I put them there for testing, I assume I should get an error file.

    AND, when I process the file I know has errors through Perl::Critic online, it tells me "perltidy had errors!! at line 1, column 1. See page 33 of PBP. Severity: 1"

    Now, I don't know if this is a genuine bug, since when I checked the Perltidy bug report I didn't see anything related to this issue, but when but when four out of the four machines that have had the newest version of Activestate Perl installed on them all have the same issue...

    This is the log file for a script I was testing that I know for a fact has a bracket commented out so it would throw an error:

    perltidy version 20101217 log file on a MSWin32 system, OLD_PERL_VERSI +ON=5.012002 Windows type is XP/.Net Configuration and command line parameters for this run: -g To find error messages search for 'WARNING' with your editor

Re^2: perltidy 20101217 not detecting errors
by Dandello (Beadle) on Feb 07, 2011 at 21:21 UTC

    Just for you, Anonymous

    Input:

    #!/usr/bin/perl use strict; use warnings; my $format = 0; if ( $format == 1 ) { print $format; } else { print 'Oops'; exit;
    - including an obvious and intentional error.

    Run through Perltidy from run/cmd: perltidy -g C:\testing\test.pl

    The -g is the flag for a full log including warnings

    What I expect: an ERR file from Perltidy telling me I have a missing right curly bracket at or before line 13 and the previous unmatched bracket is at line 10. This file should be in the same directory as the script being checked.

    No ERR file and the log is this:

    perltidy version 20101217 log file on a MSWin32 system, OLD_PERL_VERSI +ON=5.012002 Windows type is XP/.Net Configuration and command line parameters for this run: -g To find error messages search for 'WARNING' with your editor

    The previous version of Perltidy gave me the ERR file on exactly this type of problem. Now there isn't one. But it still does a nice job prettying up my code.

      Aha, now I see. Consulting http://search.cpan.org/dist/Perl-Tidy/CHANGES I see
      - added new flag -it=n or --iterations=n This flag causes perltidy to do n complete iterations. For most purposes the default of n=1 should be satisfactory. H +owever n=2
      a quick test with -it=2 generates a .ERR file like the previous version used to

      You're welcome :)

        Thank You

        Okay - with that flag it does work the way I was expecting/wanted.

        I'm not sure this is a positive change on their part.

        And now there is something searchable for people in the same boat as I was.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://886760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-04-17 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls