From 2a7f74f38922a5313da7ff3a2e08e5c3ac4aa19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20G=C3=B3mez=20Gracia?= Date: Fri, 28 Jul 2023 12:14:17 +0200 Subject: [PATCH] Replace json-schema with check-jsonschema (#103) Signed-off-by: Gonzalo Gomez Gracia --- .github/workflows/ci-pipeline.yml | 4 ++-- scripts/lint.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 925bfb48b..d30bb4c44 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -25,8 +25,8 @@ jobs: run: sudo apt-get install -y jq python3 - name: Install markdownlint run: npm install -g markdownlint-cli@0.33.0 - - name: Install jsonschema - run: python3 -m pip install jsonschema + - name: Install check-jsonschema + run: python3 -m pip install check-jsonschema - uses: actions/checkout@v3 name: Checkout Repository - id: lint diff --git a/scripts/lint.sh b/scripts/lint.sh index e9cb43c8e..385e9df52 100644 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -19,6 +19,7 @@ elif [[ "$FORCE" -eq 1 ]] && [[ "${#files_to_check[@]}" -eq 0 ]]; then fi if [[ "${#files_to_check[@]}" -ne 0 ]]; then + echo "Will check ${#files_to_check[@]} files" for f in "${files_to_check[@]}"; do if [[ -f "$f" ]]; then # Run a different linter depending on file extension @@ -38,7 +39,7 @@ if [[ "${#files_to_check[@]}" -ne 0 ]]; then exit_code=$? elif [[ "$f" =~ .*\/?data\/.* ]]; then # Check CVE file against OSV schema - output="$(jsonschema "${root_dir}/config/validation/schema.json" < "$f" 2>/dev/null)" + check-jsonschema --verbose --schemafile "${root_dir}/config/validation/schema.json" "$f" exit_code=$? fi if [[ $exit_code -ne 0 ]]; then