Skip to main content

This is an obsolete fork of PyCQA/flake8-commas which added support for Python 3.12, match statement, and other features. Support for Python version below 3.8 was dropped, as well as older (5.x) versions of flake8.

This fork is deprecated – use flake8-commas instead.

Build Status PyPI - Version No Maintenance Intended

Migration back to flake8-commas

All users should migrate back to flake8-commas.

As both packages unfortunately install the same module, removal of this package is required before installing that one:

pip uninstall flake8-commas-x
pip install flake8-commas

Usage

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

pip install flake8-commas-x

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

Examples

lookup_table = {
    'key1': 'value',
    'key2': 'something'  # <-- missing a trailing comma
}

json_data = json.dumps({
    "key": "value",
}),                      # <-- incorrect trailing comma. json_data is now a tuple. Likely by accident.

3.0.0 (2024-03-12)

  • Project renamed to flake8-commas-x to continue maintenance.

  • Support dropped for Python <3.8.

  • Support added for Python 3.12.

  • Drop explicit noqa handling; this is handled by flake8 now.

  • Remove use of pkg_resources in favour of importlib.

  • CI moved to GitHub Actions.

2.1.0 (2021-10-13)

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

Release files for flake8-commas-x 3.0.0.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-commas-x 3.0.0.post2
File Size Uploaded
flake8_commas_x-3.0.0.post2.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-commas-x 3.0.0.post2
File Interpreter ABI Platform
flake8_commas_x-3.0.0.post2-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / flake8_commas_x-3.0.0.post2.tar.gz

Download URL flake8_commas_x-3.0.0.post2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d6dfa2d51b4427e9b51bca4d3a08faffbe8b9dffb68c8c29cbc2a1f81c49f538
BLAKE2b-256 checksum
How to use checksums
ef47dacce8dbbe29e51a508b6a32f6d944343224cb485211724d05e21c926458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / flake8_commas_x-3.0.0.post2-py3-none-any.whl

Download URL flake8_commas_x-3.0.0.post2-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf070561e2af88a4dab866873301596d2df75297fcec7f0615b863b90158e832
BLAKE2b-256 checksum
How to use checksums
e6999cd2af503e8c0bb94bf4af7bb5119988086d6e54f010c316d4d95b64c1e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page