From 7c9cc5d0f035e5ddd0a114febb79c27c5e5f9b7e Mon Sep 17 00:00:00 2001 From: Peter Springsteen Date: Wed, 24 Mar 2021 02:44:08 -0400 Subject: [PATCH] fix workflow, schema required fix #patch (#4) --- .github/workflows/push-main.yml | 1 + README.md | 31 +++++++++++++++++++++++++++++++ okv/schemas/okh.yaml | 9 +++------ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push-main.yml b/.github/workflows/push-main.yml index c9d55fd..a2691e6 100644 --- a/.github/workflows/push-main.yml +++ b/.github/workflows/push-main.yml @@ -6,6 +6,7 @@ on: jobs: deploy: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Bump version and push tag diff --git a/README.md b/README.md index 98aa108..48f715e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,37 @@ with: path: './some/path/to/file.yaml' ``` +## CLI usage + +``` +usage: okv [-h] [-path [PATH]] [-s SCHEMA] [-n CPU_NUM] [-p PARSER] [--no-strict] [--no-error] [--ok OK] + +Validate yaml files. + +optional arguments: + -h, --help show this help message and exit + -path [PATH] folder to validate. Default is current directory. + -s SCHEMA, --schema SCHEMA + filename of schema. Default is schema.yaml. + -n CPU_NUM, --cpu-num CPU_NUM + number of CPUs to use. Default is 4. + -p PARSER, --parser PARSER + YAML library to load files. Choices are "ruamel" or "pyyaml" (default). + --no-strict Disable strict mode, unexpected elements in the data will be accepted. + --no-error Ignore error when violation of schema is identified. + --ok OK This indicates which Open Know specification to use. +``` + +## Docker + +### Usage + +The Docker image accepts all of the [CLI arguments as detailed above](#cli-usage). + +``` +docker run --rm -v ${PWD}/:/tmp/ ok-validate --ok=okh -path=/tmp/path/to/okh-file.yaml +``` + ## Automatic releasing diff --git a/okv/schemas/okh.yaml b/okv/schemas/okh.yaml index 7ee1db8..e6e4d2b 100644 --- a/okv/schemas/okh.yaml +++ b/okv/schemas/okh.yaml @@ -7,8 +7,6 @@ # Manifest metadata -# ps, we're keeping regex errors for emails + url whether they're required or not bc of web dev things ~ sea -# this has both project link and doc home in it date-created: day() date-updated: day() manifest-author: @@ -40,7 +38,7 @@ health-safety-notice: str(required=False) # paragraph contact: include('contact-kit', required=False) # currently listed as required, -contributors: list(include('nonessential-contact'),required=False) # recommended +contributors: list(include('nonessential-contact'), required=False) # recommended image: regex('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+((.gif)|(.png)|(.jpg)|(.jpeg))$', name="valid image url", required=False) version: str(required=False) # text @@ -105,7 +103,7 @@ standards-used: standard-title: str() # Required where used | Title of the standard used in developing the design or documentation publisher: str(required=False) # Publisher of the standard reference: str(required=False) # Reference indentifier of the standard (e.g. ISO 9001) - certification: list(include('certification', required=False)) + certification: list(include('certification'), required=False) list-item: path: include('url-type', required=False) @@ -122,8 +120,7 @@ contact-kit: email: regex('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$', required=False) social: list(include('social-list-item'), required=False) -license-item: any(include('license-item-a'), include('license-item-b'),include('license-item-c')) -# if there's a more optimized way to do that pls lmk ~ SEA +license-item: any(include('license-item-a'), include('license-item-b'), include('license-item-c')) --- # {license-list} is not a map comes from here license-item-a: