Skip Menu |

This queue is for tickets about the Test-NoTabs CPAN distribution.

Report information
The Basics
Id: 53727
Status: resolved
Priority: 0/
Queue: Test-NoTabs

People
Owner: bobtfish [...] bobtfish.net
Requestors: Stuart Watt (no email address)
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.9
Fixed in: (no value)



Subject: Tab detection breaks with malformed POD
Malformed POD in one file will break tab-detection in following files. This is due to the bistable operator getting jammed in the wrong position across files. I made the following change, which appeared to work: 74c74 < next if (/^\s*=.+/ .. (/^\s*=(cut|back|end)/ || eof($fh))); --- Show quoted text
> next if (/^\s*=.+/ .. /^\s*=(cut|back|end)/);
This was intended to provide a catch at the end of a file, so that the condition resets. To reproduce, put tabs in file2.pl, and fail to end a POD in file1.pl. file1.pl: #!/usr/bin/perl =head1 This is POD Tabs here are ignored See what I mean file2.pl: #!/usr/bin/perl Ooops, a tab! 1; Without this, if a POD is not properly ended by =cut/=back/=end, the operator remains in force, skipping lines, even in subsequent files. Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Commit id: b7b3ac231a23ed1cc1b90a1ade1bad9fe28d847e osname=MSWin32, osvers=5.1, archname=MSWin32-x86-perlio
As you've obviously already thought about this, would it be possible for you to send me a patch with a test and the fix in which I could apply (or fork the repository on github and send me a pull request)? TIA t0m
Subject: Re: [rt.cpan.org #53727] Tab detection breaks with malformed POD
Date: Sat, 16 Jan 2010 11:50:20 -0500
To: bug-Test-NoTabs [...] rt.cpan.org
From: Stuart Watt <stuart [...] morungos.com>
I'm not a git wizard, suppose I better get to grips with it. In the meantime, here's a straight patch file. I just used patch -p0 to apply it. I didn't change version or anything, but a new test for this condition is included. As a comment, I found this module outstandingly helpful. Many of my colleagues couldn't indent to save their careers, and I needed to help them focus on removing the tabs which just made everything worse. I found the problems because (a) they can't/don't use Pod very well either, and (b) it was reporting many old files as being just fine, which they definitely weren't. I'd never used .. in scalar context before, so it's been good to see you can use Perl professionally for years and still be learning stuff!! All the best Stuart On 2010-01-16, at 8:10 AM, Tomas Doran via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53727 > > > As you've obviously already thought about this, would it be possible for > you to send me a patch with a test and the fix in which I could apply > (or fork the repository on github and send me a pull request)? > > TIA > t0m >

Message body is not shown because sender requested not to inline it.

From: paul [...] city-fan.org
On Sat Jan 16 11:50:43 2010, morungos2 wrote: Show quoted text
> I'm not a git wizard, suppose I better get to grips with it. In the > meantime, here's a straight patch file. I just used patch -p0 to > apply it. I didn't change version or anything, but a new test for > this condition is included.
The new test added by this patch doesn't work reliably for me because _all_perl_files doesn't always return the list of files in a directory in name or creation time order, so whilst the test expects the "bad pod" file to be tested first (and pass), sometimes the "bad tab" file is tested first (and fails). Adding another hunk to the NoTabs.pm patch to sort the list of files resolves the problem for me: @@ -85,7 +85,7 @@ sub notabs_ok { sub all_perl_files_ok { my @files = _all_perl_files( @_ ); _make_plan(); - foreach my $file ( @files ) { + foreach my $file ( sort @files ) { notabs_ok($file); } }
Subject: Re: [rt.cpan.org #53727] Tab detection breaks with malformed POD
Date: Wed, 10 Feb 2010 13:18:14 -0500
To: bug-Test-NoTabs [...] rt.cpan.org
From: Stuart Watt <stuart [...] morungos.com>
A good catch! Thanks for that. All the best Stuart paul@city-fan.org via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53727 > > > The new test added by this patch doesn't work reliably for me because > _all_perl_files doesn't always return the list of files in a directory > in name or creation time order, so whilst the test expects the "bad pod" > file to be tested first (and pass), sometimes the "bad tab" file is > tested first (and fails). Adding another hunk to the NoTabs.pm patch to > sort the list of files resolves the problem for me: > > @@ -85,7 +85,7 @@ sub notabs_ok { > sub all_perl_files_ok { > my @files = _all_perl_files( @_ ); > _make_plan(); > - foreach my $file ( @files ) { > + foreach my $file ( sort @files ) { > notabs_ok($file); > } > } > >
Patch applied as 84f92d23, with the suggested changes. This will be in the 1.0 release, coming soon. Thanks!