lorax/tests/pylint/runpylint.py
Brian C. Lane 916a001d73 Add support for other branches to the routes
Passing ?branch=<branch-name> will use the specified branch instead of
master.

The new branch will not exist until a /recipes/new?branch=new-branch
POST is made. At that time the branch will be created based on the
current master branch and the new commit will be added to it.
2018-06-11 16:54:58 -07:00

47 lines
1.8 KiB
Python
Executable File

#!/usr/bin/python
#
# Copyright (C) 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import sys
from pocketlint import FalsePositive, PocketLintConfig, PocketLinter
class LoraxLintConfig(PocketLintConfig):
def __init__(self):
PocketLintConfig.__init__(self)
self.falsePositives = [ FalsePositive(r"No name 'version' in module 'pylorax'"),
FalsePositive(r"Module 'pylorax' has no 'version' member"),
FalsePositive(r"Instance of 'int' has no .* member"),
FalsePositive(r"Catching too general exception Exception"),
FalsePositive(r"^E0712.*: Catching an exception which doesn't inherit from (Base|)Exception: GError$"),
]
@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)