Skip to content
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

Forbid TODOs in the codebase #1921

Merged
merged 4 commits into from
Oct 3, 2023
Merged

Conversation

pokey
Copy link
Member

@pokey pokey commented Oct 2, 2023

Here's a screenshot of a failed run:

image

Checklist

  • [-] I have added tests
  • [-] I have updated the docs and cheatsheet
  • [-] I have not broken the cheatsheet

Comment on lines +75 to +76
- name: Forbid TODOs
run: ./scripts/forbid-todo.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added to test workflow rather than pre-commit because if someone has our pre-commit hooks installed locally, we don't want to forbid them from commiting a TODO; we just want to ensure it doesn't get merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could still commit skipping the pre-commit hook? i.e. git commit --no-verify

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but I feel that fundamentally it's not a pre-commit requirement. It's a pre-merge requirement. Committing unfinished stuff is totally fine 🤷‍♂️

@@ -32,6 +32,7 @@ repos:
exclude_types: [svg]
exclude: patches/.*\.patch
- id: fix-byte-order-marker
- id: forbid-submodules
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this one while looking for a pre-commit hook; seemed worth having


# Find the string 'TODO' in all files tracked by git, excluding
# this file
TODOS_FOUND=$(git grep --color=always -nw TODO -- ':!scripts/forbid-todo.sh' || true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to just grep all files rather than try to find lint rules for different languages, to make sure we cover everything

@pokey pokey changed the title Forbit TODOs in the codebase Forbid TODOs in the codebase Oct 2, 2023
@pokey pokey enabled auto-merge October 3, 2023 10:02
@pokey pokey added this pull request to the merge queue Oct 3, 2023
Merged via the queue into main with commit 6230ecb Oct 3, 2023
@pokey pokey deleted the pokey/forbit-todos-in-the-codebase branch October 3, 2023 10:21
fidgetingbits pushed a commit to fidgetingbits/cursorless that referenced this pull request Nov 3, 2023
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.

Have lint rule that disallows TODO
3 participants