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

Avoid OTRS Perl::Critic policies #23

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@paultcochrane

paultcochrane commented May 6, 2017

This PR specifies the Perl::Critic theme and severity level explicitly so as to avoid other Perl::Critic policies being used unnecessarily in the critic.t tests. The solution implemented here is basically that described by @olof in #14 and solves the problem of the extra, unwanted Perl::Critic violations (which were only those for OTRS anyway). Two solutions are implemented here: a simple, quick fix of the issue by explicitly specifying the Perl::Critic settings in the test file, and a more extensible solution using a perlcriticrc file. I've put these in separate commits so that you can cherry pick them if so desired.

This PR is submitted in the hope that it is useful. If you need any changes to it, please just let me know and I'll updated it and resubmit.

paultcochrane added some commits May 6, 2017

Use core Perl::Critic theme explicitly
This avoids issues when users or testers have other Perl::Critic
policies installed, which might add to the core theme without one
wanting this behaviour.  A good example is the OTRS policy, which adds
several OTRS-specific standards to the default Perl::Critic severity
level and is causing the Perl::Critic warnings as seen in issue #14.
This change implements @olof's recommendation as mentioned in the GitHub
issue.
Define Perl::Critic configuration in an .rc file
Defining the Perl::Critic theme and severity level directly in the
critic.t test suite is the simplest and quickest way of avoiding the
problem of unwanted Perl::Critic policies being used, however it might
be better to define the Perl::Critic configuration in a perlcriticrc
file as described in the Test::Perl::Critic documentation.  This is
implemented here as a more extensible variant of the explicit
configuration in the previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment