lorax/tests/pylint/runpylint.py
Lars Karlitski 160044ba9d Fix pylint errors and warnings
Remove `except` block which immediately raises the same exception again (it's
not a subclass of another caught exception, so this is safe).

Remove a false positive, because it is not emitted from the code base.

Disable subprocess-popen-preexec-fn in startProgram, which is not used
internally.
2018-09-25 13:49:40 +03:00

31 lines
1.1 KiB
Python
Executable File

#!/usr/bin/python3
import sys
from pocketlint import FalsePositive, PocketLintConfig, PocketLinter
class LoraxLintConfig(PocketLintConfig):
def __init__(self):
PocketLintConfig.__init__(self)
self.falsePositives = [ FalsePositive(r"Module 'pylorax' has no 'version' member"),
FalsePositive(r"Catching too general exception Exception"),
FalsePositive(r"^E0712.*: Catching an exception which doesn't inherit from (Base|)Exception: GError$"),
FalsePositive(r"Module 'composer' has no 'version' member"),
]
@property
def pylintPlugins(self):
retval = super(LoraxLintConfig, self).pylintPlugins
# Not using threads so we can skip this
retval.remove("pocketlint.checkers.environ")
# No markup used
retval.remove("pocketlint.checkers.markup")
return retval
if __name__ == "__main__":
conf = LoraxLintConfig()
linter = PocketLinter(conf)
rc = linter.run()
sys.exit(rc)