Svelvet
Svelvet copied to clipboard
E701, E302: allowing one-liners for classes
PEP8 allows you to type a bunch of dummy one-liners like this:
class CustomException(Exception): pass
class AnotherException(Exception): pass
class YetAnotherException(Exception): pass
But this code raises E701 (compound statement) and E302 (two lines between classes) errors. I propose to leave compound statements intact if they are a bunch of class/def definitions. This is what I've done in this pull request of autopep8 project: https://github.com/hhatto/autopep8/pull/87, but it wasn't merged since pep8 seems to be a better place for that.
This is not easy to implement since the current framework doesn't allow you to look at the next logical line. This is necessary because you need to look at previous and next line to determine if a definition is alone or inside a bunch of definitions.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
svelvet | ✅ Ready (Inspect) | Visit Preview | Feb 18, 2023 at 3:24PM (UTC) |