E131: Inconsistent handling of kwarg with binary operator expression as value
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
I think pycodestyle's handling of binary operator expressions that are the values of kwargs could be improved.
There is a case that is a little ambiguous to me as to whether it should be a style error or not. Should calls where the binary operator subexpressions are aligned with the = of the kwarg be errors? Currently, this triggers E131.
call(
kwarg=a +
b +
c
)
On the other side, dropping the lines indentation to the same as the kwarg is considered valid, which seems to me to go against the spirit of the pep8 guidelines.
call(
kwarg=a +
b +
c
)
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 reproducing the two keyword-argument examples in pycodestyle and trace the E131 handling that classifies their indentation. The issue does not specify which behavior should change, so confirm the intended rule and define tests for the accepted and rejected forms before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100