PPI Signatures Trial Release - Feedback Requested

SYNOPSIS

I have just released a trial version of PPI that includes the first shot at support for Perl signatures. After installing it, you can access this feature in the following ways.

For users of perlcritic and other PPI consumers:

  • include use 5.035; or higher in your code
  • include use feature 'signatures'; in your code
  • include a known signatures-enable strictures modules from CPAN in your code, e.g. Mojolicious::Lite, Modern::Perl
  • if you enable signatures via a custom strictures module, declare it via %ENV: PPI_CUSTOM_FEATURE_INCLUDES='{MyStrict=>{signatures=>1}}' perlcritic Work.pm

For consumers of PPI, in addition to the above:

  • enable recognition of custom parsing feature modules via: PPI::Document->new( custom_feature_includes => ... )
  • enable the custom parsing feature for the entire document via: PPI::Document->new( feature_mods => ... )
  • enable complex parsing of calls to module includes via: PPI::Document->new( custom_feature_include_cb => ... )
  • query enabled features via ::Element->presumed_features

In a similar way as signatures, the core try feature is also recognized.

TODO

There is still a lot to do, since this is a first shot. Questions are open:

For users of perlcritic and other PPI consumers:

  • Which signature features do you need PPI to recognize that currently are not?
  • Which try features do you need PPI to recognize that currently are not?
  • Which other perl parsing features would you like to see supported?
  • Which common CPAN modules should be recognized as enabling specific features?

For consumers of PPI, in addition to the above:

  • What changes, if any, would you like to the custom feature includes facility?
  • What tree of elements would you like to see for signature?
  • What tree of elements would you like to see for try?
  • What tree of elements would you like to see for other parsing features?

BACKGROUND

Doing this took a while, since Perl is fundamentally impossible to statically parse accurately due to various features like prototypes and nested, implicit or indirect imports, and PPI tries to only parse it as a document.

The implementation currently does however, to its best ability, use the tree as emitted to track lexically enabled parsing features.

However the more tricky part was the fact that typically PPI only gets a single file as input and no further arguments that modify what is outputted. This release breaks with that by allowing consumers of PPI to insert a variety of arguments that either affect the document as a whole, or modify how modules includes affect the rest of the document.

If this works out well, PPI might make use of that for future features, which is becoming increasingly important with Paul Evans (LeoNerd)'s work on perl keywords, features like try, and in conjunction with Ovid, the work on Corinna, Object::Pad, the class keyword and others coming in the future.

If you desire to read more of the considerations on this overall topic, please read this github issue, as well as the ones linked in it that preceded it.

TESTING

In addition to the features added to PPI directly, with a lot of help by Olaf Alders, we now also have a reverse dependency testing script that runs as a Github action and runs the test suites not only for modules that use PPI directly, but also for as many downstream modules that end up having PPI in their dependency chain.

Due to the nature of the beast, i had to add a lot of modules to the exclusion list. If you see your modules, or modules you care about, on that list and would like to get them removed, do feel free to contact me.

Since my main goal was getting this out in a reasonable time, i did not investigate many of the failing modules at all. Heck, some of them might even be pointing out actual problems right now.

FEEDBACK

Please leave thoughts, feedback and comments optimally on the github repository, but comments here, in email to me, or other venues in which i am able to respond are appreciated the same.

I would post this to perl sub-reddit as well, but three years ago i spoke out aggressively against allowing r/perl to be used to publicize a post by the TPF that effectively spread false antisemitism accusations, and subsequently the moderators decided to ban me.

The TPF has since retracted the post and others, but the r/perl moderation team remains unmoved, so i cannot post there.

TPF made me wait 301 hours to learn my punishment

Edit2: After further talk with CAT, i will acknowledge that it was not the intent of the CAT to make me wait, and they in fact did not even realize this was the effect.

I am the "second individual", i am intimately familiar with the events of both their investigations.

Shortly before the TPF informed me that their start-of-may update was nearly ready to be posted, i informed them that these were my expectations:

2021-04-29 19:00
> all i care about are correct, accurate, truthful and useful consequences

I was wholly disappointed.

----

Conte…

First Perl Steering Council elected to replace Pumpking position

The most important Perl Governance poll yet has concluded. The position of Pumpking is no more, and is instead now held by a shared 3 person Steering Council, as defined in perlgov.pod: https://github.com/Perl/perl5/pull/18357/files

To quote RJBS:

Perl has two well-defined bodies involved in its governance: a core team of a few dozen and a steering council of three people. The core team sets the rules of Perl governance, votes on membership of the two groups, and delegates substantial decision making power …

Perl Toolchain Summit 2017 - PPI 1.222 has been released - tests, parsing fixes

PPI is a Perl document parser that enables easy analysis and manipulation of Perl source code in a structured manner.

It has been 2.75 years since the last PPI release, v1.218, so we're on a curve of shortening the gaps. ;)

Thanks to the efforts of many contributors to PPI, the support of the people at the Perl Toolchain Summit, the sponsors of the PTS, and specifically Matthew Horsfall (alh) (WOLFSAGE) i have been able to confidently release again after years spent grappling with overwhelming amounts of fixes to untested behavior, often with mutually conflicting results.

Particular thanks goes to the Sponsors for the Perl Toolchain Summit 2017:

Booking.com, ActiveState, cPanel, FastMail, MaxMind, Perl Careers, MongoDB, SureVoIP, Campus Explorer, Bytemark, CAPSiDE, Charlie Gonzalez, Elastic, OpusVL, Perl Services, Procura, XS4ALL, Oetiker+Partner.

Without the support of all of these people and companies this release would not have happened.

The highlights of this release are:

  • unit tests for many parts, both passing and TODO
  • many documentation fixes
  • many parsing fixes
  • various fixes to the behaviors of methods
  • removal of problematic dependencies
  • do not expect '.' in @INC
  • added ->version method to PPI::Statement::Package
  • remove unused PPI::Document->new timeout feature

More details are available in the Changes file in the release itself: https://metacpan.org/release/MITHALDU/PPI-1.222

If you, or the modules you use, depend on PPI, please test how this new version runs with your software.

Of particular note is a change in the release process enabled by the PTS and Matthew Horsfall. Originally releasing PPI required notifying a great many people of the availability of a new release and awaiting the results of their own tests. Matthew provided me with a tool that allows smoking the modules depending on a dist against various versions of it with great ease, so PPI has already been tested against all of its first-level dependents and all the Perl::Critic::* modules. This process has also already identified a problematic fix which has been held back until Perl::Critic can address it.

A discussion of DBIx-Class governance and future development

Due to a dispute on the exact nature of the future of DBIx-Class development after Peter Rabbitson's pending departure, a conversaton has been opened on the DBIx-Class mailing list to feel out what the users of DBIx-Class think.

If you have an interest in the module and its future, please have a read of the current sitation, and maybe leave a note on your position:

http://dbix-class.35028.n2.nabble.com/IMPORTANT-A-discussion-of-DBIC-governance-and-fut…