From f2ab805ebd2c00933fe7fa6e36336f7e718c0cd2 Mon Sep 17 00:00:00 2001 From: Bangbay Siboliban Date: Tue, 21 Jan 2025 20:43:22 -0800 Subject: [PATCH] Track todos --- .gitignore | 1 + .pre-commit-config.yaml | 5 +++++ .../launchdarkly-flags.log | 2 +- logs/todos.log | 15 +++++++++++++++ package.json | 3 ++- scripts/track-flags.sh | 12 ++++++++---- scripts/track-todos.sh | 7 +++++++ 7 files changed, 39 insertions(+), 6 deletions(-) rename launchdarkly-flags.log => logs/launchdarkly-flags.log (97%) create mode 100644 logs/todos.log create mode 100755 scripts/track-todos.sh diff --git a/.gitignore b/.gitignore index 300c37e8..4c03743f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7a370a0..f0450988 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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/.*' diff --git a/launchdarkly-flags.log b/logs/launchdarkly-flags.log similarity index 97% rename from launchdarkly-flags.log rename to logs/launchdarkly-flags.log index 69956f6c..3ffff6b5 100644 --- a/launchdarkly-flags.log +++ b/logs/launchdarkly-flags.log @@ -7,4 +7,4 @@ ./services/ui-src/src/components/layout/FormTemplates.jsx:28:useFlags().release2024; # LaunchDarkly flags in tests -# None used +# N/A diff --git a/logs/todos.log b/logs/todos.log new file mode 100644 index 00000000..71183bcb --- /dev/null +++ b/logs/todos.log @@ -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. diff --git a/package.json b/package.json index 8a6825b6..8a105062 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/track-flags.sh b/scripts/track-flags.sh index 332db449..0f0977ce 100755 --- a/scripts/track-flags.sh +++ b/scripts/track-flags.sh @@ -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 diff --git a/scripts/track-todos.sh b/scripts/track-todos.sh new file mode 100755 index 00000000..124a315f --- /dev/null +++ b/scripts/track-todos.sh @@ -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