Skip to content

Commit

Permalink
Do not log traceback if file has skip_file comment (#416)
Browse files Browse the repository at this point in the history
* fix: do not log traceback if `skip_file` comment on file

* [nit] update skip_file comment
  • Loading branch information
jicruz96 authored Jul 24, 2024
1 parent 3eef9dc commit 3fe5d61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,12 @@ def _run_tool_on_document(
cwd=cwd,
source=source,
)
except isort.exceptions.FileSkipComment:
log_warning(f"Skipping file with 'skip_file' comment: {document.path}")
return None
except isort.exceptions.FileSkipped:
log_warning(traceback.format_exc(chain=True))
# Ignore file skipped.
return None
except Exception:
log_error(traceback.format_exc(chain=True))
raise
Expand Down

0 comments on commit 3fe5d61

Please sign in to comment.