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
Working on a codebase where flake8-class-newline is enforced. To quote that module:
PEP8 says we should surround every class method with a single blank line. However flake8 is ambiguous about the first method having a blank line above it.
The ruff formatter currently removes leading spaces after a class definition if there is no docstring. Honestly, I've seen more Python classes without a leading space before the first method than ones with a leading space, so I don't think adding a space should necessary be the default, but it would be nice to have an option for having it (or ignoring it if it exists).
Working on a codebase where flake8-class-newline is enforced. To quote that module:
The ruff formatter currently removes leading spaces after a class definition if there is no docstring. Honestly, I've seen more Python classes without a leading space before the first method than ones with a leading space, so I don't think adding a space should necessary be the default, but it would be nice to have an option for having it (or ignoring it if it exists).
Class without newline (current ruff formatting)
Class with newline (flake8-class-newline expected formatting)
When a docstring is present, ruff currently adds a space between the docstring and first method, which passes the flake8-class-newline linter.
The text was updated successfully, but these errors were encountered: