The core command here is:
grep -nr -e '@urgent' -e '@todo' -e '@fixme' resources app
-e Designates a pattern to find
-n Shows the line number
-r Recursively through directories
List as many directories in sequence to iterate through
I've added it to composer as a script called "debt":
"debt": [
"grep -nr -e '@urgent' -e '@todo' -e '@fixme' resources app"
],
Then you can run something like:
composer debt
app/Utility/Film.php:39: * @todo Swap out with a regex
app/Utility/Media.php:161: * @todo we have to make sure we kill the webp as well
app/Utility/Media.php:189: * @todo move this to a utility class like we did for Utility/Media
app/Utility/Media.php:592: // @flag @urgent the `getCommonColors` function is slow
You could also use it in package.json
like:
"scripts": {
"debt": "grep -nr -e '@urgent' -e '@todo' -e '@fixme' resources app"
}
...
npm run debt
Top comments (0)