Skip to content

Commit

Permalink
Merge pull request #328 from fitztrev/lint
Browse files Browse the repository at this point in the history
Add Redocly linter
  • Loading branch information
ornicar authored Apr 8, 2024
2 parents e5f04a5 + fb62a1c commit 6e8eb41
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ jobs:
with:
node-version: 20
- run: npm ci
- run: npm run spectral
- run: npm run lint
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Make modifications to `doc/specs/lichess-api.yaml`, and reload the page to see y
### Check the yaml files for syntax errors:

```shell
npm run spectral
npm run lint
```
3 changes: 2 additions & 1 deletion doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"@stoplight/spectral-cli": "^6.11.1"
},
"scripts": {
"lint": "spectral lint --fail-severity=warn specs/*.yaml",
"spectral": "spectral lint --fail-severity=warn specs/*.yaml",
"lint": "npx @redocly/cli lint specs/lichess-api.yaml",
"build": "npx @redocly/cli build-docs specs/lichess-api.yaml --output public/index.html",
"serve": "npx @redocly/cli preview-docs specs/lichess-api.yaml --port 8089"
}
Expand Down
6 changes: 6 additions & 0 deletions doc/redocly.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
theme:
openapi:
htmlTemplate: ./template.hbs

extends:
- recommended

rules:
operation-4xx-response: off
23 changes: 9 additions & 14 deletions doc/specs/schemas/BroadcastPgnPush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ type: object
properties:
games:
type: array
item:
oneOf:
- type: object
properties:
tags:
type: object
moves:
type: integer
- type: object
properties:
tags:
type: object
error:
type: string
items:
type: object
properties:
tags:
type: object
moves:
type: integer
error:
type: string
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ get:
Get information about a broadcast round.
tags:
- Broadcasts
security: []
parameters:
- in: path
name: broadcastTournamentSlug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ get:
Get the leaderboard of a broadcast tournament, if available.
tags:
- Broadcasts
security: []
parameters:
- in: path
name: broadcastTournamentId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ get:
Get information about a broadcast tournament.
tags:
- Broadcasts
security: []
parameters:
- in: path
name: broadcastTournamentId
Expand Down

0 comments on commit 6e8eb41

Please sign in to comment.