perlcriticrc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Perl Critic configuration file
  2. severity = 1
  3. verbose = %f %l:%c (Severity: %s)\n %P (%s)\n near '%r'\n%d\n
  4. program-extensions = .pl .t
  5. [ControlStructures::ProhibitMutatingListFunctions]
  6. add_list_funcs = Dpkg::Util::any Dpkg::Util::none
  7. [RegularExpressions::ProhibitUnusualDelimiters]
  8. allow_all_brackets = 1
  9. [RegularExpressions::RequireBracesForMultiline]
  10. allow_all_brackets = 1
  11. [RegularExpressions::RequireExtendedFormatting]
  12. minimum_regex_length_to_complain_about = 60
  13. [ValuesAndExpressions::ProhibitInterpolationOfLiterals]
  14. # TODO: switch these to q{} ?
  15. allow_if_string_contains_single_quote = 1
  16. # Complex is not always bad.
  17. [-BuiltinFunctions::ProhibitComplexMappings]
  18. # Needed when generating code.
  19. [-BuiltinFunctions::ProhibitStringyEval]
  20. # FIXME: Bogus check.
  21. [-Documentation::PodSpelling]
  22. # While this might be good for performance, it is bad for keeping docs updated.
  23. [-Documentation::RequirePodAtEnd]
  24. # FIXME: Bogus check.
  25. [-Documentation::RequirePodLinksIncludeText]
  26. # TODO: Standardize sections, but the ones from this are not usable.
  27. [-Documentation::RequirePodSections]
  28. # Too many false positives.
  29. [-CodeLayout::RequireTidyCode]
  30. # Forcing this just turns into noise (depending on the context, it makes sense).
  31. [-CodeLayout::RequireTrailingCommas]
  32. # These are fine.
  33. [-ControlStructures::ProhibitCascadingIfElse]
  34. # These are fine, too many in the code base anyway.
  35. [-ControlStructures::ProhibitPostfixControls]
  36. # These are fine, usually as long as they are not double negations.
  37. [-ControlStructures::ProhibitUnlessBlocks]
  38. # FIXME: Too many false positives.
  39. [-ControlStructures::ProhibitUnreachableCode]
  40. # TODO: Check it out, add new Dpkg::Program module?
  41. [-InputOutput::ProhibitBacktickOperators]
  42. # Needed, using <>/<@ARGV> is not correct, Prompt is not a core module.
  43. [-InputOutput::ProhibitExplicitStdin]
  44. # TODO: Maybe, some of these are part of the public/current API.
  45. [-Modules::ProhibitAutomaticExportation]
  46. # Complex is not always bad.
  47. [-Modules::ProhibitExcessMainComplexity]
  48. # FIXME: Too many false positives; non-modules all trigger.
  49. [-Modules::RequireVersionVar]
  50. # These are fine.
  51. [-NamingConventions::ProhibitAmbiguousNames]
  52. # When . is used in the code it means what it does.
  53. [-RegularExpressions::RequireDotMatchAnything]
  54. # When ^ or $ are used in the code they mean what they do.
  55. [-RegularExpressions::RequireLineBoundaryMatching]
  56. # TODO: While valid, these are part of the public/current API.
  57. [-Subroutines::ProhibitBuiltinHomonyms]
  58. # Needed.
  59. [-Subroutines::ProhibitSubroutinePrototypes]
  60. # Adding these seems like more noise.
  61. [-Subroutines::RequireFinalReturn]
  62. # Readers need to know perl, English module is worse.
  63. [-Variables::ProhibitPunctuationVars]
  64. # Readers need to know perl.
  65. [-Variables::RequireInitializationForLocalVars]
  66. # FIXME: Too many false positives; on ::main and for $ENV, $SIG, $?, $a, $b.
  67. [-Variables::RequireLocalizedPunctuationVars]
  68. # Readonly is not a core module.
  69. [-ValuesAndExpressions::ProhibitConstantPragma]
  70. # TODO: Check it out, using other quotes might be less readable and uniform.
  71. [-ValuesAndExpressions::ProhibitEmptyQuotes]
  72. # Used for help output.
  73. [-ValuesAndExpressions::ProhibitImplicitNewlines]
  74. # Octals are fine.
  75. [-ValuesAndExpressions::ProhibitLeadingZeros]
  76. # TODO: Check it out, some magic numbers are fine, octals for example.
  77. [-ValuesAndExpressions::ProhibitMagicNumbers]