Skip to content

Commit 39abbd3

Browse files
committed
Merge branch 'cm/remote-mediawiki-perlcritique'
* cm/remote-mediawiki-perlcritique: (31 commits) git-remote-mediawiki: make error message more precise git-remote-mediawiki: add a perlcritic rule in Makefile git-remote-mediawiki: add a .perlcriticrc file git-remote-mediawiki: clearly rewrite double dereference git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki") git-remote-mediawiki: put non-trivial numeric values in constants. git-remote-mediawiki: don't use quotes for empty strings git-remote-mediawiki: replace "unless" statements with negated "if" statements git-remote-mediawiki: brace file handles for print for more clarity git-remote-mediawiki: modify strings for a better coding-style git-remote-mediawiki: put long code into a subroutine git-remote-mediawiki: remove import of unused open2 git-remote-mediawiki: check return value of open git-remote-mediawiki: assign a variable as undef and make proper indentation git-remote-mediawiki: rename a variable ($last) which has the name of a keyword git-remote-mediawiki: remove unused variable $entry git-remote-mediawiki: turn double-negated expressions into simple expressions git-remote-mediawiki: change the name of a variable git-remote-mediawiki: add newline in the end of die() error messages git-remote-mediawiki: change style in a regexp ...
2 parents 7f031ed + d8e7c67 commit 39abbd3

File tree

3 files changed

+320
-247
lines changed

3 files changed

+320
-247
lines changed

contrib/mw-to-git/.perlcriticrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# These 3 rules demand to add the s, m and x flag to *every* regexp. This is
2+
# overkill and would be harmful for readability.
3+
[-RegularExpressions::RequireExtendedFormatting]
4+
[-RegularExpressions::RequireDotMatchAnything]
5+
[-RegularExpressions::RequireLineBoundaryMatching]
6+
7+
# This rule says that builtin functions should not be called with parentheses
8+
# e.g.: (taken from CPAN's documentation)
9+
# open($handle, '>', $filename); #not ok
10+
# open $handle, '>', $filename; #ok
11+
# Applying such a rule would mean modifying a huge number of lines for a
12+
# question of style.
13+
[-CodeLayout::ProhibitParensWithBuiltins]
14+
15+
# This rule states that each system call should have its return value checked
16+
# The problem is that it includes the print call. Checking every print call's
17+
# return value would be harmful to the code readabilty.
18+
# This configuration keeps all default function but print.
19+
[InputOutput::RequireCheckedSyscalls]
20+
functions = open say close
21+
22+
# This rules demands to add a dependancy for the Readonly module. This is not
23+
# wished.
24+
[-ValuesAndExpressions::ProhibitConstantPragma]
25+
26+
# This rule is not really useful (rather a question of style) and produces many
27+
# warnings among the code.
28+
[-ValuesAndExpressions::ProhibitNoisyQuotes]

contrib/mw-to-git/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ all: build
1515
build install clean:
1616
$(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
1717
$@-perl-script
18+
perlcritic:
19+
perlcritic -2 *.perl

0 commit comments

Comments
 (0)