Skip to content

Commit

Permalink
Use perlcritic wrapper and plugins from common repo
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Aug 9, 2024
1 parent e404d96 commit fd0d63d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 37 deletions.
48 changes: 44 additions & 4 deletions .perlcriticrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
theme = freenode
theme = community + openqa
severity = 4
include = strict ValuesAndExpressions::ProhibitInterpolationOfLiterals

# TODO: Remove once Perl::Critic::Freenode 0.028 is widely available
[Freenode::DiscouragedModules]
verbose = ::warning file=%f,line=%l,col=%c,title=%m - severity %s::[%p] %e\n

# == Perlcritic Policies
# -- Test::Most brings in strict & warnings
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = Test::Most

[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = Test::Most

# -- Avoid double quotes unless there's interpolation or a single quote.
[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
allow_if_string_contains_single_quote = 1
severity = 3

[Perl::Critic::Policy::HashKeyQuotes]
# -- Prohibit deep nesting
[ControlStructures::ProhibitDeepNests]
severity = 4
add_themes = community
max_nests = 4

# == Community Policies
# -- Test::Most brings in strict & warnings
[Freenode::StrictWarnings]
extra_importers = Test::Most

# -- Test::Most brings in strict & warnings
[Community::StrictWarnings]
extra_importers = Test::Most

[Community::DiscouragedModules]
severity = 3

# Test modules have no package declaration
[Community::PackageMatchesFilename]
severity = 1

# == Custom Policies
# -- Useless quotes on hashes
[HashKeyQuotes]
severity = 5

# -- Superfluous use strict/warning.
[RedundantStrictWarning]
equivalent_modules = Test::Most
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ endif

.PHONY: test-critic
test-critic:
PERL5LIB=lib/perlcritic:$$PERL5LIB perlcritic lib
perlcritic lib

.PHONY: test-tidy-compile
test-tidy-compile:
Expand Down
32 changes: 0 additions & 32 deletions lib/perlcritic/Perl/Critic/Policy/HashKeyQuotes.pm

This file was deleted.

1 change: 1 addition & 0 deletions tools/perlcritic

0 comments on commit fd0d63d

Please sign in to comment.