Skip to content

STYLE: Add SPDX license identifiers to all ITK source files#6063

Draft
hjmjohnson wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:spdx-file-headers
Draft

STYLE: Add SPDX license identifiers to all ITK source files#6063
hjmjohnson wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:spdx-file-headers

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Add machine-readable SPDX headers to all 5,503 ITK-owned source files following VTK's convention. This completes Phase 2 of the SBOM roadmap (#4302), complementing the SBOM generation in #5817.

Format (matching VTK)

C/C++ files:

// SPDX-FileCopyrightText: Copyright NumFOCUS
// SPDX-License-Identifier: Apache-2.0
/*=========================================================================
 *  Copyright NumFOCUS
 *  ...existing Apache-2.0 block...
 *=========================================================================*/

Python files:

# SPDX-FileCopyrightText: Copyright NumFOCUS
# SPDX-License-Identifier: Apache-2.0
# ==========================================================================
#   Copyright NumFOCUS
#   ...existing Apache-2.0 block...
Scope
  • 5,503 files modified (.h, .hxx, .cxx, .txx, .py, .cmake, CMakeLists.txt)
  • Only files containing "Copyright NumFOCUS" are touched
  • ThirdParty code is excluded
  • Utilities/KWStyle/ITKHeader.h template updated to enforce SPDX on new files
  • Migration script at Utilities/Maintenance/AddSPDXHeaders.py for reuse
Why both SPDX lines and existing header?

The existing 17-line Apache-2.0 block is the human-readable legal notice. The SPDX lines are the machine-readable equivalent, parseable by REUSE, scancode-toolkit, fossology, and other license compliance tools. Both forms are standard practice — VTK, CMake, KDE, and FSFE projects use this dual approach.

@hjmjohnson hjmjohnson requested a review from dzenanz April 15, 2026 02:04
@github-actions github-actions bot added the type:Style Style changes: no logic impact (indentation, comments, naming) label Apr 15, 2026
@hjmjohnson hjmjohnson force-pushed the spdx-file-headers branch 2 times, most recently from 21b931c to 1d05a10 Compare April 15, 2026 11:33
@hjmjohnson hjmjohnson marked this pull request as ready for review April 15, 2026 14:43
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 15, 2026

Too many files changed for review. (3000 files found, 100 file limit)

@hjmjohnson hjmjohnson marked this pull request as draft April 15, 2026 19:36
Add AddSPDXHeaders.py to prepend SPDX-FileCopyrightText and
SPDX-License-Identifier lines to all ITK source files following
VTK's convention (// comment lines before the existing block).

Update ITKHeader.h KWStyle template to include the SPDX lines
so new files are enforced going forward.
Add machine-readable SPDX headers to all ITK-owned source files
following VTK's convention: two // (or #) comment lines before
the existing license block.

  // SPDX-FileCopyrightText: Copyright NumFOCUS
  // SPDX-License-Identifier: Apache-2.0

This completes Phase 2 of the SBOM roadmap (issue InsightSoftwareConsortium#4302).
Applied by Utilities/Maintenance/AddSPDXHeaders.py.
5503 files modified. ThirdParty code is excluded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Style Style changes: no logic impact (indentation, comments, naming)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant