From 855ca2ded8da6baab7d4239fb45eae2189e12369 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 09:44:40 +0100 Subject: [PATCH 01/11] ci: check TODOs --- .github/workflows/check-todos.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/check-todos.yml diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml new file mode 100644 index 00000000..2820addc --- /dev/null +++ b/.github/workflows/check-todos.yml @@ -0,0 +1,22 @@ +name: "Check for TODOs" + +on: + pull_request: + +jobs: + check-todos: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Scan for TODO strings + run: | + + if git grep -E "TODO" -- .; then + echo "Error: Found TODOs in the codebase. Please resolve them or create issues." + exit 1 + else + echo "No TODOs found!" + exit 0 + fi From ef9d8218b579a18951baf469d85c2e652c5f4a51 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 09:53:17 +0100 Subject: [PATCH 02/11] make the action print the TODO lines --- .github/workflows/check-todos.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index 2820addc..60a2b048 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -12,11 +12,19 @@ jobs: - name: Scan for TODO strings run: | + echo "Scanning codebase for TODOs..." - if git grep -E "TODO" -- .; then - echo "Error: Found TODOs in the codebase. Please resolve them or create issues." + git grep -nE "TODO" -- . ':(exclude).github/workflows/*' > todos_found.txt || true + + # Check if the file is not empty + if [ -s todos_found.txt ]; then + echo "❌ ERROR: Found TODOs in the following files:" + echo "-------------------------------------------" + cat todos_found.txt + echo "-------------------------------------------" + echo "Please resolve these TODOs or track them in an issue before merging." exit 1 else - echo "No TODOs found!" + echo "✅ No TODOs found. Codebase is clean!" exit 0 fi From 0ad0a3c87224130fe749653a173ed3a90e94afe2 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 09:57:34 +0100 Subject: [PATCH 03/11] add TODO to make the testing fail --- src/torchjd/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/torchjd/__init__.py b/src/torchjd/__init__.py index a74b6c78..e46fe3fa 100644 --- a/src/torchjd/__init__.py +++ b/src/torchjd/__init__.py @@ -24,3 +24,6 @@ def __getattr__(name: str) -> Callable: ) return _deprecated_items[name][1] raise AttributeError(f"module {__name__} has no attribute {name}") + + +# TODO: Just a stupid todo to test ci From 24d56d6b8e9bdbc3d4b5a82a40810bd17e2ac13b Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:03:27 +0100 Subject: [PATCH 04/11] add message in the file changed tab of Github. --- .github/workflows/check-todos.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index 60a2b048..f76b0ff4 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -16,13 +16,17 @@ jobs: git grep -nE "TODO" -- . ':(exclude).github/workflows/*' > todos_found.txt || true - # Check if the file is not empty if [ -s todos_found.txt ]; then echo "❌ ERROR: Found TODOs in the following files:" echo "-------------------------------------------" cat todos_found.txt echo "-------------------------------------------" echo "Please resolve these TODOs or track them in an issue before merging." + + while IFS=: read -r file line content; do + echo "::error file=$file,line=$line::Found a TODO that must be resolved: $content" + done < todos.txt + exit 1 else echo "✅ No TODOs found. Codebase is clean!" From 129c54630e3933362ff29035711ce8b6820202f8 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:03:48 +0100 Subject: [PATCH 05/11] quick fix --- .github/workflows/check-todos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index f76b0ff4..54c8d845 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -25,7 +25,7 @@ jobs: while IFS=: read -r file line content; do echo "::error file=$file,line=$line::Found a TODO that must be resolved: $content" - done < todos.txt + done < todos_found.txt exit 1 else From 7569469d1115cda739b8a01b208ffa8c22c85142 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:07:29 +0100 Subject: [PATCH 06/11] improve message --- .github/workflows/check-todos.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index 54c8d845..1842e050 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -19,14 +19,14 @@ jobs: if [ -s todos_found.txt ]; then echo "❌ ERROR: Found TODOs in the following files:" echo "-------------------------------------------" - cat todos_found.txt - echo "-------------------------------------------" - echo "Please resolve these TODOs or track them in an issue before merging." while IFS=: read -r file line content; do - echo "::error file=$file,line=$line::Found a TODO that must be resolved: $content" + echo "::error file=$file,line=$line::TODO must be resolved:\n $content" done < todos_found.txt + echo "-------------------------------------------" + echo "Please resolve these TODOs or track them in an issue before merging." + exit 1 else echo "✅ No TODOs found. Codebase is clean!" From bfc0055566103f2c2c6d2b075d32da81218cb84a Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:09:33 +0100 Subject: [PATCH 07/11] fix line skip --- .github/workflows/check-todos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index 1842e050..d5a0077e 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -21,7 +21,7 @@ jobs: echo "-------------------------------------------" while IFS=: read -r file line content; do - echo "::error file=$file,line=$line::TODO must be resolved:\n $content" + echo "::error file=$file,line=$line::TODO must be resolved:%0A$content" done < todos_found.txt echo "-------------------------------------------" From 59ef6b8d09bbd630de93eb56794d659448095913 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:12:11 +0100 Subject: [PATCH 08/11] improve message --- .github/workflows/check-todos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index d5a0077e..e864e42c 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -21,7 +21,7 @@ jobs: echo "-------------------------------------------" while IFS=: read -r file line content; do - echo "::error file=$file,line=$line::TODO must be resolved:%0A$content" + echo "::error file=$file,line=$line::TODO must be resolved before merge" done < todos_found.txt echo "-------------------------------------------" From 760fe9ef9c86fd0b2e2b7755155e7eba64047668 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 15 Jan 2026 10:13:25 +0100 Subject: [PATCH 09/11] improve message --- .github/workflows/check-todos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index e864e42c..ae35ea6f 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -21,7 +21,7 @@ jobs: echo "-------------------------------------------" while IFS=: read -r file line content; do - echo "::error file=$file,line=$line::TODO must be resolved before merge" + echo "::error file=$file,line=$line::TODO must be resolved before merge:%0A$content" done < todos_found.txt echo "-------------------------------------------" From a38eab720f0a274c87577de929225e90a9f6d44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Thu, 15 Jan 2026 16:14:40 +0100 Subject: [PATCH 10/11] Add file and line number in error message --- .github/workflows/check-todos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-todos.yml b/.github/workflows/check-todos.yml index ae35ea6f..9916f0b7 100644 --- a/.github/workflows/check-todos.yml +++ b/.github/workflows/check-todos.yml @@ -21,7 +21,7 @@ jobs: echo "-------------------------------------------" while IFS=: read -r file line content; do - echo "::error file=$file,line=$line::TODO must be resolved before merge:%0A$content" + echo "::error file=$file,line=$line::TODO found at $file:$line - must be resolved before merge:%0A$content" done < todos_found.txt echo "-------------------------------------------" From 49fef96a24fb64c4719211fc67f7dd5e5e8932be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= <31951177+ValerianRey@users.noreply.github.com> Date: Thu, 15 Jan 2026 16:21:45 +0100 Subject: [PATCH 11/11] Remove todo --- src/torchjd/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/torchjd/__init__.py b/src/torchjd/__init__.py index e46fe3fa..a74b6c78 100644 --- a/src/torchjd/__init__.py +++ b/src/torchjd/__init__.py @@ -24,6 +24,3 @@ def __getattr__(name: str) -> Callable: ) return _deprecated_items[name][1] raise AttributeError(f"module {__name__} has no attribute {name}") - - -# TODO: Just a stupid todo to test ci