summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2014-10-12scripts: Do not modify the topic variable values in list functionsGuillem Jover2-0/+4
Fixes ControlStructures::ProhibitMutatingListFunctions. Warned-by: perlcritic
2014-10-06perl: Do not use the topic variable unnecessarilyGuillem Jover1-0/+2
Fixes BuiltinFunctions::ProhibitUselessTopic and RegularExpressions::ProhibitUselessTopic. Warned-by: perlcritic
2014-05-17perl: Fix unused capture groups false positivesGuillem Jover1-0/+1
These are false positives, as when there's no match perl will leave the subpattern variables untouched. We'll just use the opportunity to unconfuse perlcritic, making some of those variable usages more clear by using intermediate variables. Fixes RegularExpressions::ProhibitUnusedCapture. Warned-by: perlcritic
2014-05-17scripts: Use character classes instead of single character alternationsGuillem Jover1-0/+1
Fixes RegularExpressions::ProhibitSingleCharAlternation. Warned-by: perlcritic
2014-05-17perl: Do not use global match variablesGuillem Jover1-0/+1
Fixes Variables::ProhibitMatchVars. Warned-by: perlcritic
2014-05-17test: Add labels to Test::More testsGuillem Jover1-0/+1
Fixes TestingAndDebugging::RequireTestLabels. Warned-by: perlcritic
2014-04-21test: Remove sequence number prefixes from test case filenamesGuillem Jover3-1/+1
This stops the madness of having to invent sequence numbers to be able to order the test suite run. Instead we now honour the order of the arguments passed to the runner.
2013-12-07Use https:// URLs instead of http:// when possibleGuillem Jover2-2/+2
2013-12-04perl: Surround FileHandles with braces in print callsGuillem Jover1-0/+1
Fixes InputOutput::RequireBracedFileHandleWithPrint. Warned-by: perlcritic
2013-11-24perl: Always check open() return valueGuillem Jover1-0/+1
Fixes InputOutput::RequireCheckedOpen. Warned-by: perlcritic
2013-11-24Dpkg::Changelog::Entry::Debian: Deprecate regex package variablesGuillem Jover1-0/+1
Expose two functions to match a changelog header and trailer, instead of exposing the raw regex variables. Fixes Variables::ProhibitPackageVars. Warned-by: perlcritic
2013-11-24Dpkg::Deps: Move _arch_* private functions to Dpkg::Deps::SimpleGuillem Jover1-0/+2
Do not use private functions from another module, just move them to the module where they are being used. Fixes Subroutines::ProhibitUnusedPrivateSubroutines and Subroutines::ProtectPrivateSubs. Warned-by: perlcritic
2013-11-23perl: Do not allow hard tabs anywhere other than leading positionGuillem Jover1-0/+1
Fixes CodeLayout::ProhibitHardTabs. Warned-by: perlcritic
2013-07-22Dpkg::Shlibs::Objdump: Add an optional objdump argument to get_formatGuillem Jover1-0/+1
This gets rid of the localized $OBJDUMP variable, by explicitly passing the overriden value to the recursive call. Fixes Variables::ProhibitLocalVars.
2013-07-18scripts: Use the block form for the grep functionGuillem Jover1-0/+1
Fixes BuiltinFunctions::RequireBlockGrep.
2013-07-18Dpkg::Version: Use the block form for the map functionGuillem Jover1-0/+1
Fixes BuiltinFunctions::RequireBlockMap.
2013-07-18dpkg-source: Use two eq operators instead of a grepGuillem Jover1-0/+1
This avoids using grep on scalar context. Fixes BuiltinFunctions::ProhibitBooleanGrep.
2013-07-18dpkg-scansources: Use a foreach loop instead of a void mapGuillem Jover1-0/+1
Fixes BuiltinFunctions::ProhibitVoidMap.
2013-07-18dpkg-gencontrol: Move grep inside an if blockGuillem Jover1-0/+1
This makes the test explicit, and avoids confusing perlcritic of this being a void grep. Fixes BuiltinFunctions::ProhibitVoidGrep.
2013-07-18scripts: Do not mix boolean operatorsGuillem Jover1-0/+1
Fixes ValuesAndExpressions::ProhibitMixedBooleanOperators.
2013-07-18scripts: Do not use negative expression in unless and until conditionsGuillem Jover1-0/+1
These are double negations which are hard to grasp at a first glance. Fixes ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions.
2013-06-22test: Only scan perl module files that will ever contain POD markupGuillem Jover1-2/+10
This should reduce the check time significantly, as it stops checking the program files by duplicate (for <script> and <script>.pl), and does not scan the .git directory any longer.
2013-06-22test: Set .pl and .t as program-extensions for perlcriticGuillem Jover1-0/+1
This should help perlcritic discern when not to apply module checks on programs.
2013-06-22perl: Place strict and warning pragma uses as the first thingGuillem Jover1-2/+2
2013-06-22Dpkg::Source::Package: Capitalize variant module namesGuillem Jover1-0/+1
Lowercase module names are reserved by convention for pragmas, and there's really no need to diverge here from the general dpkg project naming convention. Also make sure source package format variant names are always in lowercase, to not allow names that would not work with previous dpkg-source versions. Fixes NamingConventions::Capitalization.
2013-05-08perl: Use my-style lexical loop iterator variablesGuillem Jover1-0/+1
The variables used on a foreach loop are local to that block, so if we wanted to use it after the loop is finished the last value would be gone. Fixes Variables::RequireLexicalLoopIterators. Warned-by: perlcritic
2013-05-08Dpkg::Source::Patch: Use number separator to ease readabilityGuillem Jover1-0/+1
Fixes ValuesAndExpressions::RequireNumberSeparators. Warned-by: perlcritic
2013-05-08perl: Conditionally include modules with require instead of useGuillem Jover1-0/+1
Fixes Modules::ProhibitConditionalUseStatements. Warned-by: perlcritic
2013-05-08perl: Unify regex delimiters to //, {} or <>Guillem Jover2-0/+4
Fixes RegularExpressions::ProhibitUnusualDelimiters. Warned-by: perlcritic
2013-05-08dpkg-genchanges: Do not use conditional declarationsGuillem Jover1-0/+1
These are quite confusing, instead just rearrange the code so that we only declare it if we are going to need the variable. Fixes Variables::ProhibitConditionalDeclarations. Warned-by: perlcritic
2013-05-08Remove trailing whitespacesGuillem Jover1-0/+1
Do not fix the shlibs conffiles to avoid possible useless prompts. Fixes CodeLayout::ProhibitTrailingWhitespace. Warned-by: perlcritic
2013-05-08Dpkg::Deps: Use braces for multiline regexpGuillem Jover1-0/+1
Fixes RegularExpressions::RequireBracesForMultiline. Warned-by: perlcritic
2013-05-08scripts/t/200_Dpkg_Shlibs.t: Use semicolon instead of commaGuillem Jover1-0/+1
Fixes ValuesAndExpressions::ProhibitCommaSeparatedStatements. Warned-by: perlcritic
2013-05-08perl: Use correct comparison operator for each typeGuillem Jover1-0/+1
Fixes ValuesAndExpressions::ProhibitMismatchedOperators. Warned-by: perlcritic
2013-05-08scripts: Do not use indirect object syntaxGuillem Jover1-0/+1
Fixes Objects::ProhibitIndirectSyntax. Warned-by: perlcritic
2013-05-08dpkg-shlibdeps: Do not use readline operator in a foreach loopGuillem Jover1-0/+1
These are very slow as the list context forces the operator to read the entire stream before starting the loop. Fixes InputOutput::ProhibitReadlineInForLoop. Warned-by: perlcritic
2013-05-08perl: Slurp files more efficientlyGuillem Jover1-0/+1
Do not read each line to then join it, just switch on slurp mode and do it in one go. Use the newly created function file_slurp. Fixes InputOutput::ProhibitJoinedReadline. Warned-by: perlcritic
2013-05-08scripts: On split use an actual regex instead of a literal stringGuillem Jover1-0/+1
Fixes BuiltinFunctions::ProhibitStringySplit. Warned-by: perlcritic
2013-05-08perl: Use the .. operator instead of C-style for loopsGuillem Jover1-0/+1
Fixes ControlStructures::ProhibitCStyleForLoops. Warned-by: perlcritic
2013-05-08perl: Remove unused variablesGuillem Jover1-0/+1
Fixes Variables::ProhibitUnusedVariables. Warned-by: perlcritic
2013-05-06scripts: Initialize arrays with the qw() operatorGuillem Jover1-0/+1
Fixes CodeLayout::ProhibitQuotedWordLists. Warned-by: perlcritic
2013-05-04Do not use double-quotes on strings that do not need interpolationGuillem Jover3-2/+7
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-29scripts: Do not use sort directly on the return keywordGuillem Jover1-0/+1
Fixes Subroutines::ProhibitReturnSort. Warned-by: perlcritic
2013-04-29scripts: Do not use "nested" functions as they are globalGuillem Jover1-0/+1
Even if these functions are defined inside another function, they are still global, make them proper global functions by moving the definition outside of the outter function and mark them explicitly as being private by using an underscore prefix. There's no point in making these anonymous nested functions, as they do not need to access any variable from the outter functions. Fixes Subroutines::ProhibitNestedSubs. Warned-by: perlcritic
2013-04-28Use proper variables instead of barewords for filehandlesGuillem Jover1-0/+1
Fixes InputOutput::ProhibitBarewordFileHandles. Warned-by: perlcritic
2013-04-27Dpkg::Control::Type: Use strict and warningsGuillem Jover1-0/+2
Fixes TestingAndDebugging::RequireUseStrict and TestingAndDebugging::RequireUseWarnings. Warned-by: perlcritic
2013-04-24Use three-argument form of open in perl codeGuillem Jover1-0/+1
Fixes InputOutput::ProhibitTwoArgOpen. Warned-by: perlcritic
2013-04-24dpkg-shlibdeps: Use the glob function call instead of the operatorGuillem Jover1-0/+1
Fixes BuiltinFunctions::RequireGlobFunction. Warned-by: perlcritic
2013-04-19Explicitly quote HEREDOC markers in perl codeGuillem Jover1-0/+1
This makes the HEREDOC quoting-style used explicit, so that it's obvious if the code text will get interpolated or not. Fixes ValuesAndExpressions::RequireQuotedHeredocTerminator. Warned-by: perlcritic
2013-04-19Use just 'return' instead of 'return undef' in perl codeGuillem Jover1-0/+1
This makes sure the functions always return the appropriate value independent of the context. Fixes Subroutines::ProhibitExplicitReturnUndef. Warned-by: perlcritic