Automatically generate list of repoman checks.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Thu, 22 Nov 2012 21:48:57 +0000 (22:48 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Thu, 22 Nov 2012 21:48:57 +0000 (22:48 +0100)
This also reenables InheritDeprecated check, which has been disabled in
commit 597826a1cabf654f9b3fff88425d04303e921577.

pym/repoman/checks.py

index 8b80214ef1dc22a08f8b060c1b5158323ff10bc1..fe9330cd98d066cbfcb3fd5b65401ce630263102 100644 (file)
@@ -798,19 +798,9 @@ class PortageInternalVariableAssignment(LineCheck):
                        e = 'Assignment to variable %s' % match.group(2)
                        e += ' on line: %d'
                return e
-
-_constant_checks = tuple(chain((c() for c in (
-       EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
-       EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc,
-       EbuildUselessCdS, EbuildNestedDie,
-       EbuildPatches, EbuildQuotedA, EapiDefinition,
-       ImplicitRuntimeDeps,
-       EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
-       DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
-       SrcCompileEconf, Eapi3DeprecatedFuncs, NoOffsetWithHelpers,
-       Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse,
-       PreserveOldLib, SandboxAddpredict, PortageInternal,
-       PortageInternalVariableAssignment, DeprecatedUseq, DeprecatedHasq)),
+_base_check_classes = (InheritEclass, LineCheck, PhaseCheck)
+_constant_checks = tuple(chain((v() for k, v in globals().items()
+       if isinstance(v, type) and issubclass(v, LineCheck) and v not in _base_check_classes),
        (InheritEclass(k, **kwargs) for k, kwargs in _eclass_info.items())))
 
 _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')