From b4ac0cfbf7f89a92c827c0ae2902da747a59dad3 Mon Sep 17 00:00:00 2001 From: Graham Ollis Date: Fri, 27 Dec 2024 09:46:10 -0700 Subject: [PATCH] update documentation --- README.md | 8 ++++++++ lib/Perl/Critic/Plicease.pm | 8 ++++++++ .../Plicease/ProhibitSignaturesAndAtUnderscore.pm | 12 +++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a065d9e..e30d6a5 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ case basis. This is a slight remix on the prohibit leading zeros policy with some helpful exceptions. +- [Perl::Critic::Policy::Plicease::ProhibitSignaturesAndAtUnderscore](https://metacpan.org/pod/Perl::Critic::Policy::Plicease::ProhibitSignaturesAndAtUnderscore) + + Prohibit the use of `@_` in subroutine using signatures + +- [Perl::Critic::Policy::Plicease::ProhibitSpecificModules](https://metacpan.org/pod/Perl::Critic::Policy::Plicease::ProhibitSpecificModules) + + Prohibit the use of specific modules or pragmas + - [Plicease::ProhibitUnicodeDigitInRegexp](https://metacpan.org/pod/Perl::Critic::Policy::Plicease::ProhibitUnicodeDigitInRegexp) Prohibit `\d` (match any digit) in regular expressions without the `/a` or `/u` modifier. diff --git a/lib/Perl/Critic/Plicease.pm b/lib/Perl/Critic/Plicease.pm index d68ab56..2ae3df5 100644 --- a/lib/Perl/Critic/Plicease.pm +++ b/lib/Perl/Critic/Plicease.pm @@ -20,6 +20,14 @@ case basis. This is a slight remix on the prohibit leading zeros policy with some helpful exceptions. +=item L + +Prohibit the use of C<@_> in subroutine using signatures + +=item L + +Prohibit the use of specific modules or pragmas + =item L Prohibit C<\d> (match any digit) in regular expressions without the C or C modifier. diff --git a/lib/Perl/Critic/Policy/Plicease/ProhibitSignaturesAndAtUnderscore.pm b/lib/Perl/Critic/Policy/Plicease/ProhibitSignaturesAndAtUnderscore.pm index 6052819..9edf8a2 100644 --- a/lib/Perl/Critic/Policy/Plicease/ProhibitSignaturesAndAtUnderscore.pm +++ b/lib/Perl/Critic/Policy/Plicease/ProhibitSignaturesAndAtUnderscore.pm @@ -30,14 +30,16 @@ None. This policy can be configured to recognize additional modules as enabling the signatures feature, by putting an entry in a .perlcriticrc file like this: - [Community::Prototypes] - signature_enablers = Plicease::ProhibitSignaturesAndAtUnderscore + [Plicease::ProhibitSignaturesAndAtUnderscore] + signature_enablers = Foo::Bar =head1 CAVEATS -This module assumes that "prototypes" detected in a source file that has signatures enabled are actually -subroutine signatures. This is because through static analysis alone it is not possible to determine if -a "prototype" is really a prototype and not a signature. There thus may be false negatives/positives. +For older versions of L (newer version is yet unreleased as of this writing), this module assumes +that "prototypes" detected in a source file that has signatures enabled are actually subroutine signatures. +This is because through static analysis alone it is not possible to determine if a "prototype" is really a +prototype and not a signature. There thus may be false negatives/positives. Future versions of this module +will require a L with better signature detection. =cut