Skip to content

Add Copyright headers to all source and documentation files#464

Open
jiyuanwangbmw wants to merge 4 commits into
eclipse-openbsw:mainfrom
jiyuanwangbmw:feature/RTOS-2040-copyright-headers
Open

Add Copyright headers to all source and documentation files#464
jiyuanwangbmw wants to merge 4 commits into
eclipse-openbsw:mainfrom
jiyuanwangbmw:feature/RTOS-2040-copyright-headers

Conversation

@jiyuanwangbmw
Copy link
Copy Markdown

Issues #456

Summary

Adds Eclipse-compliant Apache-2.0 copyright headers to all source and documentation files, along with automated tooling to enforce copyright compliance going forward.

Changes

  1. Add cr_checker copyright tooling and CI workflow — Copyright checker tool (from eclipse-score/tooling), templates, configuration, exclusion list, and GitHub Actions CI workflow.
  2. Apply Eclipse copyright headers to all source files (automated) — Automated application of copyright headers to ~1739 files.
  3. Add copyright checker documentation and treefmt integration — Developer documentation and treefmt formatter integration for continuous enforcement.
  4. Fix formatting: remove double blank lines and preserve cmake copyright headers — Resolves formatting conflicts between cr_checker output and clang-format/cmake-format. Sets first_comment_is_literal = True in .cmake-format to preserve copyright header formatting.

File types covered

.c, .cpp, .h, .hpp, .cmake, CMakeLists.txt, .py, .sh, .toml, .yml, .yaml, .ini, .rst, .md, .puml

CI enforcement

  • Dedicated copyright.yml workflow runs cr_checker in check mode
  • treefmt integration for formatting-time copyright enforcement

- Add cr_checker.py: copyright header checker/fixer (based on eclipse-score/tooling)
  with auto-extraction of existing year/author from old-format headers
- Add templates.ini: copyright templates for all file types
  (cpp/c/h/hpp, py/sh/cmake/yaml/toml/bzl/ini/BUILD, rs, rst, puml, md)
- Add config.json: default author configuration
- Add exclusions.txt: files/dirs excluded from checking
  (3rdparty/, build/, templates.ini, .github/ISSUE_TEMPLATE/)
- Add .github/workflows/copyright.yml: CI workflow for copyright compliance
  with least-privilege permissions (contents: read)
@jiyuanwangbmw jiyuanwangbmw force-pushed the feature/RTOS-2040-copyright-headers branch from 1db0642 to 126ad59 Compare May 27, 2026 14:19
Generated by running:
  python3 tools/cr_checker/cr_checker.py -t tools/cr_checker/templates.ini \
    -c tools/cr_checker/config.json --exclusion-file tools/cr_checker/exclusions.txt --fix .

- 1739 files updated: existing old-format headers replaced with Apache-2.0
  SPDX headers, missing headers added
- Original copyright year and author preserved from existing headers
- GitHub issue template .md files: copyright placed after YAML front matter
- Removed 17 leftover standalone copyright lines from files that had
  dual copyright holders (BMW AG lines alongside new Apache-2.0 block)
- Document cr_checker.py usage in doc/dev/guidelines/formatting/automatic.rst
  (check mode, fix mode, configuration, treefmt integration)
- Integrate cr_checker as treefmt formatter for all supported file types
- Remove cr_checker-handled types from treefmt global excludes
  (py, sh, toml, yml, yaml, ini, md, rst, puml)
@jiyuanwangbmw jiyuanwangbmw force-pushed the feature/RTOS-2040-copyright-headers branch from 126ad59 to 71aa7e4 Compare May 27, 2026 14:28
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