Feature request: optionally throw error on unused tags
jonascarpay opened this issue · 1 comments
In my workflow, an unused tag is almost always a sign of a vestigial piece of code/documentation, like for a hack that is no longer necessary. I usually end up including something to this effect in my CI:
unused_tags=$(tagref list-unused)
if [[ "$unused_tags" ]]; then
echo "$unused_tags"
exit 1
fi
I'd love to be able to replace this with something like tagref list-unused --error
, which would have the same behavior, but exits with a non-zero code if the list is non-empty.
A more advanced implementation might e.g. have some degree of support for ignoring/only considering tags that fit some (user-defined?) pattern, but I think this simplest implementation would fit most use cases and is still in the minimalist nature of tagref.
Like #161, I'd love to take a stab at this myself at some point, but it would have to wait until I have time to dive into Rust.
I like this idea! The flag would only take a few lines of code to implement, so I think it could be a great opportunity to get into Rust if you want to try implementing it.