Prevent confusion with unintentional traling commas
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
There is the common programmer mistake to leave a trailing comma on a value, that leads that value unexpectedly treated as a tuple [1] [2]
PEP8 guide already warn on this
https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas
Yes:
FILES = ('setup.cfg',)
OK, but confusing:
FILES = 'setup.cfg',
What you think about to allow pycodestyle tool to produce a warning message in that case?
Pylint has that check since 1.7 version
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing pycodestyle's Python implementation and its existing warning checks, then compare the requested behavior with the PEP 8 trailing-comma guidance and Pylint's related check. Define the warning's scope and message for single values written with an unintended trailing comma, and verify that existing checks remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100