-
Notifications
You must be signed in to change notification settings - Fork 18
Create REUSE.toml schema #109
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
base: main
Are you sure you want to change the base?
Conversation
921aca9
to
12780eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the schema with the Taplo extension in VSCodium:
- ✔️ Hints for key value pairs work
- ✔️ Typing
[[
only suggest[[annotations]]
- ✔️ An empty
[[annotations]]
table shows the error message thatpath
is required ⚠️ Typing[
suggests[SPDX-PrimaryPackagePurpose]
, which seems to be wrong. I have no idea, where this strange suggestion is coming from.⚠️ The suggestions have some duplications. Inside the[[annotations]]
table:

I don't know where this coming from or if that is maybe a bug in Taplo and not in the schema.
You can use this configuration in a .taplo.toml
file to test the schema:
[[rule]]
include = ["**/REUSE.toml"]
[rule.schema]
path = "https://raw.githubusercontent.com/carmenbianca/reuse-website/refs/heads/tomlschema/site/static/reuse-toml-v1.schema.json"
(After merge and deploying this PR the path
value should be https://reuse.software/reuse-toml-v1.schema.json)
855234a
to
fe6382b
Compare
The specification explicitly does not define the semantics of other keys, so we shouldn't define them here. Especially with autocomplete, and also by adding type restrictions, including these keys might give the impression that they are semantically significant somehow.
82f42ed
to
f05802d
Compare
Hi @BaumiCoder, thanks for the review!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, maybe without the SPDX tags it is more correct in respect of the current specification. The duplicated suggestion seems to be really related to the types. When pressing Ctrl
+ Space
to get the suggestion, I tried both path
options inside a [[annotations]]
. One gives a path = ""
and the other one gives path = []
. So, one for every type.
Thank you, for your effort.
I ran the schema through a tool https://github.com/sourcemeta/jsonschema to lint it (which I often do as I'm always learning new things about json schemas). Here are the suggestions from it:
https://json-schema.org/understanding-json-schema/reference/object#additionalproperties Hope this helps. |
It is superfluous. sourcemeta-jsonschema's linter complains about its usage.
<https://reuse.software/reuse-toml-v1.schema.json>. This Specification remains | ||
authoritative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Specification → The REUSE specification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: [...] is provided at [...] for your convenience.
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://reuse.software/reuse-toml-v1.schema.json", | ||
"$comment": "See https://reuse.software/spec-3.2/ for details", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point to https://reuse.software/
No description provided.