summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lester2010-04-07 20:49:27 +0000
committerAndy Lester2010-04-07 20:49:27 +0000
commit1c219aa90f0215179556b0a00753f6d3596a0eeb (patch)
tree776335f0aab9502bc7a3938bdd3e2fa0d6d69a5c
parent8d350432bfacac34ac5f05a68769595c8908d300 (diff)
created a new critic target
-rw-r--r--MANIFEST3
-rw-r--r--Makefile.PL82
-rw-r--r--perlcriticrc26
3 files changed, 71 insertions, 40 deletions
diff --git a/MANIFEST b/MANIFEST
index 62e249660..aad590577 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -6,8 +6,7 @@ SIGNATURE
Makefile.PL
MANIFEST
MANIFEST.SKIP
-.gitignore
-.perlcriticrc
+perlcriticrc
META.yml
TODO
diff --git a/Makefile.PL b/Makefile.PL
index 0fa4f9c8e..1b91d8f26 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -38,35 +38,54 @@ If all else fails, email check_postgres\@bucardo.org for help.
print "Configuring check_postgres $VERSION\n";
-my %opts =
- (
- NAME => 'check_postgres',
- ABSTRACT => 'Postgres monitoring script',
- AUTHOR => 'Greg Sabino Mullane <[email protected]>',
- PREREQ_PM => {
- 'ExtUtils::MakeMaker' => '6.11',
- 'Test::More' => '0.61',
- 'version' => '0',
- },
- NO_META => 1,
- VERSION_FROM => 'check_postgres.pl',
- EXE_FILES => ['check_postgres.pl'],
- MAN1PODS => {},
- NEEDS_LINKING => 0,
- NORECURS => 1,
- clean => { FILES => 'test_database_check_postgres/ test_database_check_postgres2/ /tmp/cptesting_socket' },
+my %opts = (
+ NAME => 'check_postgres',
+ ABSTRACT => 'Postgres monitoring script',
+ AUTHOR => 'Greg Sabino Mullane <[email protected]>',
+ PREREQ_PM => {
+ 'ExtUtils::MakeMaker' => '6.11',
+ 'Test::More' => '0.61',
+ 'version' => '0',
+ },
+ NO_META => 1,
+ VERSION_FROM => 'check_postgres.pl',
+ EXE_FILES => ['check_postgres.pl'],
+ MAN1PODS => {},
+ NEEDS_LINKING => 0,
+ NORECURS => 1,
+ clean => { FILES => 'test_database_check_postgres/ test_database_check_postgres2/ /tmp/cptesting_socket' },
);
-{
- package MY;
- sub clean { ## no critic (RequireArgUnpacking)
- my $string = shift->SUPER::clean(@_);
- $string =~ s{\t}{\tperl t/99_cleanup\.t\n\t};
- $string .= qq{\nsignature_asc : \n};
- $string .= qq{\t@ gpg --yes -ba check_postgres.pl\n};
- $string .= qq{\t@ gpg --verify check_postgres.pl.asc\n};
- $string .= qq{\n\nhtml : \n\t};
- $string .= <<'EOM';
+WriteMakefile(%opts);
+
+exit 0;
+
+package MY;
+
+sub postamble {
+ return <<'HERE';
+
+SEVERITY=4
+
+critic: all critic-program critic-tests
+
+critic-program:
+ perlcritic --severity=$(SEVERITY) -profile perlcriticrc check_postgres.pl
+
+critic-tests:
+ perlcritic --severity=$(SEVERITY) -profile perlcriticrc t/*.t
+
+HERE
+}
+
+sub clean { ## no critic (RequireArgUnpacking)
+ my $string = shift->SUPER::clean(@_);
+ $string =~ s{\t}{\tperl t/99_cleanup\.t\n\t};
+ $string .= qq{\nsignature_asc : \n};
+ $string .= qq{\t@ gpg --yes -ba check_postgres.pl\n};
+ $string .= qq{\t@ gpg --verify check_postgres.pl.asc\n};
+ $string .= qq{\n\nhtml : \n\t};
+ $string .= <<'EOM';
pod2html check_postgres.pl > check_postgres.pl.html
@ perl -pi -e "s/<link.*?>//" check_postgres.pl.html
@ perl -pi -e "s~ git clone.*~ git clone git://bucardo.org/check_postgres.git</pre>~" check_postgres.pl.html
@@ -76,13 +95,8 @@ my %opts =
@ perl -pi -e "s~\`\`(.+?)''~&quot;\\1&quot;~g" check_postgres.pl.html
@ rm -f pod2htmd.tmp pod2htmi.tmp
EOM
- return $string;
- }
-
+ return $string;
}
-my $output = WriteMakefile(%opts);
-
-exit 0;
-
+# vim: expandtab tabstop=8 softtabstop=4 shiftwidth=4:
# end of Makefile.PL
diff --git a/perlcriticrc b/perlcriticrc
index 47487d9ab..c162ef943 100644
--- a/perlcriticrc
+++ b/perlcriticrc
@@ -1,52 +1,67 @@
## Perl Critic settings for check_postgres.pl
verbose = 8
-severity = 1
profile-strictness = quiet
[Documentation::PodSpelling]
stop_words = Mullane Nagios Slony Slony's nols salesrep psql dbname postgres USERNAME usernames dbuser pgpass nagios stderr showperf symlinked timesync criticals quirm lancre exabytes sami includeuser excludeuser flagg tardis WAL tablespaces tablespace perflimit burrick mallory grimm oskar ExclusiveLock garrett artemus queryname speedtest checksum checksums morpork klatch pluto faceoff slon greg watson franklin wilkins scott Sabino Seklecki dbpass autovacuum Astill refactoring NAGIOS localhost cronjob symlink symlinks backends snazzo logfile syslog parens plugin Cwd Ioannis Tambouras schemas SQL MRTG mrtg uptime datallowconn dbhost dbport ok contrib pageslots robert dylan emma fsm minvalue nextval dbstats del ret upd Bucardo noidle bucardo petabytes zettabytes tuples noobjectnames noposition nofuncbody slony noperms nolanguage battlestar pgbouncer pgBouncer
+
+
+
[-Bangs::ProhibitFlagComments]
[-Bangs::ProhibitNumberedNames]
[-Bangs::ProhibitVagueNames]
+
[-BuiltinFunctions::ProhibitComplexMappings]
[-BuiltinFunctions::ProhibitReverseSortBlock]
+
[-CodeLayout::ProhibitParensWithBuiltins]
[-CodeLayout::ProhibitQuotedWordLists]
[-CodeLayout::RequireASCII]
[-CodeLayout::RequireTidyCode]
[-CodeLayout::RequireUseUTF8]
+
[-ControlStructures::ProhibitCascadingIfElse]
[-ControlStructures::ProhibitDeepNests]
[-ControlStructures::ProhibitMutatingListFunctions]
[-ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions]
[-ControlStructures::ProhibitPostfixControls]
[-ControlStructures::ProhibitUnlessBlocks]
+
[-Documentation::RequireEndBeforeLastPod]
[-Documentation::RequirePodAtEnd]
[-Documentation::RequirePodSections]
[-Documentation::RequirePODUseEncodingUTF8]
+
[-Editor::RequireEmacsFileVariables]
+
[-ErrorHandling::RequireCarping]
[-ErrorHandling::RequireCheckingReturnValueOfEval]
[-ErrorHandling::RequireUseOfExceptions]
+
[-InputOutput::ProhibitBacktickOperators]
[-InputOutput::RequireBracedFileHandleWithPrint]
[-InputOutput::RequireBriefOpen]
[-InputOutput::RequireCheckedSyscalls]
+
[-Lax::ProhibitEmptyQuotes::ExceptAsFallback]
+
[-Miscellanea::ProhibitUnrestrictedNoCritic]
[-Miscellanea::ProhibitUselessNoCritic]
[-Miscellanea::RequireRcsKeywords]
+
[-Modules::ProhibitExcessMainComplexity]
[-Modules::RequireExplicitInclusion]
[-Modules::RequireFilenameMatchesPackage]
+
[-NamingConventions::Capitalization]
[-NamingConventions::ProhibitAmbiguousNames]
[-NamingConventions::ProhibitMixedCaseVars]
+
[-References::ProhibitDoubleSigils]
-[-RegularExpressions::ProhibitCaptureWithoutTest]
+
+#[-RegularExpressions::ProhibitCaptureWithoutTest]
[-RegularExpressions::ProhibitComplexRegexes]
[-RegularExpressions::ProhibitEnumeratedClasses]
[-RegularExpressions::ProhibitEscapedMetacharacters]
@@ -54,12 +69,15 @@ stop_words = Mullane Nagios Slony Slony's nols salesrep psql dbname postgres USE
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]
+
[-Subroutines::ProhibitCallsToUndeclaredSubs]
[-Subroutines::ProhibitCallsToUnexportedSubs]
[-Subroutines::ProhibitExcessComplexity]
[-Subroutines::ProhibitNestedSubs]
[-Subroutines::RequireFinalReturn]
+
[-Tics::ProhibitLongLines]
+
[-ValuesAndExpressions::ProhibitAccessOfPrivateData]
[-ValuesAndExpressions::ProhibitEmptyQuotes]
[-ValuesAndExpressions::ProhibitImplicitNewlines]
@@ -69,9 +87,9 @@ stop_words = Mullane Nagios Slony Slony's nols salesrep psql dbname postgres USE
[-ValuesAndExpressions::ProhibitVersionStrings]
[-ValuesAndExpressions::RequireNumberSeparators]
[-ValuesAndExpressions::RestrictLongStrings]
+
[-Variables::ProhibitPackageVars]
[-Variables::ProhibitPunctuationVars]
[-Variables::RequireInitializationForLocalVars]
-[-Variables::RequireLocalizedPunctuationVars]
[-Variables::RequireLexicalLoopIterators]
-
+[-Variables::RequireLocalizedPunctuationVars]