add-trailing-comma is a Python utility that automatically adds trailing commas to function calls and literal structures (like lists, tuples, dictionaries, sets) to improve diff clarity and make future additions easier. It is currently at version 4.0.0 and is actively maintained, with releases often tied to Python version updates.
pip install add-trailing-commaVerified import paths — ran on the pinned version, not inferred.
First, create a Python file with some function calls or literals. Then, run `add-trailing-comma` on that file from your terminal. The tool will modify the file in-place, adding trailing commas where applicable.
Ensure you are running `add-trailing-comma` within a Python 3.10+ environment. If you need to use an older Python environment, you must install an older version of `add-trailing-comma` (e.g., `<4.0.0`).
Remove these flags from your command-line invocations or pre-commit configurations. The tool will now handle the appropriate Python version inference.
Always commit your code before running `add-trailing-comma` or ensure you have a robust backup strategy. Integrate it as part of a pre-commit hook for automated version control management.
Configure your pre-commit hooks or formatting scripts to execute `add-trailing-comma` before other formatters that might conflict with trailing comma placement.
No dependency data recorded yet.