-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the Dist::Setup version and run the code through perlcritic an…
…d perltidy.
- Loading branch information
Showing
19 changed files
with
669 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# DO NOT EDIT! This file is written by perl_setup_dist. | ||
# If needed, you can add content at the end of the file. | ||
|
||
# We report any policy of level 2 or higher (there is far too much noise if we | ||
# go down to severity 1). | ||
severity = 2 | ||
verbose = %f:%l: %m (%p, Severity: %s).\n | ||
|
||
# We still include some policies whose default severity is 1 | ||
include = ValuesAndExpressions::ProhibitInterpolationOfLiterals CodeLayout::ProhibitTrailingWhitespace CodeLayout::RequireTidyCode | ||
|
||
# Signatures are nice, let’s use them. | ||
[TestingAndDebugging::ProhibitNoWarnings] | ||
allow = experimental::signatures | ||
|
||
# Methods of at most 2 lines can directly use @_ without unpacking it first | ||
# (used here for performance reasons). | ||
[Subroutines::RequireArgUnpacking] | ||
short_subroutine_statements = 2 | ||
|
||
[ValuesAndExpressions::ProhibitInterpolationOfLiterals] | ||
allow_if_string_contains_single_quote = 1 | ||
|
||
# Let’s allow moderately complex regex using the default syntax. | ||
[RegularExpressions::RequireExtendedFormatting] | ||
minimum_regex_length_to_complain_about = 30 | ||
|
||
# And we disable some policies that don’t work well: | ||
|
||
# This policy confuses sub prototype with signatures. | ||
[-Subroutines::ProhibitSubroutinePrototypes] | ||
|
||
# This policy appears to also be confused by signatures. | ||
[-Subroutines::ProhibitManyArgs] | ||
|
||
# In theory we want that but, when using Locale::MakeText, this policy | ||
# complains about the %Lexicon variables declared for the localization and there | ||
# is no easy way to exclude them except by listing them all. | ||
# TODO: remove once https://github.com/Perl-Critic/Perl-Critic/issues/1034 is fixed. | ||
[-Variables::ProhibitPackageVars] | ||
|
||
# That performance issue has been fixed in Perl 5.18 and newer. | ||
[-Modules::RequireNoMatchVarsWithUseEnglish] | ||
|
||
# I like postfix control :-) | ||
[-ControlStructures::ProhibitPostfixControls] | ||
|
||
# All the sections that I want to include are there already. | ||
[-Documentation::RequirePodSections] | ||
|
||
# This policy has many bugs, also I think that using the topic variable can make | ||
# the code clearer, even in place where it would not be required to use it. | ||
[-BuiltinFunctions::ProhibitUselessTopic] | ||
|
||
# Let’s assume the reader knows how to write regex. | ||
[-RegularExpressions::RequireDotMatchAnything] | ||
[-RegularExpressions::RequireLineBoundaryMatching] | ||
|
||
# The ',' syntax is nicer than q{,} in my opinion. | ||
[-ValuesAndExpressions::ProhibitNoisyQuotes] | ||
|
||
# End of the template. You can add custom content below this line. | ||
|
||
# The style of ptp is to use complex mapping everywhere... | ||
[-BuiltinFunctions::ProhibitComplexMappings] | ||
|
||
# Similarly, we use map in void context everywhere and sometime mutate $_. | ||
[-BuiltinFunctions::ProhibitVoidMap] | ||
[-ControlStructures::ProhibitMutatingListFunctions] | ||
|
||
[ControlStructures::ProhibitCascadingIfElse] | ||
max_elsif = 3 | ||
|
||
[ValuesAndExpressions::ProhibitMagicNumbers] | ||
allowed_values = -1 0 1 2 3 | ||
|
||
# This is an app, not a library | ||
[-ErrorHandling::RequireCarping] | ||
|
||
# Stuff we just do... | ||
[-InputOutput::RequireBriefOpen] | ||
[-Miscellanea::ProhibitTies] | ||
[-Modules::ProhibitMultiplePackages] | ||
[-ValuesAndExpressions::ProhibitEmptyQuotes] | ||
[-Variables::ProhibitPunctuationVars] | ||
|
||
# TODO: Get rid of these exceptions, we shouldn’t do all these things. | ||
[-Modules::ProhibitAutomaticExportation] | ||
[-References::ProhibitDoubleSigils] | ||
[-Subroutines::RequireFinalReturn] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# DO NOT EDIT! This file is written by perl_setup_dist. | ||
# If needed, you can add content at the end of the file. | ||
|
||
# The reference for all the formatting options is at: | ||
# https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy#FORMATTING-OPTIONS | ||
|
||
# Basic options | ||
|
||
--character-encoding=utf8 | ||
--output-line-ending=unix | ||
|
||
# Code indentation | ||
|
||
--indent-columns=2 | ||
--maximum-line-length=100 | ||
# --variable-maximum-line-length | ||
--continuation-indentation=4 | ||
--extended-continuation-indentation | ||
--nooutdent-long-lines # Even long lines are indented. | ||
|
||
# Whitespace | ||
|
||
--paren-tightness=2 # no spaces inside parens. | ||
--keyword-paren-inner-tightness=2 # no spaces inside parens even for specific keywords. | ||
--square-bracket-tightness=2 # no spaces inside square brackets []. | ||
--brace-tightness=2 # spaces inside braces {} when they contain more than a single tocken. | ||
--block-brace-tightness=0 # always put spaces inside braces that contain code block. | ||
--nospace-for-semicolon # no spaces before semicolons ; in for loops. | ||
--nofunction-paren-vertical-alignment # Useless without the --space-function-paren option, but in any case we would not want this. | ||
--space-prototype-paren=2 # Always put spaces before a function prototype (and, I guess, a function signature). | ||
--logical-padding # Possibly indent the first line of a multi-line operation. | ||
--trim-pod | ||
--minimum-space-to-comment=2 | ||
--nowant-left-space="." # No spaces before the '.' operator. | ||
--nowant-right-space="." # No spaces after the '.' operator. | ||
--space-after-keyword="require defined" # Add a space between these keywords and a following openning paren. | ||
|
||
# Comments | ||
|
||
--ignore-side-comment-lengths # Do not break in the middle of a line of code, because of the length of a comment at the end of that line. | ||
--closing-side-comment-interval=15 # Don’t add closing side comment for blocks of less than 15 lines. | ||
--closing-side-comment-list="sub BEGIN END package" # Only add closing side comments for these types of blocks. | ||
--closing-side-comment-maximum-text=30 | ||
|
||
# Line break | ||
|
||
--cuddled-else # 'else' are on the line of the previous closing brace. | ||
--noopening-brace-on-new-line # Opening braces on the line of their keywords (this is actually the default). | ||
--opening-brace-always-on-right # Opening braces at the right of the line even if there isn’t enough space for it. | ||
--opening-token-right # braces, parens, and brackets on the right after a comma. | ||
--stack-opening-tokens # Several opening tokens are on the same lines (can be controlled per type of tokens if needed). | ||
--comma-arrow-breakpoint=5 # Control how hash are indented. 5 is the default. | ||
--paren-vertical-tightness-closing=3 # Break before a closing paren except in a hash constructior. | ||
--square-bracket-vertical-tightness-closing=0 # Break before a closing square bracket. | ||
--brace-vertical-tightness-closing=0 # Break before a closing brace. | ||
# It might be interesting to play with -wn and -wnxl but creating a good config will probably be difficult. | ||
|
||
# Blank line | ||
--noblanks-before-comments # No empty lines before a comment. | ||
|
||
# Vertical alignment | ||
# Unfortunately we can’t control vertical alignment depending on the context. So let’s disable it for now. | ||
# Feature request for more control: https://rt.cpan.org/Ticket/Display.html?id=136416 | ||
-novalign | ||
|
||
# End of the template. You can add custom content below this line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.