{"repo":"asottile/add-trailing-comma","free":true,"listed":false,"github":"https://github.com/asottile/add-trailing-comma","clone":"git clone https://github.com/asottile/add-trailing-comma.git","description":"A tool (and pre-commit hook) to automatically add trailing commas to calls and literals.","language":"Python","stars":373,"topics":["python","pre-commit","linter"],"license":"MIT","category":"dev-tools","readme_excerpt":"add-trailing-comma ================== A tool (and pre-commit hook) to automatically add trailing commas to calls and literals. Installation As a pre-commit hook See pre-commit for instructions Sample .pre-commit-config.yaml : multi-line method invocation style -- why? - the initial paren is at the end of the line - each argument is indented one level further than the function name - the last parameter (unless the call contains an unpacking ( args / kwargs )) has a trailing comma This has the following benefits: - arbitrary indentation is avoided: - adding / removing a parameter preserves git blame and is a minimal diff: Implemented features trailing commas for function calls trailing commas for tuple / list / dict / set literals trailing commas for function definitions trailing commas for from imports trailing comma for class definitions trailing comma for with statement trailing comma for match statement trailling comma for PEP-695 type aliases unhug trailing paren unhug leading paren match closing brace indentation remove unnecessary commas yes yes, I realize the tool is called add-trailing-comma :laughing:","default_branch":null,"files":null,"tree":[],"storefront":"/r/asottile","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/asottile/add-trailing-comma/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}