Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add a CI check ensuring the code has license headers #6609

Merged
merged 9 commits into from
Feb 3, 2023

Conversation

rzadp
Copy link
Contributor

@rzadp rzadp commented Jan 23, 2023

The scan looks for licenses in the source code and fails if some file does not have an Apache or GPL license header.
Scans files in the repo (so no dependencies). The scan could be extended to dependencies if needed.

Closes paritytech/license-scanner#20
Progresses paritytech/license-scanner#8

@paritytech-ci paritytech-ci requested a review from a team January 23, 2023 12:16
npx @paritytech/license-scanner@0.0.3 scan \
--ensure-licenses Apache-2.0 \
--ensure-licenses GPL-3.0-only \
./**/src/**/*.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just ./**/*.rs? I think having src in there would make this not match on all files, e.g. build.rs files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I changed it to ./**/*.rs (and added missing licenses uncovered by it)

Copy link
Contributor

@mrcnski mrcnski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool! Just one question.

@the-right-joyce the-right-joyce added A0-please_review Pull request needs code review. and removed A0-pleasereview labels Jan 23, 2023
Copy link
Contributor

@Bullrich Bullrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good and I see it is working!

.github/workflows/check-licenses.yml Show resolved Hide resolved
Copy link
Contributor

@mrcnski mrcnski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@rzadp rzadp added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Jan 24, 2023
@rzadp rzadp added the D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. label Jan 24, 2023
@rzadp
Copy link
Contributor Author

rzadp commented Feb 3, 2023

bot merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[on hold] add ability to run as a CI check
7 participants