summaryrefslogtreecommitdiff
path: root/buildscripts/pylinters.py
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-04-11 16:20:54 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-04-11 16:29:32 -0400
commit68005e0ffcc50c9260a162b717aaa5c2225096da (patch)
tree9c490d8588efcf41702d0a61a5f418e4d1cb4418 /buildscripts/pylinters.py
parentd91bc3cde8d453919fe00a6bd89357d41e79bb19 (diff)
downloadmongo-68005e0ffcc50c9260a162b717aaa5c2225096da.tar.gz
SERVER-23312 Enable Python formatting/linting for buildscripts & pytests files
Diffstat (limited to 'buildscripts/pylinters.py')
-rwxr-xr-xbuildscripts/pylinters.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/buildscripts/pylinters.py b/buildscripts/pylinters.py
index 9ddce0a2c30..87d785d7231 100755
--- a/buildscripts/pylinters.py
+++ b/buildscripts/pylinters.py
@@ -57,9 +57,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 file_name.endswith(".py") and (file_name.startswith("buildscripts/idl")
- or file_name.startswith("buildscripts/linter")
- or file_name.startswith("buildscripts/pylinters.py"))
+ file_blacklist = ["buildscripts/cpplint.py"]
+ directory_blacklist = ["src/third_party"]
+ if file_name in file_blacklist or file_name.startswith(tuple(directory_blacklist)):
+ return False
+ directory_list = ["buildscripts", "pytests"]
+ return file_name.endswith(".py") and file_name.startswith(tuple(directory_list))
def _lint_files(linters, config_dict, file_names):