Skip to content

Move docstring copyright notices to SPDX header comments - #23

Merged
mcdigman merged 1 commit into
devfrom
chore/spdx-copyright-headers
Jul 10, 2026
Merged

Move docstring copyright notices to SPDX header comments#23
mcdigman merged 1 commit into
devfrom
chore/spdx-copyright-headers

Conversation

@mcdigman

Copy link
Copy Markdown
Owner

Summary

Pull the Copyright 2026 Matthew C. Digman line out of each module docstring and replace it with a two-line SPDX header at the top of the file:

# SPDX-FileCopyrightText: Copyright 2026 Matthew C. Digman
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Applied to the 9 project files that had a copyright notice in their docstring: tests/test_pyakima.py, docs/conf.py, pyakima/__init__.py, pyakima/pyakima.py, and all five pyakima/demos/*.py.

Why this exact form

  • Keeping the Copyright prefix on the SPDX-FileCopyrightText value means the notice still matches ruff's flake8-copyright (CPY001) default notice-rgx, which requires the literal word Copyright followed by whitespace and a year. The bare SPDX-FileCopyrightText: 2026 … form fails that regex.
  • SPDX-FileCopyrightText: Copyright <year> <author> is still valid SPDX/REUSE (the value is free-form text).
  • The license identifier matches the PEP 639 expression Apache-2.0 WITH LLVM-exception declared in pyproject.toml.

Left untouched

  • docs/conf.py copyright = '2025-2026, Matthew C. Digman' — the Sphinx-mandated config variable (keeps its # noqa: A001), not a docstring notice.
  • Small stub files with no existing notice (__init__.py stubs, _version.py) — nothing to move; they're under ruff's min-file-size = 1024.

Verification

  • ruff check / ruff format --check — pass (also all pre-commit hooks passed on commit)
  • ruff check --preview --select CPY001 — pass
  • py_compile on all changed files — OK

🤖 Generated with Claude Code

Pull the `Copyright 2026 Matthew C. Digman` line out of each module
docstring and replace it with a two-line SPDX header at the top of the
file:

    # SPDX-FileCopyrightText: Copyright 2026 Matthew C. Digman
    # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

The `Copyright` prefix on the FileCopyrightText value keeps the notice
matching ruff's flake8-copyright (CPY001) default notice-rgx while still
being valid SPDX/REUSE. The license identifier matches the PEP 639
expression in pyproject.toml. The Sphinx `copyright =` config variable in
docs/conf.py is left as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mcdigman
mcdigman merged commit c9be0db into dev Jul 10, 2026
14 checks passed
@mcdigman
mcdigman deleted the chore/spdx-copyright-headers branch July 10, 2026 05:40
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