Skip to content

Commit

Permalink
chore: switch out spectral for vacuum
Browse files Browse the repository at this point in the history
  • Loading branch information
philsturgeon committed Jan 7, 2025
1 parent 87d810c commit e559f80
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
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
9 changes: 0 additions & 9 deletions .spectral.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .vacuum/ruleset.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions vacuum.conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruleset: ./.vacuum/ruleset.yaml

0 comments on commit e559f80

Please sign in to comment.