Skip to content

Extract running the reuse code into a reusable pre-commit hook#91

Draft
lurtz wants to merge 13 commits intoeclipse-score:mainfrom
elektrobit-contrib:copyright-reuse-hook
Draft

Extract running the reuse code into a reusable pre-commit hook#91
lurtz wants to merge 13 commits intoeclipse-score:mainfrom
elektrobit-contrib:copyright-reuse-hook

Conversation

@lurtz
Copy link
Contributor

@lurtz lurtz commented Feb 16, 2026

Other repos might want to run copyright checks using pre-commit hooks as well. This way configuration, code and templates can be centralized.

# shellcheck disable=SC2086
# Expansion of ${files_to_annotate} is intentional to pass the list of files as separate arguments to the reuse annotate command.
pipx run reuse annotate --template apache-2.0 --merge-copyrights --recursive --skip-unrecognised \
"${PIPX_BIN_DIR}/pipx" run reuse annotate --template apache-2.0 --merge-copyrights --recursive --skip-unrecognised \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this requires the presence of pipx in the running environment. Thus either pre-commit actions need to be run within the devcontainer or this script might install it, if missing

@lurtz
Copy link
Contributor Author

lurtz commented Feb 17, 2026

IMHO running reuse annotate will become a pain in the ass as soon as the year in the template is outdated. We should use reuse lint + opengrep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant