-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce copyright check in CI (#1965)
- Loading branch information
Showing
33 changed files
with
241 additions
and
14 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
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,51 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Ignore the following directories | ||
|
||
./.git/* | ||
./.github/* | ||
./third_party/benchmark/* | ||
./third_party/boost/* | ||
./third_party/googletest/* | ||
./third_party/ms-gsl/* | ||
./third_party/nlohmann-json/* | ||
./third_party/opentelemetry-proto/* | ||
./third_party/prometheus-cpp/* | ||
./tools/vcpkg/* | ||
./tools/ports/* | ||
|
||
# Third party code | ||
|
||
./api/include/opentelemetry/nostd/internal/absl/* | ||
./exporters/jaeger/thrift-gen/* | ||
./exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h | ||
|
||
# Doc | ||
|
||
./docs/* | ||
|
||
## Ignore the following files patterns | ||
|
||
*.md | ||
*.rst | ||
*.png | ||
*.log | ||
*.patch | ||
*.json | ||
*.nuspec | ||
|
||
# Packaging | ||
*/CONTROL | ||
|
||
# LICENSE files | ||
*/LICENSE | ||
|
||
# Ignore the following misc files | ||
|
||
./.bazelignore | ||
./.bazelversion | ||
./docker/.gitignore | ||
.markdownlintignore | ||
./ci/toc.yml | ||
./ci/valgrind-suppressions |
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
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 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
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM centos:7 | ||
|
||
ARG TOOLSET_VER=11 | ||
|
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# MAINTAINER | ||
# | ||
|
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
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
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
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
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
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,97 @@ | ||
#!/bin/bash | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if [[ ! -e tools/check_copyright.sh ]]; then | ||
echo "This tool must be run from the topmost directory." >&2 | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
|
||
# | ||
# Process input file .copyright-ignore, | ||
# - remove comments | ||
# - remove blank lines | ||
# to create file /tmp/all_ignored | ||
# | ||
|
||
grep -v "^#" < .copyright-ignore | \ | ||
grep -v "^[[:space:]]*$" > /tmp/all_ignored | ||
|
||
# | ||
# Find all files from the repository | ||
# to create file /tmp/all_checked | ||
# | ||
|
||
find . -type f -print | sort -u > /tmp/all_checked | ||
|
||
# | ||
# Filter out /tmp/all_checked, | ||
# remove all ignored patterns from /tmp/all_ignored | ||
# When the pattern is *.md, | ||
# make sure to filter *\.md to avoid hiding *.cmd | ||
# Then, *\.md needs to be escaped to *\\.md, | ||
# to be given to egrep, hence the sed. | ||
# | ||
|
||
while IFS= read -r PATTERN; do | ||
SAFE_PATTERN=`echo "${PATTERN}" | sed "s!\.!\\\\\.!g"` | ||
echo "Filtering out ${SAFE_PATTERN}" | ||
egrep -v "${SAFE_PATTERN}" < /tmp/all_checked > /tmp/all_checked-tmp | ||
mv /tmp/all_checked-tmp /tmp/all_checked | ||
done < /tmp/all_ignored | ||
|
||
# | ||
# For all files in /tmp/all_checked | ||
# - verify there is copyright | ||
# - verify there is a license | ||
# and append to /tmp/all_missing | ||
# | ||
# Valid copyright strings are: | ||
# - Copyright The OpenTelemetry Authors | ||
# | ||
# Valid license strings are: | ||
# - SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
rm -rf /tmp/all_missing | ||
touch /tmp/all_missing | ||
|
||
for FILE in `cat /tmp/all_checked` | ||
do | ||
echo "Checking ${FILE}" | ||
export COPYRIGHT=`head -10 ${FILE} | grep -c "Copyright The OpenTelemetry Authors"` | ||
export LICENSE=`head -10 ${FILE} | grep -c "SPDX-License-Identifier: Apache-2.0"` | ||
if [ "$COPYRIGHT" == "0" ]; then | ||
echo "Missing copyright in ${FILE}" >> /tmp/all_missing | ||
fi; | ||
if [ "${LICENSE}" == "0" ]; then | ||
echo "Missing license in ${FILE}" >> /tmp/all_missing | ||
fi; | ||
done | ||
|
||
# | ||
# Final report | ||
# | ||
|
||
FAIL_COUNT=`wc -l < /tmp/all_missing` | ||
|
||
if [ ${FAIL_COUNT} != "0" ]; then | ||
# | ||
# CI FAILED | ||
# | ||
|
||
cat /tmp/all_missing | ||
|
||
echo "Total number of failed checks: ${FAIL_COUNT}" | ||
exit 1 | ||
fi; | ||
|
||
# | ||
# CI PASSED | ||
# | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
REM Copyright The OpenTelemetry Authors | ||
REM SPDX-License-Identifier: Apache-2.0 | ||
|
||
@REM This script allows to download a file to local machine. First argument is URL | ||
set "PATH=%SystemRoot%;%SystemRoot%\System32;%SystemRoot%\System32\WindowsPowerShell\v1.0\;%ProgramFiles%\Git\bin" | ||
@powershell -File Download.ps1 %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
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
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