kaste / SublimeLinter-contrib-ruff

Adapter to the ruff linter
MIT License
5 stars 0 forks source link

Syntax error causes error #2

Closed willplaehn closed 1 month ago

willplaehn commented 1 month ago

As of version 0.5.0, Ruff doesn't return an error code of "E999" when syntax errors occur, it returns null:

This is causing the following error when a syntax error is encountered:

SublimeLinter.lint.backend [ERROR]: Unhandled exception:
Traceback (most recent call last):
  File "/Users/me/Library/Application Support/Sublime Text/Installed Packages/SublimeLinter.sublime-package/lint/backend.py", line 157, in execute_lint_task
    errors = linter.lint(code, view_has_changed)
  File "/Users/me/Library/Application Support/Sublime Text/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1177, in lint
    return self.filter_errors(self.parse_output(output, virtual_view))
  File "/Users/me/Library/Application Support/Sublime Text/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1201, in filter_errors
    return [
  File "/Users/me/Library/Application Support/Sublime Text/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1201, in <listcomp>
    return [
  File "/Users/me/Library/Application Support/Sublime Text/Installed Packages/SublimeLinter-contrib-ruff.sublime-package/linter.py", line 130, in parse_output
    error_type="error" if code.startswith("F") else "warning",
AttributeError: 'NoneType' object has no attribute 'startswith'
kaste commented 1 month ago

Checking ... ah I'm on 0.4.5 ... what do they report now? Everything must have a rule name; that's actually a nicety because I typically style such hard errors differently, e.g. I literally use a bomb-icon for them right now. 😬

It's okay and obvious from a user standpoint that you cannot exclude such a syntax-error-rule. The changelog states "syntax-error (E999): Syntax errors are now always shown"

kaste commented 1 month ago

Should be fixed in v1.1.4 -- It takes up to 3 hours before this release gets pushed to the Sublime clients via Package Control.

Thanks for reporting!