--- id: flake8-commas version: "4.0.0" license: unclear license_treatment: permissive maintenance: aging --- # flake8-commas — Flake8 lint for trailing commas. License: permissive · Maintenance: aging · Downloads: 310.4K/mo ## What it is and what it does flake8-commas is a linter plugin that checks trailing comma placement in Python code. It integrates directly into flake8 and runs as part of your normal linting workflow, reporting errors (C812–C819) when commas are missing or incorrectly placed in multi-line structures. The plugin is designed to enforce consistent comma style across dictionaries, lists, function arguments, and tuples, which reduces merge conflicts when multiple developers edit the same data structures. The plugin supports multiple Python versions with version-specific rules: different comma requirements apply to Python 2, Python 3, Python 3.5+, and Python 3.6+. It handles edge cases like bare tuples, lambda parameters, subscripts with slices, and function definitions with unpacking. The package is permissive (MIT license) and has low installation friction—it's a pure Python wheel with only flake8 as a dependency. Use it for: - Enforce trailing commas in team codebases to reduce merge conflicts when multiple developers modify adjacent lines in lists or dicts. - Catch accidental trailing commas that turn expressions into tuples (e.g., json_data = json.dumps({...}), becomes a tuple instead of the result). - Lint Python 3.5+ and 3.6+ codebases with version-specific comma rules by configuring which error codes to enforce. - Integrate comma style checking into CI/CD pipelines as part of flake8 without adding a separate tool. - Prevent bare tuple syntax errors and lambda parameter comma mistakes during code review. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 plugin that enforces trailing comma placement in Python code to reduce merge conflicts in multi-line dictionaries, lists, and function calls. Yes, if you use flake8 and want to enforce trailing comma consistency to reduce merge conflicts. The plugin is lightweight, permissive, and integrates seamlessly. However, note that maintenance is aging (last release 820 days ago); if you need active support or compatibility with very recent Python/flake8 versions, consider black or add-trailing-comma as alternatives. ## Install pip install flake8-commas uv add flake8-commas poetry add flake8-commas ## Installing flake8-commas Before you install: Low friction: pure Python wheel with only flake8 as a runtime dependency. Maintenance status is aging—last release was 820 days ago—but the repository remains active and the project was recently revived after a naming transition in version 4.0.0 (2024-05-16). License in practice: Permissive license (MIT) means you can use this freely in commercial and private projects without restriction or attribution requirement. Quickstart: pip install flake8-commas # Then run flake8 normally; the plugin activates automatically flake8 your_file.py # Errors like C812 (missing trailing comma) will appear in output Requires flake8 to be installed and Python 3.8 or later. Verify before relying: - Whether the aging maintenance status (820 days since last release) affects compatibility with very recent Python or flake8 versions. - How this plugin's comma rules interact with or differ from black or add-trailing-comma when used together. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 310.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flake8 trailing comma enforcement, python comma linting, merge conflict prevention code style, flake8 extension comma rules, trailing comma checker, python dictionary list formatting, code style comma placement, linting, code-style, merge-conflict-prevention [View on SkillFed](https://skillfed.io/packages/flake8-commas) · [View on PyPI](https://pypi.org/project/flake8-commas/)