Skip to content

chore: no Rust file said what licence it was under - #64

Merged
jamesconwaydev merged 1 commit into
parsec-html:mainfrom
foothillsdigital:chore/spdx-headers
Nov 9, 2026
Merged

jamesconwaydev merged 1 commit into
parsec-html:mainfrom
foothillsdigital:chore/spdx-headers

Conversation

@foothillsdigital

Copy link
Copy Markdown
Collaborator

Problem

OpenSSF Gold asks each source file to state its licence and copyright, and no .rs file here did. The catch, as the issue says: every one of the 17 is synced from Netweir, which is AGPL, so the header can't simply be added by hand.

Fixes #56

Change

  • The header. Every .rs file now starts with the following, as NOTICE has it:
    // SPDX-License-Identifier: Apache-2.0
    // Copyright 2026 James Conway
    
  • scripts/sync-from-netweir.sh writes it. For each .rs file it drops any SPDX or copyright lines at the top of Netweir's copy (and the blank line after them), then puts Parsec's in their place. Netweir has no headers today, so this guards against it adding an AGPL one. Since the sync output carries the header, --check compares like with like; the drift check needs no special handling.
  • The files were regenerated by running the sync against Netweir at the commit in NETWEIR_COMMIT (90fcd03), so NETWEIR_COMMIT is unchanged. The diff adds exactly three lines (header and a blank) to each of the 17 files, and nothing else.
  • scripts/check-headers.sh fails on any tracked .rs file that doesn't start with the header. It runs in the drift job after the sync check, so Parsec's own files (bindings, the C API) have to carry it too.

No Netweir PR is needed: this is the sync script, not the parser.

Tests

  • Sync and checks: scripts/sync-from-netweir.sh --check against Netweir at 90fcd03 passes, and so does scripts/check-headers.sh. Before the sync, check-headers.sh failed on every file.
  • Header stripping: I ran the script's rename on a file starting with // SPDX-License-Identifier: AGPL-3.0-only, // Copyright 2026 Netweir and a blank line. It came out with only Parsec's header.
  • The usual checks: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace and shellcheck scripts/*.sh pass.

Checklist

  • cargo fmt, cargo clippy -- -D warnings and cargo test pass locally
  • Tests cover the change, and a bug fix has the test that would have caught it (the CI check is the test)
  • Changes to crates/parsec/src, its tests, examples, scripts or fuzz targets were made in Netweir first (only the header, which the sync script writes)
  • The wiki is updated if the change is visible to people using Parsec (not visible)
  • It's my own work, and not copied from another project in breach of its licence

OpenSSF Gold asks each source file to state its licence and copyright.
Every .rs file now starts with

    // SPDX-License-Identifier: Apache-2.0
    // Copyright 2026 James Conway

as NOTICE has it. All of them are synced from Netweir, which is AGPL,
so scripts/sync-from-netweir.sh writes the header: it drops any SPDX or
copyright lines at the top of Netweir's copy and puts Parsec's in their
place. The drift check then compares like with like, and the files here
were regenerated from the commit in NETWEIR_COMMIT, adding only the
header. scripts/check-headers.sh fails CI on any tracked .rs file that
doesn't start with it, so Parsec's own files carry it too.

Closes parsec-html#56
@jamesconwaydev
jamesconwaydev merged commit 267d63f into parsec-html:main Nov 9, 2026
7 checks passed
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.

SPDX and copyright headers on every source file

2 participants