Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 `/>`. (#228, @kelly-sovacool, @copilot)

## Tools 0.7.0

Expand Down
1 change: 1 addition & 0 deletions src/ccbr_tools/hooks/detect_absolute_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Loading