Skip to content

Commit

Permalink
Merge pull request #452 from per1234/base-schema
Browse files Browse the repository at this point in the history
Install referenced "base" schema in validation tasks
  • Loading branch information
per1234 authored Jan 31, 2024
2 parents 5f576f2 + ccecf30 commit f4f08aa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ tasks:
SCHEMA_URL: https://json.schemastore.org/dependabot-2.0
SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="dependabot-schema-XXXXXXXXXX.json"
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base.json
BASE_SCHEMA_URL: https://json.schemastore.org/base.json
BASE_SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="base-schema-XXXXXXXXXX.json"
# The Dependabot configuration file for the repository.
DATA_PATH: ".github/dependabot.yml"
# The asset Dependabot configuration files.
Expand All @@ -372,17 +376,20 @@ tasks:
sh: task utility:mktemp-folder TEMPLATE="dependabot-validate-XXXXXXXXXX"
cmds:
- wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}}
- wget --quiet --output-document="{{.BASE_SCHEMA_PATH}}" {{.BASE_SCHEMA_URL}}
- |
npx ajv-cli validate \
--all-errors \
--strict=false \
-s "{{.SCHEMA_PATH}}" \
-r "{{.BASE_SCHEMA_PATH}}" \
-d "{{.DATA_PATH}}"
- |
npx ajv-cli validate \
--all-errors \
--strict=false \
-s "{{.SCHEMA_PATH}}" \
-r "{{.BASE_SCHEMA_PATH}}" \
-d "{{.ASSETS_DATA_PATH}}"
docs:generate:
Expand Down Expand Up @@ -731,6 +738,10 @@ tasks:
AVA_SCHEMA_URL: https://json.schemastore.org/ava.json
AVA_SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="ava-schema-XXXXXXXXXX.json"
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base.json
BASE_SCHEMA_URL: https://json.schemastore.org/base.json
BASE_SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="base-schema-XXXXXXXXXX.json"
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/eslintrc.json
ESLINTRC_SCHEMA_URL: https://json.schemastore.org/eslintrc.json
ESLINTRC_SCHEMA_PATH:
Expand Down Expand Up @@ -768,6 +779,7 @@ tasks:
cmds:
- wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}}
- wget --quiet --output-document="{{.AVA_SCHEMA_PATH}}" {{.AVA_SCHEMA_URL}}
- wget --quiet --output-document="{{.BASE_SCHEMA_PATH}}" {{.BASE_SCHEMA_URL}}
- wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}}
- wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}}
- wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}}
Expand All @@ -781,6 +793,7 @@ tasks:
--all-errors \
-s "{{.SCHEMA_PATH}}" \
-r "{{.AVA_SCHEMA_PATH}}" \
-r "{{.BASE_SCHEMA_PATH}}" \
-r "{{.ESLINTRC_SCHEMA_PATH}}" \
-r "{{.JSCPD_SCHEMA_PATH}}" \
-r "{{.NPM_BADGES_SCHEMA_PATH}}" \
Expand Down
6 changes: 6 additions & 0 deletions workflow-templates/assets/check-npm-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ tasks:
AVA_SCHEMA_URL: https://json.schemastore.org/ava.json
AVA_SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="ava-schema-XXXXXXXXXX.json"
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base.json
BASE_SCHEMA_URL: https://json.schemastore.org/base.json
BASE_SCHEMA_PATH:
sh: task utility:mktemp-file TEMPLATE="base-schema-XXXXXXXXXX.json"
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/eslintrc.json
ESLINTRC_SCHEMA_URL: https://json.schemastore.org/eslintrc.json
ESLINTRC_SCHEMA_PATH:
Expand Down Expand Up @@ -57,6 +61,7 @@ tasks:
cmds:
- wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}}
- wget --quiet --output-document="{{.AVA_SCHEMA_PATH}}" {{.AVA_SCHEMA_URL}}
- wget --quiet --output-document="{{.BASE_SCHEMA_PATH}}" {{.BASE_SCHEMA_URL}}
- wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}}
- wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}}
- wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}}
Expand All @@ -70,6 +75,7 @@ tasks:
--all-errors \
-s "{{.SCHEMA_PATH}}" \
-r "{{.AVA_SCHEMA_PATH}}" \
-r "{{.BASE_SCHEMA_PATH}}" \
-r "{{.ESLINTRC_SCHEMA_PATH}}" \
-r "{{.JSCPD_SCHEMA_PATH}}" \
-r "{{.NPM_BADGES_SCHEMA_PATH}}" \
Expand Down

0 comments on commit f4f08aa

Please sign in to comment.