diff options
author | David Bradford <david.bradford@mongodb.com> | 2021-05-04 13:40:47 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-12 19:27:50 +0000 |
commit | db4e97e3cc339ac406cf579a37922310db7601ee (patch) | |
tree | 819f0da8feb75499eadb7b15fecb5be05a0c5fa1 | |
parent | a8782fc7ea197dd31964be8f238c618d9a776a01 (diff) | |
download | mongo-db4e97e3cc339ac406cf579a37922310db7601ee.tar.gz |
SERVER-56216: Don't look at git metadata when checking for todo comments
(cherry picked from commit e33ea913e252228b4b6a158b74bdab2c1a301f1e)
-rw-r--r-- | buildscripts/todo_check.py | 4 | ||||
-rw-r--r-- | etc/evergreen.yml | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/buildscripts/todo_check.py b/buildscripts/todo_check.py index 314d4b2d284..3a2bc407d62 100644 --- a/buildscripts/todo_check.py +++ b/buildscripts/todo_check.py @@ -10,6 +10,7 @@ from typing import Iterable, Callable, Optional, NamedTuple, Dict, List import click BASE_SEARCH_DIR = "." +IGNORED_PATHS = [".git"] ISSUE_RE = re.compile('(BUILD|SERVER|WT|PM|TOOLS|TIG|PERF|BF)-[0-9]+') @@ -183,6 +184,9 @@ def walk_fs(root: str, action: Callable[[str, Iterable[str]], None]) -> None: for file_name in files: try: file_path = os.path.join(base, file_name) + if any(ignore in file_path for ignore in IGNORED_PATHS): + continue + with open(file_path) as search_file: action(file_path, search_file) except UnicodeDecodeError: diff --git a/etc/evergreen.yml b/etc/evergreen.yml index a8020743ab6..61a4330b855 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -8276,6 +8276,7 @@ tasks: END_OF_COMMIT_MSG commit_message_content=$(cat commit_message.txt) + rm commit_message.txt ${activate_virtualenv} $python buildscripts/todo_check.py --commit-message "$commit_message_content" |