Write a shell script to validate licensing #24

Closed
opened 2022-11-03 00:03:00 +00:00 by mars · 0 comments
Owner

Every Rust source file in Canary needs to be licensed. A shell script that could check all the source files could help enforce licensing of the entire source tree. Licenses are at the top of source files and look like this:

// Copyright (c) 2022 Marceline Cramer
// SPDX-License-Identifier: blah-blah-blah
<newline>
... code here ...

Canary has different licenses for different crates, so the header will not be identical between all source files.

The script needs to find all Rust source files in the repository (staged, committed, or still unstaged) that are not ignored by Git, validate that they have a well-formed license header, and then display the list of files that do not have a valid header. The script should return with an error if it finds any invalid headers. It only needs to run on Linux, and can use non-standard programs, however, a list of all non-standard dependencies must be provided in a comment at the beginning of the script. Bash shell features are not allowed; please test with dash instead.

The script should be placed in the repository root as check_licenses.sh and given proper Unix file permissions.

Every Rust source file in Canary needs to be licensed. A shell script that could check all the source files could help enforce licensing of the entire source tree. Licenses are at the top of source files and look like this: ``` // Copyright (c) 2022 Marceline Cramer // SPDX-License-Identifier: blah-blah-blah <newline> ... code here ... ``` Canary has different licenses for different crates, so the header will not be identical between all source files. The script needs to find all Rust source files in the repository (staged, committed, or still unstaged) that are not ignored by Git, validate that they have a well-formed license header, and then display the list of files that do not have a valid header. The script should return with an error if it finds any invalid headers. It only needs to run on Linux, and can use non-standard programs, however, a list of all non-standard dependencies must be provided in a comment at the beginning of the script. Bash shell features are not allowed; please test with dash instead. The script should be placed in the repository root as `check_licenses.sh` and given proper Unix file permissions.
mars added the
consistency
label 2022-11-03 00:03:00 +00:00
lilithium-hydride was assigned by mars 2022-11-03 00:19:01 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: canary/canary-rs#24
No description provided.