Sign inSign up

publiccodeyml/libpubliccode

By publiccodeyml

•Updated 5 days ago

Validate publiccode.yml files against the publiccode.yml Spec, in CI or from the command line

Image
Integration & delivery
Developer tools
0

784

publiccodeyml/libpubliccode repository overview

⁠publiccode.yml parser

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.

⁠Quick start

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

Options go before the file path:

docker run --rm -v "$PWD":/files publiccodeyml/libpubliccode --no-network /files/publiccode.yml
OptionEffect
--no-networkSkip checks that need the network (URL existence, oEmbed). Much faster.
--no-external-checksSkip all checks on remote URLs and local files. Implies --no-network.
--path DIRLook up referenced files (logo, authors file) in DIR instead of the url
--timeout 10sTimeout for each HTTP request. Default 30s.
--jsonPrint the results as a JSON list, empty when there is nothing to report.
--versionPrint the version.
--helpPrint the usage.

⁠Exit codes

  • 0: the file is valid
  • 1: the file has validation errors or cannot be read
  • 2: no file argument or an unknown option

⁠In CI

GitLab 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.

⁠Tags

  • latest: the most recent release
  • vX.Y.Z: a specific release, multi-arch (linux/amd64, linux/arm64)
  • vX.Y.Z-amd64, vX.Y.Z-arm64: a single architecture

Pin a vX.Y.Z tag in CI to keep results stable across releases.

⁠Source and license

Source code, issues and releases: https://github.com/publiccodeyml/libpubliccode⁠

Licensed under the EUPL 1.2.

Tag summary

Content type

Image

Digest

sha256:97a8a4119…

Size

15.2 MB

Last updated

5 days ago

docker pull publiccodeyml/libpubliccode