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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixed
fix explains the E501 the formatter cannot resolve. A line still
too long after ruff format is one the formatter has nowhere to break
— a dotted name (it never splits one, and drops parentheses that do not
make the line fit), a string literal, a comment — but the bare Line too long (94 > 79) read as if line-length were being ignored. fix now reads ruff's JSON report of the leftovers and names each such
line with the overflowing token, its kind and the action that does
resolve it, then splits the residual violations into those with no
autofix and those fix --unsafe would fix. The exit code is unchanged:
CI still fails on them. Closes #3.
fix shortens the long comments and strings the formatter leaves
alone. After ruff format, each E501 that is a comment is wrapped at
the limit (a trailing one moves above its line) and each that is a
plain string literal is split at its spaces into implicitly
concatenated parts inside parentheses; the touched files are formatted
again. Every edit is kept only when the file's AST is identical before
and after, so the program cannot change. Tool pragmas (noqa, type: ignore, fmt:, …), f-strings, triple-quoted strings and words
longer than a line are left alone and explained instead. On by
default: neither rewrite changes behavior.
fix reports on the formatted file. The passes are now ruff check --fix-only, ruff format, then ruff check; before, the
report and the exit code came from the lint pass that ran before the
formatter, so a violation the formatter went on to resolve still showed
up and still failed the command.