Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 2 commits into from
Mar 31, 2025

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Mar 30, 2025

@cclauss cclauss changed the title All TODOs should have a username All TODOs in Python code should have a username Mar 30, 2025
@cclauss cclauss requested review from Copilot and aaronliu0130 March 30, 2025 14:39
Copy link

@Copilot Copilot AI left a 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

Copy link
Member

@aaronliu0130 aaronliu0130 left a 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.)

@aaronliu0130
Copy link
Member

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.

@cclauss
Copy link
Member Author

cclauss commented Mar 31, 2025

Never heard of CodeRabbit but will take a look.

@cclauss
Copy link
Member Author

cclauss commented Mar 31, 2025

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.

@aaronliu0130
Copy link
Member

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.

@aaronliu0130 aaronliu0130 merged commit 47f6675 into develop Mar 31, 2025
11 checks passed
@cclauss cclauss deleted the put-a-username-on-todos branch April 1, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants