Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not log traceback if file has skip_file comment #416

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

jicruz96
Copy link
Contributor

@jicruz96 jicruz96 commented Jul 5, 2024

closes #415

Let's assume you have a file with a # isort: skip_file comment.

Before:

You'd get a nearly illegible traceback:

Screenshot 2024-07-05 at 12 07 56 AM

After:

Screenshot 2024-07-05 at 12 37 49 AM

except isort.exceptions.FileSkipped:
log_warning(traceback.format_exc(chain=True))
# Ignore file skipped.
return None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returning None avoids an uncaught LSP server error:

Screenshot 2024-07-05 at 12 10 24 AM

@karthiknadig karthiknadig self-assigned this Jul 9, 2024
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jul 9, 2024
@karthiknadig karthiknadig added this to the July 2024 milestone Jul 9, 2024
@karthiknadig karthiknadig modified the milestones: July 2024, August 2024 Jul 24, 2024
@karthiknadig karthiknadig merged commit 3fe5d61 into microsoft:main Jul 24, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undesired behavior on files with # isort: skip_file
3 participants