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
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion docs/shard.yml.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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_.
leoheitmannruiz marked this conversation as resolved.
Show resolved Hide resolved

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