gugod / gugod/Perl-Critic-TooMuchCode

ProhibitUnusedImport fails in conditional operator ?: with concatenation

Open
#32 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
8
Forks
6
PR merge metrics
No merged PRs in 30d

Description

It fails like this

```
$ perlcritic --noprofile --single TooMuchCode::ProhibitUnusedImport
use Foo qw(bar);
my $a = 1 ? 'prefix-'. bar : 'noop';
Unused import: bar at line 1, column 5. A token is imported but not used in the same code. (Severity: 1)
```

But works in other combinations:

```
$ perlcritic --noprofile --single TooMuchCode::ProhibitUnusedImport
use Foo qw(bar);
my $a = 1 ? 'noop' : 'prefix-'. bar ;
source OK
```
```
$ perlcritic --noprofile --single TooMuchCode::ProhibitUnusedImport
use Foo qw(bar);
my $a = 1 ? bar . '-suffix' : 'noop';
source OK
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.