Skip Menu |

This queue is for tickets about the Perl-Critic-Pulp CPAN distribution.

Report information
The Basics
Id: 94675
Status: resolved
Priority: 0/
Queue: Perl-Critic-Pulp

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 81
Fixed in: (no value)



Subject: [Documentation::ProhibitUnbalancedParens] Blank line in a POD section can cause brace unmatching

For some reason, the attached file 'fail.txt' does this:


perlcritic -s Documentation::ProhibitUnbalancedParens /tmp/fail.txt
Unclosed paren "{" at line 3, column 1.  (no explanation).  (Severity: 2)
Unopened close paren "}" at line 6, column 1.  (no explanation).  (Severity: 2)

Removing the ^$ line resolves the violation

perlcritic -s Documentation::ProhibitUnbalancedParens /tmp/pass.txt
/tmp/pass.txt source OK
 

 

Subject: fail.txt
=begin IGNORE ME { content } =end IGNORE
Subject: pass.txt
=begin IGNORE ME { content } =end IGNORE
Subject: Re: [rt.cpan.org #94675] [Documentation::ProhibitUnbalancedParens] Blank line in a POD section can cause brace unmatching
Date: Sat, 26 Apr 2014 10:50:02 +1000
To: KENTNL [...] cpan.org, bug-Perl-Critic-Pulp [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Kent Fredric via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes: Show quoted text
> > perlcritic -s Documentation::ProhibitUnbalancedParens /tmp/fail.txt > Unclosed paren "{" at line 3, column 1. (no explanation). (Severity: 2) > Unopened close paren "}" at line 6, column 1. (no explanation). (Severity: 2)
Ah, yes, the blank line in fail.txt means a new paragraph, so the parens are unbalanced in the paragraphs, whereas pass.txt is one paragraph so balanced. I see I never did anything for =begin / =end. I'll make the policy look only at "=begin text" ... if your "=begin IGNORE ME" was meant as it suggests to be ignored :-).

On 2014-04-26 12:51:04, user42@zip.com.au wrote:
> "Kent Fredric via RT" <bug-Perl-Critic-Pulp@rt.cpan.org> writes:
> >
> > perlcritic -s Documentation::ProhibitUnbalancedParens /tmp/fail.txt
> > Unclosed paren "{" at line 3, column 1. (no explanation). (Severity:
> > 2)
> > Unopened close paren "}" at line 6, column 1. (no explanation).
> > (Severity: 2)
>
> Ah, yes, the blank line in fail.txt means a new paragraph, so the
> parens
> are unbalanced in the paragraphs, whereas pass.txt is one paragraph so
> balanced.
>
> I see I never did anything for =begin / =end. I'll make the policy
> look
> only at "=begin text" ... if your "=begin IGNORE ME" was meant as it
> suggests to be ignored :-).

Yeah. It was an example, ( In reality, it was something like =begin MetaPOD 1.0.0 ), but basically, if a POD parser doesn't know what "X" is in "=begin X Y Z" then it should ignore from there to "=end X"

I'm not sure how nested "=begin" within such a segment are handled, but my assumption is they're to be ignored like the rest of the content, though perldoc seems to at least require them be properly balanced.

Yes, beaut. I uploaded a version 82 which restricts itself variously against =begin. Might have to tweak it a bit further but should be a start.