Closed Pierre-Sassoulas closed 10 months ago
The relevant part of that traceback is
File "/home/pierre/pylint/venv/lib/python3.10/site-packages/fixit/rules/no_string_type_annotation.py", line 303, in visit_SimpleString
replacement=cst.parse_expression(node.evaluated_value),
I'm guessing (based on which types have the string "class
in them) that this is from https://github.com/pylint-dev/pylint/blob/fc97635b9515b650be2ce0e75a36e47a45094ccf/pylint/checkers/base/docstring_checker.py#L154
Don't know if this is a bug in no_string_type_annotation
or not, but HTH
Fixit suggest to remove the quote around strings in typing.Litteral
in another check (this is definitely a bug as the litteral string is not defined). Maybe a wrong assumption is being made here too ?
Yeah looks like no_string_type_annotation
guards against typing_extension.Literal
but not typing.Literal
: https://github.com/Instagram/Fixit/blob/79bed4cfda699ca2d2e8283f139860997ef5cd66/src/fixit/rules/no_string_type_annotation.py#L276
But also the rule should probably not crash when parse_expression
raises an exception
See https://github.com/pylint-dev/pylint/blob/fc97635b9515b650be2ce0e75a36e47a45094ccf/pylint/checkers/base/docstring_checker.py#L1 for the source file generating the error, I don't see any
~
inside it though (and line 1 col 5 is not particularly out of the ordinary).