GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - publiccodeyml/libpubliccode: publiccode.yml parser library and validator in Go

BranchesTags
Open more actions menu

Latest commit

 

History

635 Commits
635 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
data
data
 
 
internal
internal
 
 
publiccode-parser
publiccode-parser
 
 
testdata
testdata
 
 
validators
validators
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.golangci.yaml
.golangci.yaml
 
 
.goreleaser.yml
.goreleaser.yml
 
 
AUTHORS
AUTHORS
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Dockerfile.goreleaser
Dockerfile.goreleaser
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
errors.go
errors.go
 
 
errors_test.go
errors_test.go
 
 
example_test.go
example_test.go
 
 
fields.go
fields.go
 
 
fields_test.go
fields_test.go
 
 
fields_v1_test.go
fields_v1_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
helpers_test.go
helpers_test.go
 
 
marshallers.go
marshallers.go
 
 
marshallers_test.go
marshallers_test.go
 
 
parser.go
parser.go
 
 
parser_extra_test.go
parser_extra_test.go
 
 
parser_http_test.go
parser_http_test.go
 
 
parser_internal_test.go
parser_internal_test.go
 
 
parser_ssrf_test.go
parser_ssrf_test.go
 
 
parser_test.go
parser_test.go
 
 
publiccode.go
publiccode.go
 
 
publiccode.yml
publiccode.yml
 
 
useragent.go
useragent.go
 
 
useragent_test.go
useragent_test.go
 
 
v0.go
v0.go
 
 
v0_test.go
v0_test.go
 
 
v0v1methods_test.go
v0v1methods_test.go
 
 
v1.go
v1.go
 
 
v1_stream_test.go
v1_stream_test.go
 
 
v1_test.go
v1_test.go
 
 
validations.go
validations.go
 
 
validations_test.go
validations_test.go
 
 

Repository files navigation

publiccode.yml parser for Go

A Go parser and validator for publiccode.yml files.

publiccode.yml is an international standard for describing public software, which should be placed at the root of Free/Libre and Open Source software repositories.

This parser performs syntactic and semantic validation according to the official spec.

Features

  • Go library and CLI tool (publiccode-parser)
  • Supports the latest version of the publiccode.yml Standard
  • publiccode-parser can output validation errors as JSON or in errorformat friendly way
  • Verifies the existence of URLs by checking the response for URL fields (can be disabled)

As a library

parser, err := publiccode.NewDefaultParser()

// error handling

publiccode, err := parser.Parse("/path/to/local/dir/publiccode.yml")
// OR
// parse.Parse("https://github.com/example/example/publiccode.yml")

Go Reference

From command line

The publiccode-parser binary can be used to validate a publiccode.yml from the command line.

To get the latest version use:

go install github.com/publiccodeyml/libpubliccode/v5/publiccode-parser@latest

Or get a precompiled package from the release page

Example:

$ publiccode-parser mypubliccode.yml
mypubliccode.yml:36:1: error: developmentStatus: developmentStatus must be one of the following: "concept", "development", "beta", "stable" or "obsolete"
mypubliccode.yml:48:3: warning: legal.authorsFile: This key is DEPRECATED and will be removed in the future. It's safe to drop it
mypubliccode.yml:12:5: warning: description.en.genericName: This key is DEPRECATED and will be removed in the future. It's safe to drop it

Run publiccode-parser --help for the available command line flags.

The tool returns 0 in case of successful validation, 1 when the file has validation errors or can't be read and 2 when it's invoked with no file argument or an unknown flag.

With --json the same exit codes apply and the output is always a JSON list, empty when there is nothing to report.

Contributing

Contributing is always appreciated. Feel free to open issues, fork or submit a Pull Request. If you want to know more about how to add new fields, check out the publiccode.yml project and its CONTRIBUTING.md guidelines.

See also

  • publiccode-parser-php - PHP bindings for this library
  • publiccode-crawler - a Go crawler that uses this library

Maintainers

This software is maintained by community contributors.

License

Licensed under the EUPL 1.2. The version control system provides attribution for specific lines of code.

About

publiccode.yml parser library and validator in Go

publiccodeyml.github.io

Topics

golanggolang-libraryhacktoberfestparserpubliccodepubliccodeymlvalidatoryaml

Resources

Readme
EUPL-1.2 license

Security policy

Security policy
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.