From 492fe3d6bc32ad14310e8168ea39b6f9c09eca16 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Thu, 17 Sep 2026 11:25:12 -0400 Subject: [PATCH 1/2] fix: Ignore self-closing HTML tags to avoid false positives from `/>` _AI-assisted: GPT-5.6 Luna via Copilot_ --- CHANGELOG.md | 2 ++ src/ccbr_tools/hooks/detect_absolute_paths.py | 1 + tests/test_hooks.py | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1bf38..2270122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## Tools development version - minor documentation improvements. (#197, #198, @kelly-sovacool) +- `ccbr-hooks detect-absolute-paths`: Ignore self-closing HTML tags to avoid + false positives from `/>`. ## Tools 0.7.0 diff --git a/src/ccbr_tools/hooks/detect_absolute_paths.py b/src/ccbr_tools/hooks/detect_absolute_paths.py index dd052e3..5c8ca37 100644 --- a/src/ccbr_tools/hooks/detect_absolute_paths.py +++ b/src/ccbr_tools/hooks/detect_absolute_paths.py @@ -59,6 +59,7 @@ def word_is_absolute_path(word): return word.startswith("/") and not any( [ word == "/", # FP from pathlib. abs-path:ignore + word == "/>", # FP from self-closing HTML tags. abs-path:ignore word.startswith("/dev/null"), word.startswith("/dev/shm"), word.startswith("//"), # FP from groovy comments. abs-path:ignore diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 00a08e6..7feea8a 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -45,6 +45,7 @@ def test_word_is_absolute_path(): assert not hooks.word_is_absolute_path("/dev/null") # common shell redirection assert not hooks.word_is_absolute_path("/dev/shm") # common shell redirection assert not hooks.word_is_absolute_path("/$") # nextflow script + assert not hooks.word_is_absolute_path("/>") # self-closing HTML tag def test_line_contains_absolute_path(): From 811697737ecdcb420ee1d87dea1740435c4c8e22 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Thu, 17 Sep 2026 11:28:34 -0400 Subject: [PATCH 2/2] docs: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2270122..32ed764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - minor documentation improvements. (#197, #198, @kelly-sovacool) - `ccbr-hooks detect-absolute-paths`: Ignore self-closing HTML tags to avoid - false positives from `/>`. + false positives from `/>`. (#228, @kelly-sovacool, @copilot) ## Tools 0.7.0