git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 29/31] git-remote-mediawiki: Add a .perlcriticrc file

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 12, 2013, 02:02 UTC
Message-ID
<CAPig+cR+E7QN7H5hCLR-62soBpt7R2eqS05CyNbNUC09g1V9FQ@mail.gmail.com>
In-Reply-To
<1370989102-24942-30-git-send-email-celestin.matte@ensimag.fr>

On Tue, Jun 11, 2013 at 6:18 PM, Célestin Matte <celestin.matte@ensimag.fr> wrote:

> Such a file allows to configure perlcritic.
> Here, it is used to prevent to remove many unwanted rules and configure one to
s/to prevent//
Show 22 quoted lines
> remove unwanted warnings.
>
> Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
> ---
>  contrib/mw-to-git/.perlcriticrc |   28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 contrib/mw-to-git/.perlcriticrc
>
> diff --git a/contrib/mw-to-git/.perlcriticrc b/contrib/mw-to-git/.perlcriticrc
> new file mode 100644
> index 0000000..a1f8451
> --- /dev/null
> +++ b/contrib/mw-to-git/.perlcriticrc
> @@ -0,0 +1,28 @@
> +# These 3 rules demand to add the s, m and x flag to *every* regexp. This is
> +# overkill and would be harmful for readability.
> +[-RegularExpressions::RequireExtendedFormatting]
> +[-RegularExpressions::RequireDotMatchAnything]
> +[-RegularExpressions::RequireLineBoundaryMatching]
> +
> +# This rules says that builtin functions should not be called with parenthesis

s/rules/rule/ s/parenthesis/parentheses/

Show 22 quoted lines
> +# e.g.: (taken from CPAN's documentation)
> +# open($handle, '>', $filename); #not ok
> +# open $handle, '>', $filename;  #ok
> +# Applying such a rule would mean modifying a huge number of lines for a
> +# question of style.
> +[-CodeLayout::ProhibitParensWithBuiltins]
> +
> +# This rule states that each system call should have its return value checked
> +# The problem is that it includes the print call. Checking every print call's
> +# return value would be harmful to the code readabilty.
> +# This configuration keeps all default function but print.
> +[InputOutput::RequireCheckedSyscalls]
> +functions = open say close
> +
> +# This rules demands to add a dependancy for the Readonly module. This is not
> +# wished.
> +[-ValuesAndExpressions::ProhibitConstantPragma]
> +
> +# This rule is not really useful (rather a question of style) and produces many
> +# warnings among the code.
> +[-ValuesAndExpressions::ProhibitNoisyQuotes]
> --
Previous: Célestin MatteNext: Célestin Matte
Message 32 of 34 in “git-remote-mediawiki: Follow perlcritic's recommandations”
  1. 00/31 git-remote-mediawiki: Follow perlcritic's recommandationsCélestin Matte, Jun 11, 2013
  2. 01/31 git-remote-mediawiki: Make a regexp clearerCélestin Matte, Jun 11, 2013
  3. 02/31 git-remote-mediawiki: Move "use warnings;" before any instructionCélestin Matte, Jun 11, 2013
  4. 03/31 git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)Célestin Matte, Jun 11, 2013
  5. 04/31 git-remote-mediawiki: Always end a subroutine with a returnCélestin Matte, Jun 11, 2013
  6. 05/31 git-remote-mediawiki: Move a variable declaration at the top of the codeCélestin Matte, Jun 11, 2013
  7. 06/31 git-remote-mediawiki: Change syntax of map callsCélestin Matte, Jun 11, 2013
  8. 07/31 git-remote-mediawiki: Rewrite unclear line of instructionsCélestin Matte, Jun 11, 2013
  9. 08/31 git-remote-mediawiki: Remove useless regexp modifier (m)Célestin Matte, Jun 11, 2013
  10. 09/31 git-remote-mediawiki: Change the behaviour of a splitCélestin Matte, Jun 11, 2013
  11. Eric SunshineJun 12, 2013
  12. 10/31 git-remote-mediawiki: Change separator of some regexpsCélestin Matte, Jun 11, 2013
  13. 11/31 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 11, 2013
  14. 12/31 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 11, 2013
  15. 13/31 git-remote-mediawiki: Add newline in the end of die() error messagesCélestin Matte, Jun 11, 2013
  16. 14/31 git-remote-mediawiki: Change the name of a variableCélestin Matte, Jun 11, 2013
  17. 15/31 git-remote-mediawiki: Turn double-negated expressions into simple expressionsCélestin Matte, Jun 11, 2013
  18. 16/31 git-remote-mediawiki: Remove unused variable $entryCélestin Matte, Jun 11, 2013
  19. 17/31 git-remote-mediawiki: Rename a variable ($last) which has the name of a keywordCélestin Matte, Jun 11, 2013
  20. 18/31 git-remote-mediawiki: Assign a variable as undef and make proper indentationCélestin Matte, Jun 11, 2013
  21. 19/31 git-remote-mediawiki: Check return value of openCélestin Matte, Jun 11, 2013
  22. 20/31 git-remote-mediawiki: remove import of unused open2Célestin Matte, Jun 11, 2013
  23. 21/31 git-remote-mediawiki: Put long code into a subroutineCélestin Matte, Jun 11, 2013
  24. 22/31 git-remote-mediawiki: Modify strings for a better coding-styleCélestin Matte, Jun 11, 2013
  25. 23/31 git-remote-mediawiki: Brace file handles for print for more clarityCélestin Matte, Jun 11, 2013
  26. 24/31 git-remote-mediawiki: Replace "unless" statements with negated "if" statementsCélestin Matte, Jun 11, 2013
  27. 25/31 git-remote-mediawiki: Don't use quotes for empty stringsCélestin Matte, Jun 11, 2013
  28. 26/31 git-remote-mediawiki: Put non-trivial numeric values in constants.Célestin Matte, Jun 11, 2013
  29. 27/31 git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")Célestin Matte, Jun 11, 2013
  30. 28/31 git-remote-mediawiki: Clearly rewrite double dereferenceCélestin Matte, Jun 11, 2013
  31. 29/31 git-remote-mediawiki: Add a .perlcriticrc fileCélestin Matte, Jun 11, 2013
  32. Eric SunshineJun 12, 2013
  33. 30/31 git-remote-mediawiki: add a perlcritic rule in MakefileCélestin Matte, Jun 11, 2013
  34. 31/31 git-remote-mediawiki: Make error message more preciseCélestin Matte, Jun 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.