-
Notifications
You must be signed in to change notification settings - Fork 49
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
Is it better to run format before lint? #74
Comments
Reference: https://github.com/astral-sh/ruff-pre-commit/blob/main/README.md |
Thanks @woctezuma . I suppose my question is whether, in the "without |
@jamesmyatt In the case where you don't use |
Thanks @MichaReiser . That makes sense. Is there a list of those? |
I don't think so. We should probably add one. We plan to have an entire category for formatting related lint rules which should make this easier in the future. For now, it's mainly the pycodestyle rules ( |
I'm finding the linter reports incorrect lines for issues when run before the formatter, which makes sense considering the formatter might break up a single line into multiple, changing the composition of the file. The incorrect lines adds extra effort when tracking down the reported issues to fix them. The line numbers are correct when the linter runs after the formatter. |
I have a question here. Why do we have two tools |
@AHJiapengZhang you can follow and upvote astral-sh/ruff#8232 for a unified command |
There are various ruff lint rules that are automatically fixed by ruff format, such as extra whitespace (W291) or semicolons (E703). Hence, is it better to recommend running the formatting hook before the linting hook, when using both?
The text was updated successfully, but these errors were encountered: