Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcruickshank committed Jul 23, 2022
1 parent 94c2d81 commit 1c15888
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ def sequence_files(
yield fname
# Dedupe here so we don't yield twice
already_yielded.add(fname)
else:
templater_logger.debug(
"- Skipping yield of previously sequenced file: %r",
fname
)

@large_file_check
def process(self, *, fname, in_str=None, config=None, formatter=None):
Expand Down
11 changes: 10 additions & 1 deletion src/sqlfluff/core/linter/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,16 @@ def paths_from_path(
)
break
else:
filtered_buffer.add(os.path.normpath(fpath))
npath = os.path.normpath(fpath)
# For debugging, log if we already have the file.
if npath in filtered_buffer:
linter_logger.debug(
"Developer Warning: Path crawler attempted to "
"requeue the same file twice. %s is already in "
"filtered buffer.",
npath
)
filtered_buffer.add(npath)

# Return a sorted list
return sorted(filtered_buffer)
Expand Down

0 comments on commit 1c15888

Please sign in to comment.