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

Add JSON schema file for output of reuse lint --json to website #55

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Files: reuse-docs/*
Copyright: 2019 Free Software Foundation Europe <https://fsfe.org>
License: CC-BY-SA-4.0

Files: site/static/schemas/*
Copyright: 2023 Free Software Foundation Europe <https://fsfe.org>
License: CC0-1.0

Files: site/static/fonts/roboto/*
Copyright: 2018 Google
License: Apache-2.0
Expand Down
176 changes: 176 additions & 0 deletions site/static/schemas/1.0.0_lint_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"$schema": "https://reuse.software/schemas/1.0.0_lint_schema.json",
"$ref": "#/definitions/Result",
"definitions": {
"Result": {
"type": "object",
"additionalProperties": false,
"properties": {
"lint_version": {
"type": "string"
},
"reuse_spec_version": {
"type": "string"
},
"reuse_tool_version": {
"type": "string"
},
"files": {
"type": "array",
"items": {
"$ref": "#/definitions/File"
}
},
"non_compliant": {
"$ref": "#/definitions/NonCompliant"
},
"summary": {
"$ref": "#/definitions/Summary"
}
},
"required": [
"files",
"lint_version",
"non_compliant",
"reuse_spec_version",
"reuse_tool_version",
"summary"
],
"title": "Welcome"
},
"File": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
},
"copyrights": {
"type": "array",
"items": {
"$ref": "#/definitions/Copyright"
}
},
"licenses": {
"type": "array",
"items": {
"$ref": "#/definitions/Copyright"
}
}
},
"required": ["copyrights", "licenses", "path"],
"title": "File"
},
"Copyright": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "string"
},
"source": {
"type": "string"
}
},
"required": ["source", "value"],
"title": "Copyright"
},
"NonCompliant": {
"type": "object",
"additionalProperties": false,
"properties": {
"missing_licenses": {
"$ref": "#/definitions/MissingLicenses"
},
"unused_licenses": {
"type": "array",
"items": {}
},
"deprecated_licenses": {
"type": "array",
"items": {}
},
"bad_licenses": {
"$ref": "#/definitions/BadLicenses"
},
"licenses_without_extension": {
"$ref": "#/definitions/LicensesWithoutExtension"
},
"missing_copyright_info": {
"type": "array",
"items": {
"type": "string"
}
},
"missing_licensing_info": {
"type": "array",
"items": {
"type": "string"
}
},
"read_errors": {
"type": "array",
"items": {}
}
},
"required": [
"bad_licenses",
"deprecated_licenses",
"licenses_without_extension",
"missing_copyright_info",
"missing_licenses",
"missing_licensing_info",
"read_errors",
"unused_licenses"
],
"title": "NonCompliant"
},
"BadLicenses": {
"type": "object",
"additionalProperties": { "type": "object" },
"title": "BadLicenses"
},
"LicensesWithoutExtension": {
"type": "object",
"additionalProperties": { "type": "object" },
"title": "LicensesWithoutExtension"
},
"MissingLicenses": {
"type": "object",
"additionalProperties": { "type": "object" },
"title": "MissingLicenses"
},
"Summary": {
"type": "object",
"additionalProperties": false,
"properties": {
"used_licenses": {
"type": "array",
"items": {
"type": "string"
}
},
"files_total": {
"type": "integer"
},
"files_with_copyright_info": {
"type": "integer"
},
"files_with_licensing_info": {
"type": "integer"
},
"compliant": {
"type": "boolean"
}
},
"required": [
"compliant",
"files_total",
"files_with_copyright_info",
"files_with_licensing_info",
"used_licenses"
],
"title": "Summary"
}
}
}
6 changes: 6 additions & 0 deletions sync-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ for f in faq.md spec.md tutorial.md; do
done
done

# Define variable
lint_schema_version="1.0.0"
lint_schema="$basedir"/reuse-docs/"$lint_schema_version"_lint_schema.json
# Copy this file to
cp "$lint_schema" "$basedir"/site/static/schemas

# Make permissions of newly generated folders the same as the already existing files
uidgid=$(stat -c '%u:%g' "$basedir")
chown -R "$uidgid" "$basedir"