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,5 +1,7 @@
## Tools development version

- `ccbr-hooks detect-absolute-paths`: Reduce false positives caused by `/dev/null`. (#174, @kelly-sovacool)

## Tools 0.5.2

- `ccbr-hooks detect-absolute-paths`: Reduce false positives caused by `/dev/shm` and language comments. (#157, @kelly-sovacool)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ guidelines](https://CCBR.github.io/Tools/CONTRIBUTING).
Please cite this software if you use it in a publication:

> Sovacool K., Koparde V., Kuhn S., Tandon M., and Huse S. (2026). CCBR
> Tools: Utilities for CCBR Bioinformatics Software (version v0.5.1).
> Tools: Utilities for CCBR Bioinformatics Software (version v0.5.2).
> DOI: 10.5281/zenodo.13377166 URL: https://ccbr.github.io/Tools/

### Bibtex entry
Expand Down
4 changes: 2 additions & 2 deletions src/ccbr_tools/hooks/detect_absolute_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def word_is_absolute_path(word):

return word.startswith("/") and not any(
[
word == "/dev/null",
word.startswith("/dev/shm"),
word == "/", # FP from pathlib. abs-path:ignore
word.startswith("/dev/null"),
word.startswith("/dev/shm"),
word.startswith("//"), # FP from groovy comments. abs-path:ignore
word.startswith("/*"), # FP from CSS & groovy comments. abs-path:ignore
word.startswith("/$"), # FP from nextflow scripts. abs-path:ignore
Expand Down
2 changes: 2 additions & 0 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def test_word_is_absolute_path():
assert not hooks.word_is_absolute_path("//") # groovy comments
assert not hooks.word_is_absolute_path("/*") # groovy multiline comments
assert not hooks.word_is_absolute_path("/*--") # CSS comments
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


Expand Down
Loading