diff --git a/Makefile b/Makefile index 28a5183ff69..b9def834576 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + EXAMPLES := $(shell ./get_main_pkgs.sh ./example) TOOLS_MOD_DIR := ./tools @@ -51,7 +65,7 @@ test-with-coverage: done .PHONY: ci -ci: precommit check-clean-work-tree test-with-coverage test-386 +ci: precommit check-clean-work-tree license-check test-with-coverage test-386 .PHONY: check-clean-work-tree check-clean-work-tree: @@ -118,3 +132,13 @@ lint: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell generate: $(TOOLS_DIR)/stringer PATH="$(TOOLS_DIR):$${PATH}" go generate ./... + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path './vendor/*') ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=3 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi diff --git a/api/correlation/context.go b/api/correlation/context.go index 8c4932ef9a7..aa83ac4e28a 100644 --- a/api/correlation/context.go +++ b/api/correlation/context.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/correlation/doc.go b/api/correlation/doc.go index d6a9fe5fb05..1147a4f3997 100644 --- a/api/correlation/doc.go +++ b/api/correlation/doc.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/correlation/map.go b/api/correlation/map.go index 13383f25332..79a4f1868b5 100644 --- a/api/correlation/map.go +++ b/api/correlation/map.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/correlation/map_test.go b/api/correlation/map_test.go index 8002a3f646b..de0db6c6d5e 100644 --- a/api/correlation/map_test.go +++ b/api/correlation/map_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/metric/must.go b/api/metric/must.go index 3bea881a347..69697a822e2 100644 --- a/api/metric/must.go +++ b/api/metric/must.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/example/grpc/api/hello-service.proto b/example/grpc/api/hello-service.proto index 9f87c7ca95a..ecdafc79dfa 100644 --- a/example/grpc/api/hello-service.proto +++ b/example/grpc/api/hello-service.proto @@ -1,4 +1,4 @@ -// Copyright 2019, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/example/http/server/modd.conf b/example/http/server/modd.conf index da54262c7da..22ec99d907d 100644 --- a/example/http/server/modd.conf +++ b/example/http/server/modd.conf @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # A basic modd.conf file for Go development. # Run go test on ALL modules on startup, and subsequently only on modules diff --git a/example/zipkin/main.go b/example/zipkin/main.go index 57b5cdd7d5f..dbc33c5d048 100644 --- a/example/zipkin/main.go +++ b/example/zipkin/main.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/alignment_test.go b/exporters/otlp/alignment_test.go index 7a9ccfac44f..f20a0bd1b2d 100644 --- a/exporters/otlp/alignment_test.go +++ b/exporters/otlp/alignment_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/connection.go b/exporters/otlp/connection.go index 3e01f814888..530d7a244c5 100644 --- a/exporters/otlp/connection.go +++ b/exporters/otlp/connection.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/doc.go b/exporters/otlp/doc.go index 0445f087943..f8d105d1cbd 100644 --- a/exporters/otlp/doc.go +++ b/exporters/otlp/doc.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/example_test.go b/exporters/otlp/example_test.go index 7c1db6b0464..01635566284 100644 --- a/exporters/otlp/example_test.go +++ b/exporters/otlp/example_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/internal/transform/metric.go b/exporters/otlp/internal/transform/metric.go index b52e0f5d17c..6c03fc5d0d1 100644 --- a/exporters/otlp/internal/transform/metric.go +++ b/exporters/otlp/internal/transform/metric.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/internal/transform/metric_test.go b/exporters/otlp/internal/transform/metric_test.go index 7a7bf94a90b..e7a72b14871 100644 --- a/exporters/otlp/internal/transform/metric_test.go +++ b/exporters/otlp/internal/transform/metric_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/internal/transform/resource_test.go b/exporters/otlp/internal/transform/resource_test.go index 138d0223ab5..a5193ff315f 100644 --- a/exporters/otlp/internal/transform/resource_test.go +++ b/exporters/otlp/internal/transform/resource_test.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package transform import ( diff --git a/exporters/otlp/internal/transform/span_test.go b/exporters/otlp/internal/transform/span_test.go index 7a77036dab9..9918c0d9253 100644 --- a/exporters/otlp/internal/transform/span_test.go +++ b/exporters/otlp/internal/transform/span_test.go @@ -1,3 +1,17 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package transform import ( diff --git a/exporters/otlp/mock_collector_test.go b/exporters/otlp/mock_collector_test.go index 09898e0b6ce..6b3284c3846 100644 --- a/exporters/otlp/mock_collector_test.go +++ b/exporters/otlp/mock_collector_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/options.go b/exporters/otlp/options.go index 304f5895681..6bccada8296 100644 --- a/exporters/otlp/options.go +++ b/exporters/otlp/options.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/otlp.go b/exporters/otlp/otlp.go index 73d57cfe5ef..60207e9b099 100644 --- a/exporters/otlp/otlp.go +++ b/exporters/otlp/otlp.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/exporters/otlp/otlp_test.go b/exporters/otlp/otlp_test.go index 414b0206f80..3c0b46e09a5 100644 --- a/exporters/otlp/otlp_test.go +++ b/exporters/otlp/otlp_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/plugin/othttp/filters/filters.go b/plugin/othttp/filters/filters.go index d4e84b60434..de8b888dedc 100644 --- a/plugin/othttp/filters/filters.go +++ b/plugin/othttp/filters/filters.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/plugin/othttp/filters/filters_test.go b/plugin/othttp/filters/filters_test.go index d10dfd1b5b7..b880df0248d 100644 --- a/plugin/othttp/filters/filters_test.go +++ b/plugin/othttp/filters/filters_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/plugin/othttp/filters/header_go14.go b/plugin/othttp/filters/header_go14.go index a563bfd3c1a..9d0a61cb213 100644 --- a/plugin/othttp/filters/header_go14.go +++ b/plugin/othttp/filters/header_go14.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/plugin/othttp/filters/header_nongo14.go b/plugin/othttp/filters/header_nongo14.go index 7a5ffa3c136..a36d759098f 100644 --- a/plugin/othttp/filters/header_nongo14.go +++ b/plugin/othttp/filters/header_nongo14.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/export/metric/metric.go b/sdk/export/metric/metric.go index e231e234a0d..afe6da1cd34 100644 --- a/sdk/export/metric/metric.go +++ b/sdk/export/metric/metric.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/export/metric/metric_test.go b/sdk/export/metric/metric_test.go index 11130ce9220..d7bcf38fb92 100644 --- a/sdk/export/metric/metric_test.go +++ b/sdk/export/metric/metric_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/internal/state_locker.go b/sdk/internal/state_locker.go index 253377cc3c9..3784728e5dc 100644 --- a/sdk/internal/state_locker.go +++ b/sdk/internal/state_locker.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/aggregator/histogram/histogram.go b/sdk/metric/aggregator/histogram/histogram.go index d451579285e..e5fa397f269 100644 --- a/sdk/metric/aggregator/histogram/histogram.go +++ b/sdk/metric/aggregator/histogram/histogram.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/aggregator/histogram/histogram_test.go b/sdk/metric/aggregator/histogram/histogram_test.go index 59d1831d7b0..68eaf2f0f62 100644 --- a/sdk/metric/aggregator/histogram/histogram_test.go +++ b/sdk/metric/aggregator/histogram/histogram_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/histogram_stress_test.go b/sdk/metric/histogram_stress_test.go index 420aa89d866..32b3f593d5a 100644 --- a/sdk/metric/histogram_stress_test.go +++ b/sdk/metric/histogram_stress_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/minmaxsumcount_stress_test.go b/sdk/metric/minmaxsumcount_stress_test.go index eefea976d37..b5a7e6eab89 100644 --- a/sdk/metric/minmaxsumcount_stress_test.go +++ b/sdk/metric/minmaxsumcount_stress_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/refcount_mapped.go b/sdk/metric/refcount_mapped.go index b180dd1a77b..68bc6e78aba 100644 --- a/sdk/metric/refcount_mapped.go +++ b/sdk/metric/refcount_mapped.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/metric/stress_test.go b/sdk/metric/stress_test.go index 170e4936227..8159ac932bf 100644 --- a/sdk/metric/stress_test.go +++ b/sdk/metric/stress_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/resource/resource.go b/sdk/resource/resource.go index cc45075c4ba..fcfa1089361 100644 --- a/sdk/resource/resource.go +++ b/sdk/resource/resource.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/resource/resource_test.go b/sdk/resource/resource_test.go index b0f2e6778ee..6df2865c0eb 100644 --- a/sdk/resource/resource_test.go +++ b/sdk/resource/resource_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/resource/resourcekeys/const.go b/sdk/resource/resourcekeys/const.go index 32cefc57d6f..5adc993ddda 100644 --- a/sdk/resource/resourcekeys/const.go +++ b/sdk/resource/resourcekeys/const.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/sdk/trace/sampling_test.go b/sdk/trace/sampling_test.go index c5165dc96d0..5a83a183c1e 100644 --- a/sdk/trace/sampling_test.go +++ b/sdk/trace/sampling_test.go @@ -1,4 +1,4 @@ -// Copyright 2020, OpenTelemetry Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.