Repository navigation
chore: no Rust file said what licence it was under - #64
Merged
jamesconwaydev merged 1 commit intoNov 9, 2026
Merged
Conversation
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
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
OpenSSF Gold asks each source file to state its licence and copyright, and no
.rsfile 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
.rsfile now starts with the following, as NOTICE has it:scripts/sync-from-netweir.shwrites it. For each.rsfile 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,--checkcompares like with like; the drift check needs no special handling.NETWEIR_COMMIT(90fcd03), soNETWEIR_COMMITis unchanged. The diff adds exactly three lines (header and a blank) to each of the 17 files, and nothing else.scripts/check-headers.shfails on any tracked.rsfile that doesn't start with the header. It runs in thedriftjob 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
scripts/sync-from-netweir.sh --checkagainst Netweir at 90fcd03 passes, and so doesscripts/check-headers.sh. Before the sync,check-headers.shfailed on every file.renameon a file starting with// SPDX-License-Identifier: AGPL-3.0-only,// Copyright 2026 Netweirand a blank line. It came out with only Parsec's header.cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspaceandshellcheck scripts/*.shpass.Checklist
cargo fmt,cargo clippy -- -D warningsandcargo testpass locallycrates/parsec/src, its tests, examples, scripts or fuzz targets were made in Netweir first (only the header, which the sync script writes)