Skip to main content

Flake8 plugin that checks against poor spacing around the equals sign in function arguments.

Project description

flake8-arg-spacing

pypi

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 argument
  • ARG102 - confusing spacing around parameter default

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_arg_spacing-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_arg_spacing-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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

Hashes for flake8_arg_spacing-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c28a5b4280830f8cac0acc433969ef2bf5b1facf1147a6484d0c620fbe8ffe1e
MD5 47b074ab61a0a64c98e5d2d6b194ff78
BLAKE2b-256 54c53006f495e384fd24487ea5929e885dd28b237768cd610ebe18f83cc6bb0e

See more details on using hashes here.

File details

Details for the file flake8_arg_spacing-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_arg_spacing-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 079d95166c88bd409d31d19bc92d1a7bc08bfedce42cd183b4cb28a40ef3cde7
MD5 ed376c5e205d384fb3eefa190e8202ac
BLAKE2b-256 56cafe7c77f6410dd49fc4fe9107d71b698f0df50ffc114bd570c1c674c56165

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page