diff --git a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py index e6c9466240d..2a963d5f9b4 100755 --- a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py +++ b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py @@ -11,12 +11,13 @@ def main(): paths = sys.argv[1:] or sys.stdin.read().splitlines() allowed_extensions = ('.yml', '.yaml') + config_path = 'changelogs/config.yaml' - has_config = False + # config must be detected independent of the file list since the file list only contains files under test (changed) + has_config = os.path.exists(config_path) paths_to_check = [] for path in paths: - if path == 'changelogs/config.yaml': - has_config = True + if path == config_path: continue if path.startswith('changelogs/fragments/.'):