I often add a quick TODO in my code when I'm designing a feature or I'm in a rush. You know those:
``` # TODO: make this hard-coded value a setting
```
I really, honestly, think it's bad. If it's something to do, it's an issue to open. I spend some time when cleaning a PR on the TODOs I added, either resolve them or open an issue, and I never merge something from another dev that contains a "dangling" TODO (not linked to an issue).
Proposed design:
TODOs
in the code ( # TODO:.*$
in sh/python..., // TODO:.*$
, /\*\s*TODO:.*$
, whatever, depending on the language.) Sane default should be defined in project templates.(issue #1234)
somewhere in the todo line (Just after TODO:
or at the end of line). This is no more a dangling TODO.The ugly part is that the code is modified, and therefore a new commit is added every time an action is taken. The todo list page should add an option to squash those commits into a single one, and there could even be an option to inhibit hooks for single todo-action commits. The final squashing commit should trigger the hooks, though (we need the CI to run on the merged code).
Any thoughts?
there's a tool called snitch
but I'm not sure if they support gitea:
Honestly this sounds like something that your CI should be doing.
You could get your CI to make comments which contain links that would create an issue, eg. a link to https://try.gitea.io/arandomer/pathological/issues/new?body=wibble+wibble&title=todo
In terms of resolve - we'd need suggestion/patch support but once that's in (I have a work in progress patch that I need to get back to) - it could easily write something like:
<details>
<summary>Remove this TODO</summary>
```patch
diff --git a/path/to-file b/path/to-file
@@ linenum,1 linenum, 0 @@
- // TODO: remove this TODO
```
</details
We should probably extend CI status to be able to provide warning rather than simply deny but - if you're a repo admin you can always merge against CI checks.
I think this is a good idea. We can add a sub tab in codes named TODO, and it will display all the todo list. The todo list will be updated once you push commit to this branch.
There is a button to jump to the line of the todo comment on the codes on current branch.
It's similiar as the feature of IDE.
The fully integrated solution would be awesome, but, thanks to @6543 I discovered snitch, that may do the trick for me (if I manage to add it seamlessly enough in my workflow).
Most helpful comment
there's a tool called snitch
but I'm not sure if they support gitea: