Skip to content

Commit

Permalink
feat(pre-commit): lint models and references
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Apr 25, 2023
1 parent 5c8966a commit da95205
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ ci:
repos:
- repo: local
hooks:
- id: spectral-lint
name: spectral linter
- id: spectral-lint-references
name: "spectral linter: references"
language: node
entry: npx spectral lint ./reference/**/*.yaml
entry: npx spectral lint ./reference/**/*.yaml --ruleset .spectral.yaml
files: ^reference/|models/
additional_dependencies: ["@stoplight/[email protected]"]
types: [yaml]

- id: spectral-lint-models
name: "spectral linter: models"
language: node
entry: npx spectral lint ./reference/**/*.yaml --ruleset .spectral.models.yaml --fail-severity warn
files: ^reference/|models/
additional_dependencies: ["@stoplight/[email protected]"]
types: [yaml]
Expand Down
10 changes: 10 additions & 0 deletions .spectral.models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends:
- "spectral:oas"

formats:
- json-schema-loose

rules:
oas3-api-servers: off
openapi-tags: off
operation-tags: off

0 comments on commit da95205

Please sign in to comment.