rjbs / Pod-Weaver

recombine pod documents into awesomer pod documents
26 stars 28 forks source link

PODNAME and ABSTRACT extraction are too liberal #25

Open karenetheridge opened 10 years ago

karenetheridge commented 10 years ago

quick drive-by bug report, to (maybe?) be investigated in further depth (and fixed?) later -- the PPI extraction code for PODNAME and ABSTRACT are way too loose. e.g. they extract comments out of here-documents and other strings that are not actually comments in the code. This makes it more difficult to generate files in Dist::Zilla that contain these comments, as the here-doc right in the code will be picked up and used for the module that is doing the file generation.

(e.g. see Dist::Zilla::Plugin::Conflicts which has to work around this for both PODNAME and ABSTRACT by doing two munging passes,.)

kentfredric commented 9 years ago

Looking at the code and testing a variant of it myself, #PODNAME should be safe, #ABSTRACT should only be a problem if ABSTRACT isn't automatically discovered previously with a normal comment-extraction pass.

This was a bigger problem in older versions of Pod::Weaver which parsed the comments with a single REGEX on the whole document, but modern Pod::Weavers since https://github.com/rjbs/Pod-Weaver/commit/67d1ae7af8ba1169f776478a619a36a9ce80fdfc / 3.101633

The ABSTRACT one seems like it could be your issue though: https://github.com/rjbs/Pod-Weaver/commit/1f7d07ac55932f06b680376b0e1800706cfbed11 / 3.101635

But eliminating that behaviour would break intentional "#ABSTRACT after END"

Context: I'm scrubbing these specific bits and isolating them into a PPIx utility.