summaryrefslogtreecommitdiff
path: root/buildscripts/pylinters.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/pylinters.py')
-rwxr-xr-xbuildscripts/pylinters.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/buildscripts/pylinters.py b/buildscripts/pylinters.py
index 617406b2fb3..9ddce0a2c30 100755
--- a/buildscripts/pylinters.py
+++ b/buildscripts/pylinters.py
@@ -48,7 +48,7 @@ def get_py_linter(linter_filter):
linter_candidates = [linter for linter in _LINTERS if linter.cmd_name in linter_list]
- if len(linter_candidates) == 0:
+ if not linter_candidates:
raise ValueError("No linters found for filter '%s'" % (linter_filter))
return linter_candidates
@@ -56,18 +56,12 @@ def get_py_linter(linter_filter):
def is_interesting_file(file_name):
# type: (str) -> bool
- """"Return true if this file should be checked."""
+ """Return true if this file should be checked."""
return file_name.endswith(".py") and (file_name.startswith("buildscripts/idl")
or file_name.startswith("buildscripts/linter")
or file_name.startswith("buildscripts/pylinters.py"))
-def _get_build_dir():
- # type: () -> str
- """Get the location of the scons' build directory in case we need to download clang-format."""
- return os.path.join(git.get_base_dir(), "build")
-
-
def _lint_files(linters, config_dict, file_names):
# type: (str, Dict[str, str], List[str]) -> None
"""Lint a list of files with clang-format."""
@@ -123,7 +117,7 @@ def _fix_files(linters, config_dict, file_names):
# Get a list of linters which return a valid command for get_fix_cmd()
fix_list = [fixer for fixer in linter_list if fixer.get_fix_cmd_args("ignore")]
- if len(fix_list) == 0:
+ if not fix_list:
raise ValueError("Cannot find any linters '%s' that support fixing." % (linters))
lint_runner = runner.LintRunner()
@@ -152,7 +146,7 @@ def fix_func(linters, config_dict, file_names):
def main():
# type: () -> None
- """Main entry point."""
+ """Execute Main entry point."""
parser = argparse.ArgumentParser(description='PyLinter frontend.')