-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CICD: Add check for accidental inclusion of GPL:ed code
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 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 | ||
set -o errexit -o nounset -o pipefail | ||
|
||
# Make sure that we don't accidentally include GPL licenced files | ||
gpl_term="General Public License" | ||
gpl_excludes=( | ||
# Snippet expands to GPL, but is not under GPL | ||
":(exclude)assets/syntaxes/01_Packages/Matlab/Snippets/Octave-function.sublime-snippet" | ||
|
||
# 'gpl_term' matches itself :D | ||
":(exclude)tests/scripts/license-checks.sh" | ||
|
||
# Contains a reference to GPL, but is not under GPL | ||
":(exclude)tests/syntax-tests/source/Java Server Page (JSP)/LICENSE.md" | ||
) | ||
gpl_occurances=$(git grep --recurse-submodules "${gpl_term}" -- "${gpl_excludes[@]}" || true) | ||
|
||
if [ -z "${gpl_occurances}" ]; then | ||
echo "PASS: No files under GPL were found" | ||
else | ||
echo "FAIL: GPL:ed code is not compatible with bat, but occurances of '${gpl_term}' were found:" | ||
echo "${gpl_occurances}" | ||
exit 1 | ||
fi |