Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copyright header check to CI. #463

Merged
merged 9 commits into from
Feb 26, 2024
Merged

Add copyright header check to CI. #463

merged 9 commits into from
Feb 26, 2024

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Feb 25, 2024

Since #456 was merged we have standardized copyright headers here. This PR adds a check to the CI to ensure that we keep them nice and consistent.

The script also has two things to quickly support a more complex future.

  1. Additional copyright owners in the format of:
// Copyright 2024 [Other Text and] the Vello Authors [and Other Text]
// SPDX-License-Identifier: Apache-2.0 OR MIT

This has been used for example in Peniko as the Peniko Authors and the Piet Authors.

  1. Nearby comment with examples on how to add potential new files or directories as exclusions from this check. Currently we don't have anything to exclude, but it's possible we might in the future. The comment should help reduce confusion on how to deal with it.

Worth noting that the ripgrep command itself is cross-platform. However the bash script obviously isn't. However at this point that isn't a big deal, because we don't need to check the headers on every platform. So we just piggyback on the rustfmt Ubuntu job.

@xStrom xStrom marked this pull request as draft February 25, 2024 17:15
Copy link
Contributor

@waywardmonkeys waywardmonkeys left a comment

Choose a reason for hiding this comment

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

LGTM with one question.

.github/workflows/ci.yml Show resolved Hide resolved
@xStrom
Copy link
Member Author

xStrom commented Feb 25, 2024

Well this worked just fine on my local Ubuntu install, but the GitHub Action runner seems to print out <stdin> which causes an error. I'll need to investigate what's going on here, but that will have to wait a bit as I'm out of time right now.

@xStrom xStrom marked this pull request as ready for review February 25, 2024 18:09
@xStrom
Copy link
Member Author

xStrom commented Feb 25, 2024

Explicitly setting the search path helped solved that issue. I also tested that the CI properly notices invalid headers with some bogus commits that I later reverted.

This is now ready.

@xStrom xStrom added this pull request to the merge queue Feb 26, 2024
Merged via the queue into linebender:main with commit 7ef9226 Feb 26, 2024
9 checks passed
@xStrom xStrom deleted the copycheck branch February 26, 2024 10:29
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.

2 participants