Skip to content
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

Use SPDX license identifiers for license in shard.yml #641

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/shard.yml.adoc
Original file line number Diff line number Diff line change
@@ -204,8 +204,14 @@ libraries:
----

*license*::
An http://opensource.org/[OSI license] name 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 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_.

*repository*::
The URL of the project's canonical repository (string, recommended).
2 changes: 1 addition & 1 deletion docs/shard.yml.schema.json
Original file line number Diff line number Diff line change
@@ -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 expression or an URL to a license file."
},
"repository": {
"type": "string",
2 changes: 1 addition & 1 deletion spec/unit/spec_spec.cr
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion src/spec.cr
Original file line number Diff line number Diff line change
@@ -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