From a570004088669588d414f9bcdc3c04f07785387c Mon Sep 17 00:00:00 2001 From: Matt Craddock <5796417+craddm@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:16:34 +0100 Subject: [PATCH 1/7] add action to check json format --- .github/workflows/pre-commit.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pre-commit.yaml diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..0543049 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,15 @@ +--- +name: Check Json format + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 \ No newline at end of file From 8937f400a436edb2467cda0df29a0eccf8e7d2e7 Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Mon, 2 Oct 2023 14:10:44 +0100 Subject: [PATCH 2/7] Update pre-commit.yaml --- .github/workflows/pre-commit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 0543049..2b89674 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -1,5 +1,5 @@ --- -name: Check Json format +name: Check Json formatting on: pull_request: @@ -12,4 +12,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 \ No newline at end of file + - uses: pre-commit/action@v3.0.0 From 02328f551b2d0cba6fd74fdcf61c9b308d0173e0 Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Tue, 3 Oct 2023 14:18:47 +0100 Subject: [PATCH 3/7] Run prettier --- schema.json | 64 +++++++++++++++++++------------------- schema_other.json | 78 +++++++++++++++++++++++++---------------------- 2 files changed, 74 insertions(+), 68 deletions(-) diff --git a/schema.json b/schema.json index 5439703..851858c 100644 --- a/schema.json +++ b/schema.json @@ -1,34 +1,34 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "properties": { - "package_name": {"type": "string"}, - "version": { - "type": "string", - "_comment": "PEP404 version string prefixed with a comparison operator, Excluding trailing '.*'.\nhttps://peps.python.org/pep-0440/#version-specifiers\nhttps://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions", - "pattern": "^(~=|==|!=|<=|>=|<|>|===)\\s*([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?(\\.dev(0|[1-9][0-9]*))?$" - }, - "approval_date": { - "type": "string", - "format": "date" - }, - "revoke_date": { - "oneOf": [ - { - "type": "string", - "format": "date" - }, - { - "type": "null" - } - ] - } - }, - "required": ["package_name", "version", "approval_date", "revoke_date"], - "additionalProperties": false - } + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "package_name": { "type": "string" }, + "version": { + "type": "string", + "_comment": "PEP404 version string prefixed with a comparison operator, Excluding trailing '.*'.\nhttps://peps.python.org/pep-0440/#version-specifiers\nhttps://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions", + "pattern": "^(~=|==|!=|<=|>=|<|>|===)\\s*([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?(\\.dev(0|[1-9][0-9]*))?$" + }, + "approval_date": { + "type": "string", + "format": "date" + }, + "revoke_date": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + } + }, + "required": ["package_name", "version", "approval_date", "revoke_date"], + "additionalProperties": false + } } diff --git a/schema_other.json b/schema_other.json index 6a7e5ad..6d483c5 100644 --- a/schema_other.json +++ b/schema_other.json @@ -1,38 +1,44 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "properties": { - "package_name": {"type": "string"}, - "url": { - "type": "string", - "format": "uri" - }, - "version": { - "type": "string", - "_comment": "PEP404 version string prefixed with a comparison operator, Excluding trailing '.*'.\nhttps://peps.python.org/pep-0440/#version-specifiers\nhttps://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions", - "pattern": "^(~=|==|!=|<=|>=|<|>|===)\\s*([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?(\\.dev(0|[1-9][0-9]*))?$" - }, - "approval_date": { - "type": "string", - "format": "date" - }, - "revoke_date": { - "oneOf": [ - { - "type": "string", - "format": "date" - }, - { - "type": "null" - } - ] - } - }, - "required": ["package_name", "url", "version", "approval_date", "revoke_date"], - "additionalProperties": false - } + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "package_name": { "type": "string" }, + "url": { + "type": "string", + "format": "uri" + }, + "version": { + "type": "string", + "_comment": "PEP404 version string prefixed with a comparison operator, Excluding trailing '.*'.\nhttps://peps.python.org/pep-0440/#version-specifiers\nhttps://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions", + "pattern": "^(~=|==|!=|<=|>=|<|>|===)\\s*([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?(\\.dev(0|[1-9][0-9]*))?$" + }, + "approval_date": { + "type": "string", + "format": "date" + }, + "revoke_date": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "package_name", + "url", + "version", + "approval_date", + "revoke_date" + ], + "additionalProperties": false + } } From 89de5d877fb599828f259eaaf7621a395ad33b3f Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Tue, 3 Oct 2023 14:26:57 +0100 Subject: [PATCH 4/7] Update .github/workflows/pre-commit.yaml Co-authored-by: Jim Madge --- .github/workflows/pre-commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 2b89674..01054ef 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -1,5 +1,5 @@ --- -name: Check Json formatting +name: Check JSON formatting on: pull_request: From edefe0f890b7f1135ad68460d7b6b22c0d362abc Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Tue, 3 Oct 2023 14:27:04 +0100 Subject: [PATCH 5/7] Update .github/workflows/pre-commit.yaml Co-authored-by: Jim Madge --- .github/workflows/pre-commit.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 01054ef..f71cf26 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -10,6 +10,7 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check out repository + uses: actions/checkout@v4 - uses: actions/setup-python@v4 - uses: pre-commit/action@v3.0.0 From 2f96ff828e8df0899517d2c1130a4d5a4fb4d514 Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Tue, 3 Oct 2023 14:27:10 +0100 Subject: [PATCH 6/7] Update .github/workflows/pre-commit.yaml Co-authored-by: Jim Madge --- .github/workflows/pre-commit.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index f71cf26..221bf4b 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -12,5 +12,8 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 - uses: pre-commit/action@v3.0.0 From 5eece21ca3f6569dafccc3445a4ebac54a2e50d4 Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Tue, 3 Oct 2023 14:27:19 +0100 Subject: [PATCH 7/7] Update .github/workflows/pre-commit.yaml Co-authored-by: Jim Madge --- .github/workflows/pre-commit.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 221bf4b..6e7c889 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -16,4 +16,5 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.11 - - uses: pre-commit/action@v3.0.0 + - name: Run pre-commit + uses: pre-commit/action@v3.0.0