Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
a0f345b3
Commit
a0f345b3
authored
Jan 27, 2016
by
Dylan Hardison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 555438 - Improve the Bugzilla code base using Perl::Critic
r=dkl,a=dylan
parent
39d8526e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
0 deletions
+112
-0
014critic-core.t
t/014critic-core.t
+33
-0
critic-core.ini
t/critic-core.ini
+79
-0
No files found.
t/014critic-core.t
0 → 100644
View file @
a0f345b3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
# Enforce high standards against code that will be installed
use 5.10.1;
use strict;
use warnings;
use Test::More;
use File::Spec::Functions ':ALL';
BEGIN {
# Don't run tests for installs or automated tests
unless ( $ENV{RELEASE_TESTING} ) {
plan( skip_all => "Author tests not required for installation" );
}
my $config = catfile('t', 'critic-core.ini');
unless ( eval "use Test::Perl::Critic -profile => '$config'; 1" ) {
plan skip_all => 'Test::Perl::Critic required to criticise code';
}
}
# need to skip t/
all_critic_ok(
'Bugzilla.pm',
'Bugzilla/',
glob("*.cgi"),
glob("*.pl"),
);
t/critic-core.ini
0 → 100644
View file @
a0f345b3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
# This is the Perl::Critic policy file for Bugzilla.
#
# The general rule here is to only add one rule at a time to this file,
# and generally only in situations where we will not generate many false
# positives (requiring spammy # no critic entries) and where we will not
# generate cargo cult behaviour in contributors.
# start with very low requirements, should me moved to 4 soon
severity
=
5
# Policies that are currently not implemented in the code
# these should be fixed and removed from here one by one
[-Subroutines::ProhibitExplicitReturnUndef]
[-ValuesAndExpressions::ProhibitLeadingZeros]
[-InputOutput::ProhibitTwoArgOpen]
[-InputOutput::ProhibitBarewordFileHandles]
[Variables::RequireLexicalLoopIterators]
[-BuiltinFunctions::RequireGlobFunction]
[-Variables::ProhibitConditionalDeclarations]
[-Subroutines::ProhibitReturnSort]
[-TestingAndDebugging::ProhibitNoStrict]
[Subroutines::ProhibitSubroutinePrototypes]
[-Subroutines::ProhibitNestedSubs]
[-ControlStructures::ProhibitMutatingListFunctions]
[-InputOutput::ProhibitInteractiveTest]
######################################################################
# Disabling critic sucks, configure a better policy
[Miscellanea::ProhibitUnrestrictedNoCritic]
severity
=
5
[Miscellanea::ProhibitUselessNoCritic]
severity
=
5
######################################################################
# Temporarily downgraded as the noise obscures more important tests
[Subroutines::RequireFinalReturn]
severity
=
3
[Subroutines::RequireArgUnpacking]
severity
=
3
[Subroutines::ProhibitBuiltinHomonyms]
severity
=
3
[Modules::ProhibitAutomaticExportation]
severity
=
3
######################################################################
# Policies that Bugzilla disagrees with or tolerates as worth the risk
[-BuiltinFunctions::ProhibitStringyEval]
#[-ClassHierarchies::ProhibitExplicitISA]
[-CodeLayout::ProhibitHardTabs]
#[-ControlStructures::ProhibitUnlessBlocks]
#[-Subroutines::ProhibitExplicitReturnUndef]
#[-TestingAndDebugging::ProhibitNoStrict]
#[-TestingAndDebugging::ProhibitNoWarnings]
#[-ValuesAndExpressions::ProhibitConstantPragma]
#[-ValuesAndExpressions::ProhibitMixedBooleanOperators]
#[-Variables::ProhibitPunctuationVars]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment