Skip to content

Add CI workflow to check the license file #10

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

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

MatteoPologruto
Copy link
Contributor

Whenever one of the recognized license file names are modified in the repository, the workflow runs licensee to check whether the license can be recognized and whether it is of the expected type.

GitHub has a useful automated license detection system that determines the license type used by a repository, and surfaces that information in the repository home page, the search web interface, and the GitHub API. This license detection system requires that the license be defined by a dedicated file with one of several standardized filenames and paths.

GitHub's license detection system uses the popular licensee tool, so this file also serves to define the license type for any other usages of licensee, as well as to human readers of the file.

For this reason, and to ensure it remains a valid legal instrument, it's important that there be no non-standard modifications to the license file or collisions with other supported license files. This workflow ensures that any changes which would change the license type or which license file is used by the detection are caught automatically.


The workflow is currently failing because the detected license type is NOASSERTION when it should be GPL-2.0. I ran licensee detect locally, this is the result:

License:        NOASSERTION
Matched files:  LICENSE.txt
LICENSE.txt:
  Content hash:  3861c30b1ebca65579e8d440ba2967ba252bf8c8
  License:       NOASSERTION
  Closest non-matching licenses:
    LGPL-2.1 similarity:  29.25%
    GPL-3.0 similarity:   29.11%
    AGPL-3.0 similarity:  28.21%

This is the result of licensee diff --license gpl-2.0:

Input Length:     38574
License length:   14675
Similarity:      16.02%
diff --git a/LICENSE b/LICENSE
index b949fa1..4a8614c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,114 +1,113 @@

Is this happening because the license is outdated? Should we bump it to GPL-3.0?

@MatteoPologruto MatteoPologruto added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Mar 15, 2023
@MatteoPologruto MatteoPologruto self-assigned this Mar 15, 2023
@cmaglie
Copy link
Member

cmaglie commented Mar 16, 2023

Actually, the LICENSE.txt is the union of gpl-2.0 and lgpl-2.1 📜
Probably we should just migrate to gpl-3.0 or bsd-3-clause.

I prefer bsd-3-clause since it's more permissive, @alranel WDYT?

Whenever one of the recognized license file names are modified in the repository, the workflow runs to check whether the
license can be recognized and whether it is of the expected type.

GitHub has a useful automated license detection system that determines the license type used by a repository, and
surfaces that information in the repository home page, the search web interface, and the GitHub API. This license
detection system requires that the license be defined by a dedicated file with one of several standardized filenames and
paths.

GitHub's license detection system uses the popular licensee tool, so this file also serves to define the license type
for any other usages of licensee, as well as to human readers of the file.

For this reason, and to ensure it remains a valid legal instrument, it's important that there be no non-standard
modifications to the license file or collisions with other supported license files. This workflow ensures that any
changes which would change the license type or which license file is used by the detection are caught automatically.
@MatteoPologruto MatteoPologruto merged commit d83c157 into arduino:master Mar 28, 2023
@MatteoPologruto MatteoPologruto deleted the add-check-license branch March 28, 2023 06:58
Comment on lines -1 to -29
/*
* This file is part of go-win32-utils.
*
* Copyright 2018-2023 ARDUINO SA (http://www.arduino.cc/)
*
* go-win32-utils is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes the license header from the files.

I think that there must be a license header like:

//
// Copyright 2018-2023 ARDUINO SA. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

Comment on lines -30 to -31
// Package win32 is a collection of useful bindings to Win32 API that are not available in the standard
// golang windows/syscall package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the package description, it should not be removed.

@MatteoPologruto MatteoPologruto mentioned this pull request Jun 19, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants