Skip to main content

Flake8 lint for trailing commas.

Project description

Usage

If you are using flake8 it’s as easy as:

pip install flake8-commas

Now you can avoid those annoying merge conflicts on dictionary and list diffs.

Errors

Different versions of python require commas in different places. Ignore the errors for languages you don’t use in your flake8 config:

Code

message

C812

missing trailing comma

C813

missing trailing comma in Python 3

C814

missing trailing comma in Python 2

C815

missing trailing comma in Python 3.5+

C816

missing trailing comma in Python 3.6+

C818

trailing comma on bare tuple prohibited

C819

trailing comma prohibited

2.0.0 (2018-03-19)

1.0.0 (2018-01-04)

  • No changes from 0.5.1, just releasing the first major version.

0.5.1 (2018-01-02)

  • Refactor single/multi tuple/subscript to simply count commas in all cases.

  • Prohibit trailing commas in lambda parameter lists.

  • Fix a missing trailing comma false positive in subcripts with slices.

  • Fix a prohibited trailing comma false positve in subscripts with slices.

  • All (Issue #48)

0.5.0 (2018-01-02)

  • Remove EOL Python 3.3. (Issue #47)

  • Prohibit trailing commas where there is no following new line (or forming a single element tuple). (Issue #46)

0.4.3 (2017-04-25)

  • Enforce trailing commas in subscript tuples and slices again. Regression from 0.4.2 (Issue #42)

0.4.2 (2017-04-18)

  • Prevent lambda params in a parenth form enforcing a trailing comma. (Issue #41)

  • Fix issue preventing execution on Python 2 with Flake8 3. (Issue #35)

  • Allow bare wrapped subscript notation access. (Issue #39)

  • Don’t require comma in assert statement with parenth form. (Issue #37)

0.4.1 (2017-01-18)

  • Add the framework flake8 trove classifier.

0.4.0 (2017-01-18)

  • Support flake8 3.x.x. (Issue #20)

  • No trailing comma after any function def with unpack.

  • support Python 3.6 issue9232 trailing commas. (Issue #33)

0.3.1 (2017-01-18)

  • Also parse unpacks with literals. (Issue #30)

0.3.0 (2017-01-16)

  • If there is a comment after the last item, do not report an error. (Issue #18)

  • If there is an empty, tuple, list, dict, or function, do not report an error. (Issue #17)

  • Support PEP 3132 Python 3.5+ extended unpacking. (Issue #26)

  • *args should not require a trailing comma. (Issue #27)

0.2.0 (2017-01-13)

  • First version of flake8-commas with changelog

  • Fix HTML readme render on PyPI.

  • Support various parenth_form edge cases.

  • Merge from flake8-trailing-commas

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-commas-2.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

flake8_commas-2.0.0-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flake8-commas-2.0.0.tar.gz.

File metadata

  • Download URL: flake8-commas-2.0.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flake8-commas-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d3005899466f51380387df7151fb59afec666a0f4f4a2c6a8995b975de0f44b7
MD5 83a98e93bbb1b593dc0c7c592dbc2570
BLAKE2b-256 856ba64cb3469543ec48f55287c4736c5430801e49ca4810c3e2124755bd9e5c

See more details on using hashes here.

File details

Details for the file flake8_commas-2.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_commas-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ee2141a3495ef9789a3894ed8802d03eff1eaaf98ce6d8653a7c573ef101935e
MD5 36dec5590aeaf5631f133111f7908780
BLAKE2b-256 ab1fb1a3b8068bc0d3254a0c2d34e0409c380eb3449cc5582725403b30ef1de8

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