-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2491 from div72/lint-copyright-https
lint: add script to check for https violations
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2022 The Gridcoin developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or https://opensource.org/licenses/mit-license.php. | ||
|
||
export LC_ALL=C | ||
set -e | ||
|
||
if [[ -z "${COMMIT_RANGE}" ]]; then | ||
echo "USAGE: COMMIT_RANGE=\"FIRST..LAST\" $0" | ||
exit 0 | ||
fi | ||
|
||
EXIT_CODE=0 | ||
while read f; do | ||
if grep -E "http://(www\.)?opensource.org" "$f" > /dev/null; then | ||
EXIT_CODE=1 | ||
echo "$f: needs https correction for the copyright header." | ||
fi | ||
done < <(git diff --name-only "${COMMIT_RANGE}") | ||
|
||
exit ${EXIT_CODE} | ||
|