Skip to content

Commit

Permalink
Use SPDX copyright and license headers
Browse files Browse the repository at this point in the history
The modern way to specify copyright and license is using SPDX[1]
headers. This is nicer for developers and more friendly for programs
that want to extract this info.

This change was created by the ruse tool[2], using this command:

    reuse init
    ...
    reuse addheader \
        --copyright 'The RamenDR authors' \
        --license Apache-2.0 \
        --exclude-year \
        --skip-unrecognised \
        --template ramen \
        `git ls-files`

Few unrecognized files were modified manually.

The copyright excludes the years since this info is not really needed,
and this avoids the work of updating all copyrights every year.

The `LICENSE` file was moved to `LICENSES/Apache-2.0.txt`, so we can
check the project with the reuse tool. LICENSE is now a symbolic link to
`LICENSES/Apache-2.0.txt` to make GitHub and Go tools happy.

Checking the source with the ruse too show that we are not done yet:

    $ reuse lint
    # MISSING COPYRIGHT AND LICENSING INFORMATION

    The following files have no copyright and licensing information:
    * config/crd/bases/ramendr.openshift.io_drclusters.yaml
    * config/crd/bases/ramendr.openshift.io_drplacementcontrols.yaml
    * config/crd/bases/ramendr.openshift.io_drpolicies.yaml
    * config/crd/bases/ramendr.openshift.io_protectedvolumereplicationgrouplists.yaml
    * config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml

    # SUMMARY

    * Bad licenses:
    * Deprecated licenses:
    * Licenses without file extension:
    * Missing licenses:
    * Unused licenses:
    * Used licenses: Apache-2.0
    * Read errors: 0
    * Files with copyright information: 233 / 238
    * Files with license information: 233 / 238

    Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(

The files in `config/crd/bases` seems to be generated during the build
without the SPDX headers, and the CI sanity check fail the build. This
will be fixed in a later commit.

[1] https://spdx.dev/
[2] https://reuse.software/

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Oct 25, 2022
1 parent 5405a0b commit 0bf096d
Show file tree
Hide file tree
Showing 237 changed files with 840 additions and 1,009 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore all files which are not go type
!**/*.go
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
# yamllint disable rule:line-length

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

# Binaries for programs and plugins
*.exe
Expand Down
18 changes: 5 additions & 13 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
# yamllint disable rule:line-length
# Ref template: https://github.com/golangci/golangci-lint/blob/v1.37.1/.golangci.example.yml
Expand Down Expand Up @@ -26,19 +29,8 @@ linters-settings:
min-complexity: 15
goheader:
template: |
Copyright 2021 The RamenDR 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-FileCopyrightText: The RamenDR authors
SPDX-License-Identifier: Apache-2.0
misspell:
locale: US
wsl:
Expand Down
10 changes: 10 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Ramen
Upstream-Contact: The RamenDR authors
Source: https://github.com/RamenDR/ramen

# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
6 changes: 6 additions & 0 deletions .reuse/templates/ramen.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}
13 changes: 9 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<!--
SPDX-FileCopyrightText: The RamenDR authors
SPDX-License-Identifier: Apache-2.0
-->

# How to Contribute

The Ramen project in under [Apache 2.0 license](LICENSE). We accept
contributions via GitHub pull requests. This document outlines some of the
conventions related to development workflow to make it easier to get your
contribution accepted.
The Ramen project in under [Apache 2.0 license](LICENSES/Apache-2.0.txt).
We accept contributions via GitHub pull requests. This document outlines
some of the conventions related to development workflow to make it
easier to get your contribution accepted.

## Certificate of Origin

Expand Down
3 changes: 3 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
SPDX-FileCopyrightText: The RamenDR authors
SPDX-License-Identifier: Apache-2.0

Developer Certificate of Origin
Version 1.1

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

# Build the manager binary
FROM golang:1.18 as builder

Expand Down
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Loading

0 comments on commit 0bf096d

Please sign in to comment.