Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
plicease committed Dec 27, 2024
1 parent 0e8eede commit b4ac0cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions lib/Perl/Critic/Plicease.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ case basis.
This is a slight remix on the prohibit leading zeros policy with some helpful exceptions.
=item L<Perl::Critic::Policy::Plicease::ProhibitSignaturesAndAtUnderscore>
Prohibit the use of C<@_> in subroutine using signatures
=item L<Perl::Critic::Policy::Plicease::ProhibitSpecificModules>
Prohibit the use of specific modules or pragmas
=item L<Plicease::ProhibitUnicodeDigitInRegexp|Perl::Critic::Policy::Plicease::ProhibitUnicodeDigitInRegexp>
Prohibit C<\d> (match any digit) in regular expressions without the C</a> or C</u> modifier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PPI> (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<PPI> with better signature detection.
=cut

Expand Down

0 comments on commit b4ac0cf

Please sign in to comment.