Flake8 plugin that checks against poor spacing around the equals sign in function arguments.
Project description
flake8-arg-spacing
When applying the standard formatting rules of Python, it's easy to end up with code like below, where spacing obscures the actual operator precedence:
foo(bar=a + b)
# or
Order.objects.filter(timestamp__gt=timezone.now() - timedelta(minutes=30))
This plugin reports such patterns in function calls and definitions. You may want to:
- remove spaces around the binary operator:
foo(bar=a+b)
- add parentheses around the expression:
foo(bar=(a + b))
- create a separate variable for the expression:
c = a + b
foo(bar=c)
- or add spaces around the equals sign:
foo(bar = a + b) # incompatible with PEP 8
Included rules
ARG101- confusing spacing around keyword argumentARG102- confusing spacing around parameter default
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_arg_spacing-1.0.0.tar.gz.
File metadata
- Download URL: flake8_arg_spacing-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c28a5b4280830f8cac0acc433969ef2bf5b1facf1147a6484d0c620fbe8ffe1e
|
|
| MD5 |
47b074ab61a0a64c98e5d2d6b194ff78
|
|
| BLAKE2b-256 |
54c53006f495e384fd24487ea5929e885dd28b237768cd610ebe18f83cc6bb0e
|
File details
Details for the file flake8_arg_spacing-1.0.0-py3-none-any.whl.
File metadata
- Download URL: flake8_arg_spacing-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
079d95166c88bd409d31d19bc92d1a7bc08bfedce42cd183b4cb28a40ef3cde7
|
|
| MD5 |
ed376c5e205d384fb3eefa190e8202ac
|
|
| BLAKE2b-256 |
56cafe7c77f6410dd49fc4fe9107d71b698f0df50ffc114bd570c1c674c56165
|