Skip to content

Commit

Permalink
Avoid repeatedly calling setModulePaths from chplcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Jun 18, 2024
1 parent 93d1cf4 commit 5bfd74d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/chplcheck/src/chplcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 _:
Expand Down

0 comments on commit 5bfd74d

Please sign in to comment.