You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason useless-expression is not triggered by loose strings. Should these be caught? If comments are intended, then Ruff could suggest converting them comments?
classX:
"""Some docstring."""deff() ->None:
"""Some docstring."""
[123] # noqa: B018"Some loose string."# Should be B018.x=1"""Some editors consider this a variable docstring, but it doesn't affect any __doc__ andordinary comments are ubiquitous."""
The text was updated successfully, but these errors were encountered:
Yeah, that's what I figured. I tried to illustrate some reasonable uses of strings. I'm not sure how you feel about the "variable docstring", which some editors recognize. As far as I know, they're rarely used and not really a Python concept. They look pretty weird in code:
length: int# The length of the object.width: int# The width of the object.
versus
length: int"The length of the object."width: int"The width of the object."
Yeah, I think we do need to ignore attribute docstrings. They're not standardized, but they're popular enough that I think it'd be a net-negative to flag them.
For some reason useless-expression is not triggered by loose strings. Should these be caught? If comments are intended, then Ruff could suggest converting them comments?
The text was updated successfully, but these errors were encountered: