From a5fe4cac0f99e3973eb68e7a8db77565119b61f2 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Mon, 15 May 2023 11:54:49 +0200 Subject: [PATCH 1/3] add license header template --- license_header.tpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 license_header.tpl diff --git a/license_header.tpl b/license_header.tpl new file mode 100644 index 00000000000..5c7683a1f60 --- /dev/null +++ b/license_header.tpl @@ -0,0 +1,14 @@ +This file is part of arduino-cli. + +Copyright{{ if .Year }} {{.Year}}{{ end }} {{.Holder}} + +This software is released under the GNU General Public License version 3, +which covers the main part of arduino-cli. +The terms of this license can be found at: +https://www.gnu.org/licenses/gpl-3.0.en.html + +You can be released from the requirements of the above licenses by purchasing +a commercial license. Buying such a license is mandatory if you want to +modify or otherwise use the software for commercial activities involving the +Arduino software without disclosing the source code of your own applications. +To purchase a commercial license, send an email to license@arduino.cc. From af79ab64c2b43b5b1a2e05a717b2746e2848508a Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Mon, 15 May 2023 12:39:26 +0200 Subject: [PATCH 2/3] add CI checks and task command --- .github/workflows/check-go-task.yml | 35 +++++++++++++++++++++++++++++ Taskfile.yml | 6 +++++ 2 files changed, 41 insertions(+) diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index f68a4c62b76..b19f0a71072 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -219,6 +219,41 @@ jobs: - name: Check whether any tidying was needed run: git diff --color --exit-code + check-license-headers: + name: check-license-headers (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Check for missing license headers + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: | + task go:add-license-headers + git diff --color --exit-code + # Do a simple "smoke test" build for the modules with no other form of validation build: name: build (${{ matrix.module.path }}) diff --git a/Taskfile.yml b/Taskfile.yml index 77366378408..1373e1adde8 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -142,6 +142,12 @@ tasks: - easyjson arduino/cores/packageindex/index.go - easyjson arduino/libraries/librariesindex/json.go + go:add-license-headers: + desc: Add missing go license headers + cmds: + - go install github.com/google/addlicense@v1.1.1 + - addlicense -c "ARDUINO SA (http://www.arduino.cc/)" -f ./license_header.tpl **/*.go + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml markdown:check-links: desc: Check for broken links From cf53299ecc9bf18754a35c52717297a8863080ba Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Wed, 24 May 2023 12:14:55 +0200 Subject: [PATCH 3/3] add missing license headers --- arduino/discovery/testdata/cat/main.go | 15 +++++++++++++++ commands/lib/search_test.go | 15 +++++++++++++++ commands/sketch/new_test.go | 15 +++++++++++++++ configuration/configuration_schema_test.go | 15 +++++++++++++++ executils/testdata/delay/main.go | 15 +++++++++++++++ i18n/cmd/po/merge_test.go | 15 +++++++++++++++ internal/cli/arguments/completion.go | 15 +++++++++++++++ 7 files changed, 105 insertions(+) diff --git a/arduino/discovery/testdata/cat/main.go b/arduino/discovery/testdata/cat/main.go index bc179f81678..7f77910fe27 100644 --- a/arduino/discovery/testdata/cat/main.go +++ b/arduino/discovery/testdata/cat/main.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + // Echo stdin to stdout. // This program is used for testing purposes, to make it available on all // OS a tool equivalent to UNIX "cat". diff --git a/commands/lib/search_test.go b/commands/lib/search_test.go index 6785bee808c..3e861614e30 100644 --- a/commands/lib/search_test.go +++ b/commands/lib/search_test.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package lib import ( diff --git a/commands/sketch/new_test.go b/commands/sketch/new_test.go index 4ef67d50b2d..a0812448c6f 100644 --- a/commands/sketch/new_test.go +++ b/commands/sketch/new_test.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package sketch import ( diff --git a/configuration/configuration_schema_test.go b/configuration/configuration_schema_test.go index afc961ee52f..5b153c9e09b 100644 --- a/configuration/configuration_schema_test.go +++ b/configuration/configuration_schema_test.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package configuration import ( diff --git a/executils/testdata/delay/main.go b/executils/testdata/delay/main.go index caaa9b0ed94..883bb698f4e 100644 --- a/executils/testdata/delay/main.go +++ b/executils/testdata/delay/main.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package main import ( diff --git a/i18n/cmd/po/merge_test.go b/i18n/cmd/po/merge_test.go index 2540a4c7182..3bd0d729c77 100644 --- a/i18n/cmd/po/merge_test.go +++ b/i18n/cmd/po/merge_test.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package po import ( diff --git a/internal/cli/arguments/completion.go b/internal/cli/arguments/completion.go index 60844ed03cd..7d8a3ac74e4 100644 --- a/internal/cli/arguments/completion.go +++ b/internal/cli/arguments/completion.go @@ -1,3 +1,18 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + package arguments import (