Skip to content

Commit e05a235

Browse files
Add license header file and script (#1256)
* add license header file Signed-off-by: Michael Valdron <[email protected]> * addlicense script Signed-off-by: Michael Valdron <[email protected]> * update README with instructions on adding license headers Signed-off-by: Michael Valdron <[email protected]> * update license headers under source files Signed-off-by: Michael Valdron <[email protected]> * remove license header from generated source Signed-off-by: Michael Valdron <[email protected]> * add_license.sh ignores zz_generated.* source files Signed-off-by: Michael Valdron <[email protected]> * check license headers script added Signed-off-by: Michael Valdron <[email protected]> * check license headers script added to CI workflow Signed-off-by: Michael Valdron <[email protected]> --------- Signed-off-by: Michael Valdron <[email protected]>
1 parent f331a0b commit e05a235

File tree

163 files changed

+2584
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+2584
-82
lines changed

Diff for: .codecov.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# See http://docs.codecov.io/docs/coverage-configuration
218
coverage:
319
precision: 2 # 2 = xx.xx%, 0 = xx%

Diff for: .devfile.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2022 Red Hat, Inc.
1+
#
2+
#
3+
# Copyright Red Hat
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
46
# you may not use this file except in compliance with the License.
@@ -11,7 +13,6 @@
1113
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214
# See the License for the specific language governing permissions and
1315
# limitations under the License.
14-
#
1516
schemaVersion: 2.1.0
1617
metadata:
1718
name: devfile-api

Diff for: .devfile/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
116
FROM python:3-alpine
217
ENV GOROOT /usr/lib/go
318

Diff for: .devfile/entrypoint.sh

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
#!/bin/bash
2+
#
3+
#
4+
# Copyright Red Hat
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
217

318
# Ensure $HOME exists when starting
419
if [ ! -d "${HOME}" ]; then

Diff for: .github/workflows/che.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Add Che link on PRs
218
name: Che
319

Diff for: .github/workflows/ci.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
name: CI
218

319
# Triggers the workflow on push or pull request events but only for the main branch
@@ -38,6 +54,12 @@ jobs:
3854
- name: Validate samples against schemas
3955
run: bash ./docker-run.sh ./validate-samples.sh
4056

57+
- name: Check license headers
58+
run: |
59+
export PATH=$PATH:$(go env GOPATH)/bin
60+
go install github.com/google/addlicense@latest
61+
bash ./check_licenses.sh
62+
4163
- name: Run GO tests
4264
run: go test -coverprofile cover.out -v ./...
4365

Diff for: .github/workflows/codecov.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
name: Code Coverage Report
218
on:
319
push:

Diff for: .github/workflows/publish-devfile-schema.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
name: Publish Devfile Schema
218

319
# Triggers the workflow on push events but only for the main branch

Diff for: .github/workflows/release-devfile-schema.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
name: Release Devfile Schema
218

319
# Triggers the workflow when a release is published on GitHub.

Diff for: .github/workflows/release-typescript-models.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
# Release a typescript package to npm containing the typescript types generated from the latest merged crds
218
name: Release Typescript Models
319

Diff for: .github/workflows/stale.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
#
2+
#
3+
# Copyright Red Hat
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
name: Mark stale issues and pull requests
218

319
on:

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ Please see our [contributing.md](./CONTRIBUTING.md).
7373
## License
7474

7575
Apache License 2.0, see [LICENSE](./LICENSE) for details.
76+
77+
### Adding License Headers
78+
79+
[`license_header`](./license_header.txt) contains the license header to be contained under all source files. For Go sources, this can be included by running `bash add_licenses.sh`.
80+
81+
Ensure `github.com/google/addlicense` is installed by running `go install github.com/google/addlicense@latest`.

Diff for: add_licenses.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
#
3+
#
4+
# Copyright Red Hat
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# This script adds license headers that are missing from go files
19+
20+
21+
if ! command -v addlicense 2> /dev/null
22+
then
23+
echo "error addlicense must be installed with this command: go install github.com/google/addlicense@latest" && exit 1
24+
else
25+
echo 'addlicense -v -f license_header.txt **/*.go'
26+
addlicense -v -f license_header.txt $(find . -not -path '*/\.*' -not -path '*/vendor/*' -not -name 'zz_generated.*.go' -name '*.go')
27+
fi
28+
29+

Diff for: build-generator.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22
#
3-
# Copyright 2020-2022 Red Hat, Inc.
43
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
4+
# Copyright Red Hat
85
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
109
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
1617

1718
BLUE='\033[1;34m'
1819
GREEN='\033[0;32m'

Diff for: build.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22
#
3-
# Copyright 2020-2022 Red Hat, Inc.
43
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
4+
# Copyright Red Hat
85
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
109
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
1617

1718
BLUE='\033[1;34m'
1819
GREEN='\033[0;32m'

Diff for: build/typescript-model/generate-metadata.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#
2-
# Copyright 2021-2022 Red Hat, Inc.
32
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
3+
# Copyright Red Hat
74
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
98
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
1516

1617
import os
1718
import argparse

Diff for: build/typescript-model/generate-swagger-json.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#
2-
# Copyright 2021-2022 Red Hat, Inc.
32
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
3+
# Copyright Red Hat
74
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
98
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
1516

1617
import os
1718
import json

0 commit comments

Comments
 (0)