-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to the latest Linebender CI standard.
- Loading branch information
Showing
3 changed files
with
183 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# If there are new files with headers that can't match the conditions here, | ||
# then the files can be ignored by an additional glob argument via the -g flag. | ||
# For example: | ||
# -g "!src/special_file.rs" | ||
# -g "!src/special_directory" | ||
|
||
# Check all the standard Rust source files | ||
output=$(rg "^// Copyright (19|20)[\d]{2} (.+ and )?the Peniko Authors( and .+)?$\n^// SPDX-License-Identifier: Apache-2\.0 OR MIT$\n\n" --files-without-match --multiline -g "*.rs" .) | ||
|
||
if [ -n "$output" ]; then | ||
echo -e "The following files lack the correct copyright header:\n" | ||
echo $output | ||
echo -e "\n\nPlease add the following header:\n" | ||
echo "// Copyright $(date +%Y) the Peniko Authors" | ||
echo "// SPDX-License-Identifier: Apache-2.0 OR MIT" | ||
echo -e "\n... rest of the file ...\n" | ||
exit 1 | ||
fi | ||
|
||
echo "All files have correct copyright headers." | ||
exit 0 | ||
|
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