Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license check #825

Merged
merged 10 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# 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.


.github
docs
Expand Down
14 changes: 1 addition & 13 deletions .env
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# 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.


# Images
IMAGE_VERSION=1.3.1
Expand Down
14 changes: 1 addition & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# 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.


* text=auto

Expand Down
2 changes: 2 additions & 0 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# this file is used by .github/workflows/assign-reviewers.yml
components:
src/adservice:
Expand Down
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/assign-reviewers.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# assigns reviewers to pull requests in a similar way as CODEOWNERS, but doesn't require reviewers
# to have write access to the repository
# see .github/component_owners.yaml for the list of components and their owners
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: Checks

on:
Expand Down Expand Up @@ -62,3 +64,13 @@ jobs:

- name: run sanitycheck.py
run: python3 ./internal/tools/sanitycheck.py

checklicense:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v3
- name: install tools
run: make install-tools
- name: run checklicense
run: make checklicense
2 changes: 2 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: Gradle wrapper validation
on:
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: "Build and Publish"

on:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Github Actions Stale: https://github.com/actions/stale

Expand Down
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# 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.


*~
*.iml
Expand Down
38 changes: 38 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"**/*.{go,cs,h,cpp,js,ts,tsx,rs}": [
"// Copyright The OpenTelemetry Authors",
"// SPDX-License-Identifier: Apache-2.0"
],
"**/*.php": [
"<?php",
"// Copyright The OpenTelemetry Authors",
"// SPDX-License-Identifier: Apache-2.0"
],
"**/*.java": [
"/*",
"* Copyright The OpenTelemetry Authors",
"* SPDX-License-Identifier: Apache-2.0",
"*/"
],
"**/*.py": [
"#!/usr/bin/python",
"# Copyright The OpenTelemetry Authors",
"# SPDX-License-Identifier: Apache-2.0"
],
"**/*.{ex,exs,rb,yaml,yml,sh,yamllint}": [
"# Copyright The OpenTelemetry Authors",
"# SPDX-License-Identifier: Apache-2.0"
],
"**/{Dockerfile,Makefile}": [
"# Copyright The OpenTelemetry Authors",
"# SPDX-License-Identifier: Apache-2.0"
],
"ignore": [
"node_modules/",
"src/cartservice/src/obj/",
"src/cartservice/tests/obj/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
"internal/tools/"
]
}
13 changes: 1 addition & 12 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# 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.
# SPDX-License-Identifier: Apache-2.0

# Default state for all rules
default: true
Expand Down
14 changes: 1 addition & 13 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# 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.

# SPDX-License-Identifier: Apache-2.0
extends: default

ignore-from-file: [.gitignore, .yamlignore]
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# 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.
# SPDX-License-Identifier: Apache-2.0


# All documents to be used in spell check.
ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path '*/node_modules/*' -not -path '*/_build/*' -not -path '*/deps/*' | sort)
Expand Down Expand Up @@ -57,9 +47,19 @@ install-yamllint:
yamllint:
yamllint .

.PHONY: checklicense
checklicense:
@echo "Checking license headers..."
npx @kt3k/license-checker -q

.PHONY: addlicense
addlicense:
@echo "Adding license headers..."
npx @kt3k/license-checker -q -i

# Run all checks in order of speed / likely failure.
.PHONY: check
check: misspell markdownlint
check: misspell markdownlint checklicense
@echo "All checks complete"

# Attempt to fix issues / regenerate tables.
Expand Down
14 changes: 2 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# 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.
# SPDX-License-Identifier: Apache-2.0


version: '3.9'
x-default-logging: &logging
Expand Down
16 changes: 3 additions & 13 deletions ide-gen-proto.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
#!/bin/sh
# 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.
# SPDX-License-Identifier: Apache-2.0
#!/bin/sh


# This script is used to generate protobuf files for all services.
# Useful to ensure code can compile without Docker, and provide hints for IDEs.
Expand Down
14 changes: 1 addition & 13 deletions internal/tools/sanitycheck.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/env python3

# 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.


import glob
import os
Expand Down
14 changes: 1 addition & 13 deletions internal/tools/tools.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
// Copyright 2019, 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.
//

//go:build tools
// +build tools

package tools
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/opentelemetry-demo.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
---
# Source: opentelemetry-demo/charts/grafana/templates/serviceaccount.yaml
apiVersion: v1
Expand Down
Loading