summaryrefslogtreecommitdiff
path: root/buildscripts/linter
diff options
context:
space:
mode:
authorAlexander Neben <alexander.neben@mongodb.com>2022-09-02 21:56:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-02 22:55:09 +0000
commit97ac02fa506b4a9e7e0729b9c492bc4ace79499c (patch)
tree975a4d92d9a33f3eb49920daf4ffe8deba3f84b7 /buildscripts/linter
parentd4d4a26801f7b3033cd6103b6a317cc547ee142c (diff)
downloadmongo-97ac02fa506b4a9e7e0729b9c492bc4ace79499c.tar.gz
SERVER-68593 Disable low value python warnings
Diffstat (limited to 'buildscripts/linter')
-rw-r--r--buildscripts/linter/base.py4
-rw-r--r--buildscripts/linter/git.py3
-rw-r--r--buildscripts/linter/git_base.py9
-rw-r--r--buildscripts/linter/runner.py2
4 files changed, 6 insertions, 12 deletions
diff --git a/buildscripts/linter/base.py b/buildscripts/linter/base.py
index 863cbfbc8e9..eb3832568d5 100644
--- a/buildscripts/linter/base.py
+++ b/buildscripts/linter/base.py
@@ -26,9 +26,8 @@ class LinterBase(object, metaclass=ABCMeta):
"""Get the command to run a linter."""
pass
- def get_fix_cmd_args(self, file_name):
+ def get_fix_cmd_args(self, _file_name):
# type: (str) -> Optional[List[str]]
- # pylint: disable=no-self-use,unused-argument
"""Get the command to run a linter fix."""
return None
@@ -40,7 +39,6 @@ class LinterBase(object, metaclass=ABCMeta):
def needs_file_diff(self):
# type: () -> bool
- # pylint: disable=no-self-use
"""
Check if we need to diff the output of this linter with the original file.
diff --git a/buildscripts/linter/git.py b/buildscripts/linter/git.py
index ef321620305..37218ca46f8 100644
--- a/buildscripts/linter/git.py
+++ b/buildscripts/linter/git.py
@@ -71,7 +71,7 @@ class Repo(_git.Repository):
Returns the full path to the file for clang-format to consume.
"""
- if candidates is not None and len(candidates) > 0: # pylint: disable=len-as-condition
+ if candidates is not None and len(candidates) > 0:
candidates = [self._get_local_dir(f) for f in candidates]
valid_files = list(
set(candidates).intersection(self.get_candidate_files(filter_function)))
@@ -122,7 +122,6 @@ class Repo(_git.Repository):
def get_working_tree_candidate_files(self, filter_function):
# type: (Callable[[str], bool]) -> List[str]
- # pylint: disable=invalid-name
"""Query git to get a list of all files in the working tree to consider for analysis."""
return self._git_ls_files(["--cached", "--others"], filter_function)
diff --git a/buildscripts/linter/git_base.py b/buildscripts/linter/git_base.py
index f54bc8e87c5..852cb74fc28 100644
--- a/buildscripts/linter/git_base.py
+++ b/buildscripts/linter/git_base.py
@@ -6,7 +6,7 @@ import subprocess
LOGGER = logging.getLogger(__name__)
-class Repository(object): # pylint: disable=too-many-public-methods
+class Repository(object):
"""Represent a local git repository."""
def __init__(self, directory):
@@ -239,8 +239,8 @@ class GitException(Exception):
"""
- def __init__( # pylint: disable=too-many-arguments
- self, message, returncode=None, cmd=None, process_args=None, stdout=None, stderr=None):
+ def __init__(self, message, returncode=None, cmd=None, process_args=None, stdout=None,
+ stderr=None):
"""Initialize GitException."""
Exception.__init__(self, message)
self.returncode = returncode
@@ -262,8 +262,7 @@ class GitCommandResult(object):
"""
- def __init__( # pylint: disable=too-many-arguments
- self, cmd, process_args, returncode, stdout=None, stderr=None):
+ def __init__(self, cmd, process_args, returncode, stdout=None, stderr=None):
"""Initialize GitCommandResult."""
self.cmd = cmd
self.process_args = process_args
diff --git a/buildscripts/linter/runner.py b/buildscripts/linter/runner.py
index 46680865f92..1a0fd3e56b2 100644
--- a/buildscripts/linter/runner.py
+++ b/buildscripts/linter/runner.py
@@ -65,7 +65,6 @@ def _find_linter(linter, config_dict):
Return a LinterInstance with the location of the linter binary if a linter binary with the
matching version is found. None otherwise.
"""
- # pylint: disable=too-many-branches,too-many-return-statements
if linter.cmd_name in config_dict and config_dict[linter.cmd_name] is not None:
cmd = [config_dict[linter.cmd_name]]
@@ -172,7 +171,6 @@ class LintRunner(object):
def run_lint(self, linter, file_name):
# type: (base.LinterInstance, str) -> bool
"""Run the specified linter for the file."""
- # pylint: disable=too-many-locals
linter_args = linter.linter.get_lint_cmd_args(file_name)
if not linter_args: