if clause doesn't accept parenthesis-less visual indent while if statement accepts
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
#151 permits parenthesis-less visual indent for if statement:
# ok
if x.a == a and \
x.b == b:
...
But not for if clause:
# ng
z = [a for a in aaa
if a.a == a and
a.b == b]
z = [a for a in aaa if a.a == a and
a.b == b]
It seems lack of unity.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the handling for parenthesis-less visual indentation in pycodestyle, then compare how ordinary if statements and comprehension if clauses are checked. Use the two failing list-comprehension examples alongside the accepted if-statement example; done means the cases behave consistently and regression coverage is added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100