diff options
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)
parentPrompt for message deletion in Mutt (diff)
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.
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
-# 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)
-allowed_values = 0..9 10 100 1000
+allowed_values = -1 0..9 10 100 1000 1900