Skip to content

Commit

Permalink
Amend check_commit and PR template
Browse files Browse the repository at this point in the history
Require GPLv3 license and check for violations.
  • Loading branch information
kk7ds committed Jul 3, 2023
1 parent f55170a commit 0e5fc94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The following must be true before PRs can be merged:
* Commits in a single PR should be related.
* Major new features or bug fixes should reference a [CHIRP issue](https://chirp.danplanet.com/projects/chirp/issues).
* New drivers should be accompanied by a test image in `tests/images` (except for thin aliases where the driver is sufficiently tested already).
* All files must be GPLv3 licensed or contain no license verbiage. No additional restrictions can be placed on the usage (i.e. such as noncommercial).

Please also follow these guidelines:

Expand Down
8 changes: 7 additions & 1 deletion tools/check_commit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

BASE="$1"
BASE=${1:-origin/master}
RETCODE=0

RED='\033[1;31m'
Expand All @@ -14,6 +14,7 @@ function fail() {

echo -e "${GREEN}Checking from $(git rev-parse --short ${BASE}):${NC}"
git log --pretty=oneline --no-merges --abbrev-commit ${BASE}..
echo

git diff ${BASE}.. '*.py' | grep '^+' > added_lines

Expand Down Expand Up @@ -53,6 +54,11 @@ if grep '/cpep8.blacklist' added_lines; then
fail 'Do not add new files to cpep8.blacklist'
fi

grep -i 'license' added_lines > license_lines
if grep -iv '(GNU General Public License|Free Software Foundation)' license_lines; then
fail 'Files must be GPLv3 licensed (or not contain any license language)'
fi

for file in $(git diff --name-only ${BASE}..); do
if file $file | grep -q CRLF; then
fail "$file : Files should be LF (Unix) format, not CR (Mac) or CRLF (Windows)"
Expand Down

0 comments on commit 0e5fc94

Please sign in to comment.