Skip to content

Commit

Permalink
Track todos
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbay-bluetiger committed Jan 22, 2025
1 parent e773c2e commit f2ab805
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services/uploads/local_buckets
tests_output
*.log
!launchdarkly-flags.log
!todos.log
tests/cypress/videos
tests/cypress/screenshots
tests/cypress/downloads
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ repos:
entry: yarn track-flags
language: system
files: '\.jsx?$'
- id: track-todos
name: track-todos
entry: yarn track-todos
language: system
exclude: 'logs/.*'
2 changes: 1 addition & 1 deletion launchdarkly-flags.log → logs/launchdarkly-flags.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
./services/ui-src/src/components/layout/FormTemplates.jsx:28:useFlags().release2024;

# LaunchDarkly flags in tests
# None used
# N/A
15 changes: 15 additions & 0 deletions logs/todos.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

./README.md:142:TODO: writeup the CI/CD flow for the application
./README.md:204:TODO: Get an updated diagram
./.git/hooks/sendemail-validate.sample:27: TODO: Replace with appropriate checks (e.g. spell checking).
./.git/hooks/sendemail-validate.sample:35: TODO: Replace with appropriate checks for this patch
./.git/hooks/sendemail-validate.sample:41: TODO: Replace with appropriate checks for the whole series
./services/ui-auth/handlers/createUsers.js:1: TODO logging solution for backend services
./services/ui-src/serverless.yml:62: TODO: [MDCT-300] handle react hooks warnings then remove CI=false
./services/ui-src/src/util/synthesize.test.js:1: TODO: Fix this testing suite, it is outdated
./services/ui-src/src/components/layout/UploadComponent.jsx:132: TODO: when one file errors, the others are loaded but the error stays
./services/ui-src/src/components/layout/UploadComponent.test.jsx:11: TODO remove direct dependency on @testing-library/dom ?
./services/ui-src/src/components/fields/NoninteractiveTable.jsx:49: TODO Remove this custom logic when rewriting backend
./services/ui-src/src/store/lastYearFormData.js:146: TODO: account for objectives/repeatables here.
./services/ui-src/src/store/formData.js:242: TODO: account for objectives/repeatables here.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"scripts": {
"test": "cd tests/cypress && npm test && cd -",
"test:ci": "cd tests/cypress && yarn run test:ci",
"track-flags": "./scripts/track-flags.sh"
"track-flags": "./scripts/track-flags.sh",
"track-todos": "./scripts/track-todos.sh"
},
"repository": {
"type": "git",
Expand Down
12 changes: 8 additions & 4 deletions scripts/track-flags.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
LD_LOG_FILE=launchdarkly-flags.log
LD_LOG_FILE=logs/launchdarkly-flags.log
GREP_FLAGS="-r -n -o -w"
EXCLUSIONS="--exclude-dir=.build --exclude-dir=coverage --exclude-dir=node_modules --exclude-dir=uploads"

echo "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n" > $LD_LOG_FILE
GREP_FLAGS="-r -n -o -w --exclude-dir=coverage --exclude-dir=node_modules --exclude-dir='.*'"

echo "# LaunchDarkly flags in components" >> $LD_LOG_FILE
(grep $GREP_FLAGS "useFlags().*" ./services --include=*.jsx --exclude=*.test.jsx || echo "# None used") >> $LD_LOG_FILE
(grep $GREP_FLAGS $EXCLUSIONS "useFlags().*" ./services --include=*.jsx --exclude=*.test.jsx || echo "# N/A") >> $LD_LOG_FILE
echo "" >> $LD_LOG_FILE

echo "# LaunchDarkly flags in tests" >> $LD_LOG_FILE
(grep $GREP_FLAGS "mockLDFlags.set.*" ./services --include=*.test.jsx || echo "# None used") >> $LD_LOG_FILE
(grep $GREP_FLAGS $EXCLUSIONS "mockLDFlags.set.*" ./services --include=*.test.jsx || echo "# N/A") >> $LD_LOG_FILE
7 changes: 7 additions & 0 deletions scripts/track-todos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LD_LOG_FILE=logs/todos.log
GREP_FLAGS="-r -i -n -o -w -E -I"
EXCLUSIONS="--exclude-dir=.build --exclude-dir=coverage --exclude-dir=node_modules --exclude-dir=uploads --exclude=track-todos.sh"

echo "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n" > $LD_LOG_FILE

(grep $GREP_FLAGS $EXCLUSIONS "TODO:.*| TODO.*|@TODO.*" . || echo "# All clear!") >> $LD_LOG_FILE

0 comments on commit f2ab805

Please sign in to comment.