-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert to 4e87540 (last commit before v2)
- Loading branch information
Showing
76 changed files
with
910 additions
and
4,617 deletions.
There are no files selected for viewing
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,61 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# DO NOT EDIT THIS FILE | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
# If you want to update the shared CI config, send a PR to | ||
# https://github.com/pion/.goassets instead of this repository. | ||
# | ||
|
||
set -e | ||
|
||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
|
||
if [ -f ${SCRIPT_PATH}/.ci.conf ] | ||
then | ||
. ${SCRIPT_PATH}/.ci.conf | ||
fi | ||
|
||
# | ||
# DO NOT EDIT THIS | ||
# | ||
EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot') | ||
# If you want to exclude a name from all repositories, send a PR to | ||
# https://github.com/pion/.goassets instead of this repository. | ||
# If you want to exclude a name only from this repository, | ||
# add EXCLUDED_CONTRIBUTORS=('name') to .github/.ci.conf | ||
|
||
MISSING_CONTRIBUTORS=() | ||
|
||
shouldBeIncluded () { | ||
for i in "${EXCLUDED_CONTRIBUTORS[@]}" | ||
do | ||
if [ "$i" == "$1" ] ; then | ||
return 1 | ||
fi | ||
done | ||
return 0 | ||
} | ||
|
||
|
||
IFS=$'\n' #Only split on newline | ||
for contributor in $(git log --format='%aN' | sort -u) | ||
do | ||
if shouldBeIncluded $contributor; then | ||
if ! grep -q "$contributor" "$SCRIPT_PATH/../README.md"; then | ||
MISSING_CONTRIBUTORS+=("$contributor") | ||
fi | ||
fi | ||
done | ||
unset IFS | ||
|
||
if [ ${#MISSING_CONTRIBUTORS[@]} -ne 0 ]; then | ||
echo "Please add the following contributors to the README" | ||
for i in "${MISSING_CONTRIBUTORS[@]}" | ||
do | ||
echo "$i" | ||
done | ||
exit 1 | ||
fi |
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
|
||
set -e | ||
|
||
.github/lint-commit-message.sh $1 |
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,12 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
|
||
# Redirect output to stderr. | ||
exec 1>&2 | ||
|
||
.github/lint-disallowed-functions-in-library.sh |
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,13 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
|
||
set -e | ||
|
||
.github/assert-contributors.sh | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# DO NOT EDIT THIS FILE | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
# If you want to update the shared CI config, send a PR to | ||
# https://github.com/pion/.goassets instead of this repository. | ||
# | ||
|
||
set -e | ||
|
||
display_commit_message_error() { | ||
cat << EndOfMessage | ||
$1 | ||
------------------------------------------------- | ||
The preceding commit message is invalid | ||
it failed '$2' of the following checks | ||
* Separate subject from body with a blank line | ||
* Limit the subject line to 50 characters | ||
* Capitalize the subject line | ||
* Do not end the subject line with a period | ||
* Wrap the body at 72 characters | ||
EndOfMessage | ||
|
||
exit 1 | ||
} | ||
|
||
lint_commit_message() { | ||
if [[ "$(echo "$1" | awk 'NR == 2 {print $1;}' | wc -c)" -ne 1 ]]; then | ||
display_commit_message_error "$1" 'Separate subject from body with a blank line' | ||
fi | ||
|
||
if [[ "$(echo "$1" | head -n1 | awk '{print length}')" -gt 50 ]]; then | ||
display_commit_message_error "$1" 'Limit the subject line to 50 characters' | ||
fi | ||
|
||
if [[ ! $1 =~ ^[A-Z] ]]; then | ||
display_commit_message_error "$1" 'Capitalize the subject line' | ||
fi | ||
|
||
if [[ "$(echo "$1" | awk 'NR == 1 {print substr($0,length($0),1)}')" == "." ]]; then | ||
display_commit_message_error "$1" 'Do not end the subject line with a period' | ||
fi | ||
|
||
if [[ "$(echo "$1" | awk '{print length}' | sort -nr | head -1)" -gt 72 ]]; then | ||
display_commit_message_error "$1" 'Wrap the body at 72 characters' | ||
fi | ||
} | ||
|
||
if [ "$#" -eq 1 ]; then | ||
if [ ! -f "$1" ]; then | ||
echo "$0 was passed one argument, but was not a valid file" | ||
exit 1 | ||
fi | ||
lint_commit_message "$(sed -n '/# Please enter the commit message for your changes. Lines starting/q;p' "$1")" | ||
else | ||
for commit in $(git rev-list --no-merges origin/master..); do | ||
lint_commit_message "$(git log --format="%B" -n 1 $commit)" | ||
done | ||
fi |
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,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# DO NOT EDIT THIS FILE | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
# If you want to update the shared CI config, send a PR to | ||
# https://github.com/pion/.goassets instead of this repository. | ||
# | ||
|
||
set -e | ||
|
||
# Disallow usages of functions that cause the program to exit in the library code | ||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
if [ -f ${SCRIPT_PATH}/.ci.conf ] | ||
then | ||
. ${SCRIPT_PATH}/.ci.conf | ||
fi | ||
|
||
EXCLUDE_DIRECTORIES=${DISALLOWED_FUNCTIONS_EXCLUDED_DIRECTORIES:-"examples"} | ||
DISALLOWED_FUNCTIONS=('os.Exit(' 'panic(' 'Fatal(' 'Fatalf(' 'Fatalln(' 'fmt.Println(' 'fmt.Printf(' 'log.Print(' 'log.Println(' 'log.Printf(' 'print(' 'println(') | ||
|
||
files=$( | ||
find "$SCRIPT_PATH/.." -name "*.go" \ | ||
| grep -v -e '^.*_test.go$' \ | ||
| while read file | ||
do | ||
excluded=false | ||
for ex in $EXCLUDE_DIRECTORIES | ||
do | ||
if [[ $file == */$ex/* ]] | ||
then | ||
excluded=true | ||
break | ||
fi | ||
done | ||
$excluded || echo "$file" | ||
done | ||
) | ||
|
||
for disallowedFunction in "${DISALLOWED_FUNCTIONS[@]}" | ||
do | ||
if grep -e "\s$disallowedFunction" $files | grep -v -e 'nolint'; then | ||
echo "$disallowedFunction may only be used in example code" | ||
exit 1 | ||
fi | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# DO NOT EDIT THIS FILE | ||
# | ||
# It is automatically copied from https://github.com/pion/.goassets repository. | ||
# | ||
# If you want to update the shared CI config, send a PR to | ||
# https://github.com/pion/.goassets instead of this repository. | ||
# | ||
|
||
set -e | ||
|
||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
GO_REGEX="^[a-zA-Z][a-zA-Z0-9_]*\.go$" | ||
|
||
find "$SCRIPT_PATH/.." -name "*.go" | while read fullpath; do | ||
filename=$(basename -- "$fullpath") | ||
|
||
if ! [[ $filename =~ $GO_REGEX ]]; then | ||
echo "$filename is not a valid filename for Go code, only alpha, numbers and underscores are supported" | ||
exit 1 | ||
fi | ||
done |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.