From 6e1c54077972b88f107d05703b440bc0bb588304 Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Thu, 12 Sep 2024 16:27:18 +0200 Subject: [PATCH 1/6] Use SPDX license identifiers for `license` --- docs/shard.yml.adoc | 7 ++++++- docs/shard.yml.schema.json | 2 +- src/spec.cr | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/shard.yml.adoc b/docs/shard.yml.adoc index 1cf4092a..6d538d76 100644 --- a/docs/shard.yml.adoc +++ b/docs/shard.yml.adoc @@ -204,8 +204,13 @@ libraries: ---- *license*:: - An http://opensource.org/[OSI license] name or an URL to a license file +An https://spdx.org/licenses/[SPDX license identifier] or an URL to a license file (string, recommended). ++ +The OSI publishes https://opensource.org/licenses-old/category[a list] of open +source licenses and their corresponding SPDX identifier. ++ +Examples: _Apache-2.0_, _MIT_, _GPL-3.0-or-later_. *repository*:: The URL of the project's canonical repository (string, recommended). diff --git a/docs/shard.yml.schema.json b/docs/shard.yml.schema.json index 60e13fc7..cf70df76 100644 --- a/docs/shard.yml.schema.json +++ b/docs/shard.yml.schema.json @@ -212,7 +212,7 @@ "license": { "type": "string", "title": "license", - "description": "An OSI license name or an URL to a license file" + "description": "An SPDX license identifier or an URL to a license file" }, "repository": { "type": "string", diff --git a/src/spec.cr b/src/spec.cr index a450dcba..0d23cc89 100644 --- a/src/spec.cr +++ b/src/spec.cr @@ -218,7 +218,7 @@ module Shards if license =~ %r(https?://) license else - "http://opensource.org/licenses/#{license}" + "https://spdx.org/licenses/#{license}" end end end From c2e7217651c690471d9b5b1e8601d4090782223b Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Thu, 12 Sep 2024 16:37:03 +0200 Subject: [PATCH 2/6] Update test --- spec/unit/spec_spec.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/spec_spec.cr b/spec/unit/spec_spec.cr index 127aca5d..a69ebaef 100644 --- a/spec/unit/spec_spec.cr +++ b/spec/unit/spec_spec.cr @@ -29,7 +29,7 @@ module Shards it "parse license" do spec = Spec.from_yaml("name: shards\nversion: 0.1.0\nlicense: BSD-2-Clause") spec.license.should eq("BSD-2-Clause") - spec.license_url.should eq("http://opensource.org/licenses/BSD-2-Clause") + spec.license_url.should eq("https://spdx.org/licenses/BSD-2-Clause") spec = Spec.from_yaml("name: shards\nversion: 0.1.0\nlicense: http://example.com/LICENSE") spec.license.should eq("http://example.com/LICENSE") From 4648bafe13761f19a41ed5421398a98d2fd7a391 Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Tue, 24 Sep 2024 18:23:28 +0200 Subject: [PATCH 3/6] Add example for URL pointing to custom license --- docs/shard.yml.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shard.yml.adoc b/docs/shard.yml.adoc index 6d538d76..1dd92d0d 100644 --- a/docs/shard.yml.adoc +++ b/docs/shard.yml.adoc @@ -210,7 +210,7 @@ An https://spdx.org/licenses/[SPDX license identifier] or an URL to a license fi The OSI publishes https://opensource.org/licenses-old/category[a list] of open source licenses and their corresponding SPDX identifier. + -Examples: _Apache-2.0_, _MIT_, _GPL-3.0-or-later_. +Examples: _Apache-2.0_, _MIT_, _GPL-3.0-or-later_, _https://example.com/LICENSE_. *repository*:: The URL of the project's canonical repository (string, recommended). From b1855db70e3f764bacfcaed26111c3dacb426b45 Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Sat, 26 Oct 2024 14:04:25 +0200 Subject: [PATCH 4/6] Allow for SPDX license expression --- docs/shard.yml.adoc | 7 ++++--- docs/shard.yml.schema.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/shard.yml.adoc b/docs/shard.yml.adoc index 1dd92d0d..76b40aac 100644 --- a/docs/shard.yml.adoc +++ b/docs/shard.yml.adoc @@ -204,13 +204,14 @@ libraries: ---- *license*:: -An https://spdx.org/licenses/[SPDX license identifier] or an URL to a license file -(string, recommended). +An https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/[SPDX license expression] +or an URL to a license file (string, recommended). + The OSI publishes https://opensource.org/licenses-old/category[a list] of open source licenses and their corresponding SPDX identifier. + -Examples: _Apache-2.0_, _MIT_, _GPL-3.0-or-later_, _https://example.com/LICENSE_. +Examples: _Apache-2.0_, _GPL-3.0-or-later_, _Apache-2.0 OR MIT_, +_Apache-2.0 WITH Swift-exception_, _https://example.com/LICENSE_. *repository*:: The URL of the project's canonical repository (string, recommended). diff --git a/docs/shard.yml.schema.json b/docs/shard.yml.schema.json index cf70df76..6f7783ff 100644 --- a/docs/shard.yml.schema.json +++ b/docs/shard.yml.schema.json @@ -212,7 +212,7 @@ "license": { "type": "string", "title": "license", - "description": "An SPDX license identifier or an URL to a license file" + "description": "An SPDX license expression or an URL to a license file." }, "repository": { "type": "string", From 41845d2407b72abae7c6d853d6352a7fac190b81 Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Sat, 26 Oct 2024 14:12:12 +0200 Subject: [PATCH 5/6] Typo --- docs/shard.yml.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shard.yml.adoc b/docs/shard.yml.adoc index 76b40aac..b08aa7dc 100644 --- a/docs/shard.yml.adoc +++ b/docs/shard.yml.adoc @@ -208,7 +208,7 @@ An https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/[SPD or an URL to a license file (string, recommended). + The OSI publishes https://opensource.org/licenses-old/category[a list] of open -source licenses and their corresponding SPDX identifier. +source licenses and their corresponding SPDX identifiers. + Examples: _Apache-2.0_, _GPL-3.0-or-later_, _Apache-2.0 OR MIT_, _Apache-2.0 WITH Swift-exception_, _https://example.com/LICENSE_. From 388148f8895c5dfe5743d0b4cfa7a75b38a59dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 16 Dec 2024 13:46:04 +0100 Subject: [PATCH 6/6] Update manpages --- man/shard.yml.5 | 20 ++++++++++++++------ man/shards.1 | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/man/shard.yml.5 b/man/shard.yml.5 index ff1ca430..8f03b038 100644 --- a/man/shard.yml.5 +++ b/man/shard.yml.5 @@ -2,12 +2,12 @@ .\" Title: shard.yml .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-28 +.\" Date: 2024-10-26 .\" Manual: File Formats .\" Source: shards 0.18.0 .\" Language: English .\" -.TH "SHARD.YML" "5" "2024-03-28" "shards 0.18.0" "File Formats" +.TH "SHARD.YML" "5" "2024-10-26" "shards 0.18.0" "File Formats" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -434,10 +434,18 @@ libraries: .sp \fBlicense\fP .RS 4 - An \c -.URL "http://opensource.org/" "OSI license" "" -name or an URL to a license file -(string, recommended). +An \c +.URL "https://spdx.github.io/spdx\-spec/v3.0.1/annexes/spdx\-license\-expressions/" "SPDX license expression" +or an URL to a license file (string, recommended). +.sp +The OSI publishes \c +.URL "https://opensource.org/licenses\-old/category" "a list" "" +of open +source licenses and their corresponding SPDX identifiers. +.sp +Examples: \fIApache\-2.0\fP, \fIGPL\-3.0\-or\-later\fP, \fIApache\-2.0 OR MIT\fP, +\fIApache\-2.0 WITH Swift\-exception\fP, \fI\c +.URL "https://example.com/LICENSE" "" "\fP." .RE .sp \fBrepository\fP diff --git a/man/shards.1 b/man/shards.1 index 0b42a26f..d0be3139 100644 --- a/man/shards.1 +++ b/man/shards.1 @@ -2,12 +2,12 @@ .\" Title: shards .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-28 +.\" Date: 2024-10-26 .\" Manual: Shards Manual .\" Source: shards 0.18.0 .\" Language: English .\" -.TH "SHARDS" "1" "2024-03-28" "shards 0.18.0" "Shards Manual" +.TH "SHARDS" "1" "2024-10-26" "shards 0.18.0" "Shards Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0