-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fun edge case in D407 #5378
Comments
Haha. When an issue has "Fun" in the title... Do you think D407 should detect and replace the equals signs? |
If they're of a matching length it seems like a good user experience to remove the equal signs automatically. |
It would have helped my team. Luckily, someone didn't trust the auto BUT, I'm willing to concede I don't have a wide view of the huge feature set that I could take a whack at it, of course. But I haven't tried to contribute to |
All good, @dhruvmanila already finished it :) |
## Summary Replace same length equal line with dash line in D407 Do we want to update the message and autofix title to reflect this change? ## Test Plan Added test cases for: - Equal line length == dash line length - Equal line length != dash line length fixes: #5378
Let's say I have a function in my code with a standard NumPy docstring:
This will return the ruff error:
But when I do a
ruff --fix .
, the code now looks like this:This happened hundreds of times in our codebases, because someone thought dashes equal signs were the same.
Now, I'm not sure if you want to support finding and fixing this problem. But in an ideal world I wouldn't have to worry about
ruff --fix
breaking things.So, just FYI.
The text was updated successfully, but these errors were encountered: