diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ad89126..736e90a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,10 +6,11 @@ on: # yamllint disable-line rule:truthy branches: [main] paths-ignore: - 'README.md' + - 'src/**' jobs: build: - name: Lint + name: API Linting runs-on: ubuntu-latest permissions: @@ -21,15 +22,16 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - # super-linter needs the full git history to get the - # list of files that changed across commits - fetch-depth: 0 - - name: Super-linter - uses: super-linter/super-linter/slim@v7.2.0 - env: - DEFAULT_BRANCH: main - FILTER_REGEX_INCLUDE: ^openapi.yaml - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_OPENAPI: true + - name: Install vacuum npm package + run: npm install -g vacuum + + - name: Lint API + run: vacuum report --junit openapi.yaml lint-results + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: | + lint-results-*.xml diff --git a/.spectral.yaml b/.spectral.yaml deleted file mode 100644 index 719461d..0000000 --- a/.spectral.yaml +++ /dev/null @@ -1,9 +0,0 @@ -extends: -- "spectral:oas" -# - "@stoplight/spectral-owasp-ruleset" -- "@apisyouwonthate/style-guide" - -rules: - # The API doesn't have these (yet?) - api-home: off - api-health: off diff --git a/.vacuum/ruleset.yaml b/.vacuum/ruleset.yaml new file mode 100644 index 0000000..a9f0de6 --- /dev/null +++ b/.vacuum/ruleset.yaml @@ -0,0 +1,11 @@ +extends: + - spectral:oas + # - "@apisyouwonthate/style-guide" + # - "@stoplight/spectral-owasp-ruleset" + +rules: + # The API doesn't have these (yet?) + # api-home: off + # api-health: off + + oas3-missing-example: off diff --git a/openapi.yaml b/openapi.yaml index 51a589a..4e9eb28 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -45,10 +45,10 @@ security: - OAuth2: - read -x-topics: - - title: Getting started - content: - $ref: ./docs/getting-started.md +# x-topics: +# - title: Getting started +# content: +# $ref: ./docs/getting-started.md tags: - name: Stations diff --git a/vacuum.conf.yaml b/vacuum.conf.yaml new file mode 100644 index 0000000..4a5287a --- /dev/null +++ b/vacuum.conf.yaml @@ -0,0 +1 @@ +ruleset: ./.vacuum/ruleset.yaml