lorax/tests/pylint/runpylint.py
Brian C. Lane dfdc05df5f tests: Switch to using CentOS8 for the Docker tests
This also moves the packages to be installed into a file that can be
shared between test methods.

It drops several packages that are unnecessary for testing, and excludes
those paths from pylint checks using pocketlint.

Related: rhbz#1785154
2020-02-05 14:54:02 -08:00

42 lines
1.5 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"),
# threading.Lock() is a factory function which returns an
# instance of the Lock class that is supported by the platform
FalsePositive(r"Context manager 'lock' doesn't implement __enter__ and __exit__"),
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
@property
def ignoreNames(self):
return { "bots", "rpmbuild", "rel-eng", "docs", "test" }
@property
def extraArgs(self):
return ["--extension-pkg-whitelist=rpm"]
if __name__ == "__main__":
conf = LoraxLintConfig()
linter = PocketLinter(conf)
rc = linter.run()
sys.exit(rc)