You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: auto-insert Apache license headers via Lucas-C/insert-license
Add Lucas-C/pre-commit-hooks insert-license to .pre-commit-config.yaml
covering every file type that's actually present in the repo:
.py .yml/.yaml .toml .sh .ezt Dockerfile/*.Dockerfile .md
Hooks share a single license template (scripts/license-templates/LICENSE.txt)
and the canonical wrapped '#'-comment style ('#|#|#') used by the majority
of existing files. Markdown uses '<!--| |-->' to match the existing
2-space-indented HTML-comment style.
Exclusions are scoped narrowly:
* approved_patterns.yml — auto-generated from actions.yml.
* stash/* (except stash/pyproject.toml) — uses the short-form
'Copyright (c) The stash contributors / Licensed under Apache 2.0'
style which RAT accepts.
* .github/workflows/stash-action-test.yml — same short-form.
* AGENTS.md / CLAUDE.md — agentic-tooling docs that follow the
short-license convention used in apache/airflow.
Drive-by normalisation across files outside stash/:
* 17 files had unwrapped headers ('# Licensed' on line 1, no
surrounding '#' lines) — wrapped to the canonical style so the hook
is a no-op on subsequent runs.
* pelican/plugins/spu.py and pelican/plugin_paths.py had legacy
near-identical license blocks (slightly different wrap, https vs
http URL) — replaced with the canonical block; the duplicate that
insert-license added on first run was removed manually.
Motivation: PR #770 shipped a new file (lock_file_exemptions.yml)
without an ASF license header, which the rat check correctly caught
but only after the PR was opened and reviewed. Running this hook
locally would have flagged it before push.
0 commit comments