-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run copyright header check recursively
We have a few directories in this repo that will be remaining MPL licensed (the provider protocol definitions). This is something that the copywrite tool does not support out of the box - we need to run the tool for each directory that contains a .copywrite.hcl file in order to make sure that new files have the correct header. To avoid adding yet more boilerplate with a `copyright_headers.go` file in each package, let's move the copyright check to its own make target and script the process of discovering all directories with copywrite config.
- Loading branch information
Showing
5 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: BUSL-1.1 | ||
|
||
# This script checks that all files have the appropriate copyright headers, | ||
# according to their nearest .copywrite.hcl config file. The copyright tool | ||
# does not natively support repos with multiple licenses, so we have to | ||
# script this ourselves. | ||
|
||
set -euo pipefail | ||
|
||
# Find all directories containing a .copywrite.hcl config file | ||
directories=$(find . -type f -name '.copywrite.hcl' -execdir pwd \;) | ||
|
||
for dir in $directories; do | ||
cd $dir && go run github.com/hashicorp/copywrite headers | ||
done |
This file contains 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