Skip to content

Commit

Permalink
Make the panel_view agnostic to error extensions
Browse files Browse the repository at this point in the history
`LintError` is an open type and not all types are hashable.  Make
`format_error` in `panel_view` resilient and only pass down items
actually needed for drawing.

This really only circumvents a limitation of python's `lru_cache`
implementation that relies on hashable types instead of simple
equality.
  • Loading branch information
kaste committed Jan 26, 2024
1 parent e44db28 commit fc97a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion panel_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def format_error(error, widths):
error_as_tuple = tuple(
(k, v)
for k, v in error.items()
if k != 'region' # region is not hashable
if k in ("line", "start", "error_type", "linter", "msg", "code", )
)
return _format_error(error_as_tuple, widths)

Expand Down

0 comments on commit fc97a8e

Please sign in to comment.