Currently it is possible to write code like this:
some_list = [
1,
2,
3,
]
# Mind ^ the empty line before `]`
It shows that no violations are raised for this code (from our linter + dependencies).
We also have this code:
# Mind the empty line after the `[`
some_list = [
1,
2,
3,
]
It should not be allowed for consistency reasons. I assume that we should use tokenize to check that.
But, there are exceptions:
some_list = [
1,
2,
10,
11,
]
Note that a single empty line between elements is allowed (between 2, and 10,)
Parens to check: [, (, {, ], ), }
I can work on removing some empty lines. Is this across all documents or specific ones?
Hi, @lmonyelle! This is not about deleting empty lines. This is about creating a new linting rule to enforce python code consistency across our users' codebases.
@sobolevn I'd like to give it a try.
@QQ-88 you are welcome! Feel free to ask for help.
Had a look at the code @sobolevn, that's unfortunately above my skill level.
Ok, no problem!
I can give this one a try.