aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-03-16 22:03:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-03-22 09:20:58 +1300
commitc46f068c84863cb9c9ce13392a94765d8e8facd4 (patch)
tree313faee85ad252b4a2e400f5e07a625e33f8b1d3
parentbd6cc28516d8f61d9edd09914ee849c3813234e8 (diff)
downloaddotfiles-c46f068c84863cb9c9ce13392a94765d8e8facd4.tar.gz
dotfiles-c46f068c84863cb9c9ce13392a94765d8e8facd4.zip
Further soften magic numbers Perl::Critic rule
Include 1900 as an allowed integer, for performing logic with the "year" index of `localtime`/`gmtime`. The core module Time::Piece generally makes this unneeded; this change is for writing code that should work on very old releases of Perl (e.g. 5.6), where Time::Piece was not yet core.
-rw-r--r--perlcritic/perlcriticrc7
1 files changed, 4 insertions, 3 deletions
diff --git a/perlcritic/perlcriticrc b/perlcritic/perlcriticrc
index bc8453f8..91bc1540 100644
--- a/perlcritic/perlcriticrc
+++ b/perlcritic/perlcriticrc
@@ -17,7 +17,8 @@ add_exceptions = inet4 inet6 ipv4 ipv6
# This one causes more trouble than it's worth, too
[-Documentation::RequirePODUseEncodingUTF8]
-# Soften this policy a bit; tolerate all the single-digit integers as literals,
-# and also three powers of 10 (for percentages, milliseconds etc)
+# Soften this rather harsh policy a fair bit; tolerate negative one, all the
+# single-digit integers as literals, three powers of 10 (for percentages,
+# milliseconds etc), and 1900 (for localtime)
[ValuesAndExpressions::ProhibitMagicNumbers]
-allowed_values = 0..9 10 100 1000
+allowed_values = -1 0..9 10 100 1000 1900