W504: Relax when operator is only thing on a line
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
The python formatter black will occasionally decide to put a binary operator by itself on a line (example). This triggers the newly-added W504 warning. I believe that W504 (and W503, but that warning is already incompatible with black) should be relaxed to permit a newline after binary operators if that operator is the only thing on the line.
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
Review the W504 warning behavior against the linked Tornado example, where a binary operator appears alone on a line, and compare the stated relationship with W503. Done means W504 permits this specific layout without broadly suppressing other W504 warnings.
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
- 35/100