perlcriticrc 3.6 KB

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