Validate publiccode.yml files against the publiccode.yml Spec, in CI or from the command line
784
Validates publiccode.yml files against the official Standard.
publiccode.yml is an international standard for describing public software. The file sits at the root of Free/Libre and Open Source software repositories.
The image runs publiccode-parser, the command line tool from libpubliccode. It checks the syntax and meaning of each key and reports errors and deprecation warnings with their line and column.
Run it from the directory that contains your publiccode.yml:
docker run --rm -v "$PWD":/files publiccodeyml/libpubliccode
By default the image validates /files/publiccode.yml. To validate a different file, pass its path inside the container:
docker run --rm -v "$PWD":/files publiccodeyml/libpubliccode /files/path/to/publiccode.yml
Example output:
publiccode.yml:36:1: error: developmentStatus: developmentStatus must be one of the following: "concept", "development", "beta", "stable" or "obsolete"
publiccode.yml:48:3: warning: legal.authorsFile: This key is DEPRECATED and will be removed in the future. It's safe to drop it
Options go before the file path:
docker run --rm -v "$PWD":/files publiccodeyml/libpubliccode --no-network /files/publiccode.yml
| Option | Effect |
|---|---|
--no-network | Skip checks that need the network (URL existence, oEmbed). Much faster. |
--no-external-checks | Skip all checks on remote URLs and local files. Implies --no-network. |
--path DIR | Look up referenced files (logo, authors file) in DIR instead of the url |
--timeout 10s | Timeout for each HTTP request. Default 30s. |
--json | Print the results as a JSON list, empty when there is nothing to report. |
--version | Print the version. |
--help | Print the usage. |
0: the file is valid1: the file has validation errors or cannot be read2: no file argument or an unknown optionGitLab CI:
publiccode:
image:
name: publiccodeyml/libpubliccode:latest
entrypoint: [""]
script:
- publiccode-parser --path . publiccode.yml
The image includes git and openssh-client, so CI systems that check out code inside the container work too.
latest: the most recent releasevX.Y.Z: a specific release, multi-arch (linux/amd64, linux/arm64)vX.Y.Z-amd64, vX.Y.Z-arm64: a single architecturePin a vX.Y.Z tag in CI to keep results stable across releases.
Source code, issues and releases: https://github.com/publiccodeyml/libpubliccode
Licensed under the EUPL 1.2.
Content type
Image
Digest
sha256:97a8a4119…
Size
15.2 MB
Last updated
5 days ago
docker pull publiccodeyml/libpubliccode