Skip to content

Commit

Permalink
Add spectral linter for Swagger (go-gitea#20321)
Browse files Browse the repository at this point in the history
[spectral](https://github.com/stoplightio/spectral) lints
openapi/swagger files for mistakes of which it has identified a few and
which I've fixed.

I had to put it into `lint-frontend` because it depends on node_modules
so can not run on Drone during the backend target. I plan to refactor
these targets later to `lint-js` and `lint-go` so that they are
categorized based on the tool dependencies.
  • Loading branch information
silverwind authored and Sysoev, Vladimir committed Aug 10, 2022
1 parent 747e74b commit 4e4a638
Show file tree
Hide file tree
Showing 7 changed files with 10,347 additions and 7,544 deletions.
12 changes: 12 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: [[spectral:oas, all]]

rules:
info-contact: off
oas2-api-host: off
oas2-parameter-description: off
oas2-schema: off
oas2-valid-schema-example: off
openapi-tags: off
operation-description: off
operation-singular-tag: off
operation-tag-defined: off
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ lint: lint-frontend lint-backend
lint-frontend: node_modules
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
npx stylelint --color --max-warnings=0 web_src/less
npx spectral lint -q -F hint $(SWAGGER_SPEC)

.PHONY: lint-backend
lint-backend: golangci-lint vet editorconfig-checker
Expand Down
Loading

0 comments on commit 4e4a638

Please sign in to comment.