ci: add an hook to automatically add OET's SPDX header - #92
Conversation
for more information, see https://pre-commit.ci
|
You could use
|
|
Maybe try something like: |
|
Thank you for both suggestions! I considered using |
Typically local pre-commit hooks only ever operate on changed files, so i don't think your premise is true. but i have not looked for documentation on that. The main option you have for making it work with pre-commit.ci is to skip it: https://pre-commit.ci/#configuration-skip |
|
I think that's a difference between local pre-commit hooks and the @coroa Option to just not run it in the CI is a simple one. If you still want to run it in the CI, I would advocate for a solution using - repo: local
hooks:
- id: reuse-annotate-branch-diff
name: REUSE annotate on branch diff
entry: bash -c 'reuse annotate --fallback-dot-license --copyright="<Placeholder>" $(git diff --name-only $(git merge-base HEAD master) HEAD)'
language: system
types: [file]Not sure if this will work with the CI though. Did your |
i think a64eb01 says yes :). i am not sure how/if reuse is installed in your example, though. as a |
This reverts commit a64eb01.
for more information, see https://pre-commit.ci
|
I think that's acceptable. This will cover most of the cases. You won't be able to cover all. I guess you noticed this when including the |
|
For me that is fine. I think i would prefer to only run it locally, instead of using the git stuff to figure out what changed in a PR, since i expect this to produce false positives regularly, but we can try to run with this and then fine tune over time. |
|
Note also that it is not difficult to make reuse-tool support the |
|
True, but, i would count this as the remaining 1% manual adjustments :) |
|
Ah, one thought. What happens when you merge an updated master branch into an in-process PR? Which commit is the Only the PR updated ones or also of the new commits on master? |
|
|
I think you are right. |
|
PR opened: fsfe/reuse-tool#1206 |
Thanks. Cool that the other files are easy too. You introduced a typo into |
Yes, I saw... It's already fixed |
Sorry, i did not understand the first time what you mean by the test partially fails and i still don't |
|
Closes # (if applicable).
Changes proposed in this Pull Request
This PR wants to introduce a new hook to ensure the repository remains compliant with REUSE (see #89). Currently, the hook edits the entire repository rather than just new files.
Hook configuration
Script
Checklist
envs/environment.yaml.config/config.default.yaml.doc/configtables/*.csv.config/test/*.yaml.doc/data_sources.rst.doc/release_notes.rstis added.READMEanddoc/index.rst.