-
Notifications
You must be signed in to change notification settings - Fork 293
All TODOs in Python code should have a username #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the configuration to enable flake8-todos support and revises TODO comments in the Python code to include a username.
- Adds flake8-todos ("TD") to the lint.select list in pyproject.toml.
- Introduces a new ignore rule ("TD003") in pyproject.toml and updates inline TODO comments in cpplint_clitest.py and cpplint.py to include a username placeholder.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pyproject.toml | Enables flake8-todos and adjusts ignore settings for todo-checking. |
cpplint_clitest.py | Updates a TODO comment to include a username placeholder. |
cpplint.py | Updates multiple TODO comments to include a username placeholder. |
Comments suppressed due to low confidence (4)
cpplint_clitest.py:66
- Replace 'unknown' with a valid username to meet the requirement that all TODO comments include the responsible individual's username.
# TODO(unknown): Support scenario with multiple input names
cpplint.py:4248
- Replace 'unknown' with a valid username in the TODO comment so that code ownership is clear.
# TODO(unknown): support alternate operators
cpplint.py:4770
- Replace 'unknown' with a valid username to properly attribute the TODO comment.
# TODO(unknown): Err on if...else and do...while statements without braces;
cpplint.py:7460
- Replace 'unknown' with a valid username to comply with the convention for TODO comments.
# TODO(unknown): Maybe make this have an exit code of 2 after all is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of making these changes if they just going to silence/workaround it by making it all unknown
? How does this provide a point of reference for the best context? To do this, we should correctly blame all the TODOs. (BTW, since we check all the flake8 rules we check with ruff too, I think we can go ahead with removing flake8 from pre-commit.)
(psssst: I hate to sound like a broken record, but I'd really appreciate a review for #353.)
Also, what do you think of enabling CodeRabbit? It's like the Copilot review you just requested and free for public repos, plus it replies to and learns from the replies you give its suggestions. |
Never heard of CodeRabbit but will take a look. |
This is a rule that both cpplint and ruff have this rule for good reasons. I believe that we should implement it for future TODOs. I cannot properly assign old TODOs (without a lot of git blame) but adding this rule now will help us (in the code review process) ensure that new TODOs have assignees. |
I don't see how the original commit would've incentivized that instead of just making TODOs say "TODO(unknown)" instead. Anyways, this issue is moot now as I've just taken a few minutes to blame the TODOs; it's much easier if you use the blame feature in an IDE instead of manually running git commands. |
%
ruff rule TD002
# https://docs.astral.sh/ruff/rules/missing-todo-author