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

another use case: perlcritic output #50

Open
XSven opened this issue Jul 5, 2023 · 3 comments
Open

another use case: perlcritic output #50

XSven opened this issue Jul 5, 2023 · 3 comments

Comments

@XSven
Copy link

XSven commented Jul 5, 2023

I have tried to apply ot to a typical perlcritic output

ot 'lib/Foo/Bar.pm: 2 is not one of the allowed literal values (-1, 0, 1). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 141, column 36.  (Policy: ValuesAndExpressions::ProhibitMagicNumbers'
Could not locate file

Should this work? If NOT are you planning to get this to work. Do you need help with that?

@oalders
Copy link
Member

oalders commented Jul 5, 2023

Could you paste exactly what is needed to reproduce this error?

@XSven
Copy link
Author

XSven commented Jul 5, 2023

File

package Foo;

use strict; use warnings;

our $VERSION = '0.1';

my $var = 17;

1;

perlcritic call

perlcritic --verbose '%f: %m at line %l, column %c. (Policy: %p)\n' --include ProhibitMagicNumbers Foo.pm

ot call

ot 'Foo.pm: 17 is not one of the allowed literal values (0, 1, 2). Use the Readonly or Const::Fast module or the "constant" pragma instead at line 7, column 11. (Policy: ValuesAndExpressions::ProhibitMagicNumbers)'
Could not locate file

@oalders
Copy link
Member

oalders commented Jul 5, 2023

Oh, I see what you're doing here. If you want to tweak the regex to deal with cases like this, I would accept a PR for that.

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

No branches or pull requests

2 participants