From 6b1b895898505cbcd1ea60f2afaf8644507cf9dc Mon Sep 17 00:00:00 2001 From: Lorna Mitchell Date: Thu, 18 Apr 2024 09:09:57 +0100 Subject: [PATCH 1/5] Add linting with annotations to CI --- .github/workflows/museum-lint.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/museum-lint.yml b/.github/workflows/museum-lint.yml index 3eee072..0b2c37e 100644 --- a/.github/workflows/museum-lint.yml +++ b/.github/workflows/museum-lint.yml @@ -6,14 +6,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 20.5.1 - cache: 'npm' - - name: Install dependencies - run: npm install - - name: Run Redocly CLI linting - run: npm run lint \ No newline at end of file + - name: Checkout + uses: actions/checkout@v4 + - name: Set up node + uses: actions/setup-node@v4 + - name: Install Redocly CLI + run: npm install -g @redocly/cli@latest + - name: Run linting + run: redocly lint --format=github-actions + From c4159e693de9975e5e62054d545ead7aa517a09f Mon Sep 17 00:00:00 2001 From: Lorna Mitchell Date: Thu, 18 Apr 2024 10:07:12 +0100 Subject: [PATCH 2/5] Add new rule and remove ignore file to show annotations --- .redocly.lint-ignore.yaml | 5 ----- redocly.yaml | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 .redocly.lint-ignore.yaml diff --git a/.redocly.lint-ignore.yaml b/.redocly.lint-ignore.yaml deleted file mode 100644 index be00ff2..0000000 --- a/.redocly.lint-ignore.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API. -# See https://redoc.ly/docs/cli/ for more information. -openapi.yaml: - rule/operation-summary-sentence-case: - - '#/paths/~1tickets~1{ticketId}~1qr/get/summary' \ No newline at end of file diff --git a/redocly.yaml b/redocly.yaml index 3a6c2fb..01f8980 100644 --- a/redocly.yaml +++ b/redocly.yaml @@ -1,6 +1,8 @@ apis: main: root: ./openapi.yaml + rules: + path-segment-plural: error extends: - recommended rules: From 4bd4e6df4120c16deff7b937b572c271c2594cf2 Mon Sep 17 00:00:00 2001 From: Lorna Mitchell Date: Thu, 18 Apr 2024 10:18:52 +0100 Subject: [PATCH 3/5] Remove double-checking in CI --- .github/workflows/museum-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/museum-lint.yml b/.github/workflows/museum-lint.yml index 0b2c37e..c9819ef 100644 --- a/.github/workflows/museum-lint.yml +++ b/.github/workflows/museum-lint.yml @@ -1,6 +1,6 @@ name: Validate museum OpenAPI description -on: [push, pull_request] +on: [pull_request] jobs: build: From 8877f5c405b4e08eabd5149974539cc0bb4fb73f Mon Sep 17 00:00:00 2001 From: Lorna Mitchell Date: Thu, 18 Apr 2024 10:33:30 +0100 Subject: [PATCH 4/5] Switch new rule to be a warning --- redocly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redocly.yaml b/redocly.yaml index 01f8980..ad92c5c 100644 --- a/redocly.yaml +++ b/redocly.yaml @@ -2,7 +2,7 @@ apis: main: root: ./openapi.yaml rules: - path-segment-plural: error + path-segment-plural: warn extends: - recommended rules: From a2df4de105841fc62be97e93a4c2e73919f06388 Mon Sep 17 00:00:00 2001 From: Lorna Mitchell Date: Fri, 19 Apr 2024 11:35:34 +0100 Subject: [PATCH 5/5] Adjust workflow to match blog post wording --- .github/workflows/museum-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/museum-lint.yml b/.github/workflows/museum-lint.yml index c9819ef..930bf99 100644 --- a/.github/workflows/museum-lint.yml +++ b/.github/workflows/museum-lint.yml @@ -1,4 +1,4 @@ -name: Validate museum OpenAPI description +name: API linting on: [pull_request]