Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subroutines::ProhibitCallsToUnexportedSubs emits warnings even when there is a "no critic" annotation #19

Open
oalders opened this issue Sep 30, 2022 · 3 comments
Labels

Comments

@oalders
Copy link

oalders commented Sep 30, 2022

This is related to houseabsolute/precious#32

perlcritic --version
1.140
perl -MPerl::Critic::Policy::Subroutines::ProhibitCallsToUnexportedSubs -e 'print $Perl::Critic::Policy::Subroutines::ProhibitCallsToUnexportedSubs::VERSION'
0.06
use strict;
use warnings;

## no critic (Subroutines::ProhibitCallsToUnexportedSubs)
use Git::Sub qw( config );

my @conf = git::config('--list');

$ cat .perlcriticrc

verbose = 3
severity = 3
program-extensions = pl

[Subroutines::ProhibitCallsToUnexportedSubs]
$ perlcritic git-sub.pl
Subroutines::ProhibitCallsToUnexportedSubs: Cannot find source file "git.pm"
Use of "git::config" without including "git" at git-sub.pl line 7

In this case, there should be no warning and no critic violation. It's not clear to me what's going on here.

@petdance
Copy link
Member

petdance commented Mar 4, 2024

I ran into this today and don't know why the no critic isn't working, either. Any insight welcome. I've never messed with no critic internally.

@petdance petdance added the bug label Mar 4, 2024
@oalders
Copy link
Author

oalders commented Mar 4, 2024

I can take a look under the hood when I get a minute.

@klaernie
Copy link

The same issue occurs with Modules::RequireExplicitInclusion - could it be, that this happens because the apply to PPI::Documents, not individual tokens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants