diff --git a/tools/chplcheck/src/chplcheck.py b/tools/chplcheck/src/chplcheck.py index 5aeafea7b03b..e160a43c45d9 100755 --- a/tools/chplcheck/src/chplcheck.py +++ b/tools/chplcheck/src/chplcheck.py @@ -263,8 +263,13 @@ def main(): printed_warning = False + prev_context = None for filename, context in chapel.files_with_contexts(args.filenames): - context.set_module_paths([], []) + # Avoid re-setting module paths on already-used contexts, due to + # bucketing from files_with_contexts. + if context is not prev_context: + context.set_module_paths([], []) + prev_context = context # Silence errors, warnings etc. -- we're just linting. with context.track_errors() as _: