Skip to content

Commit

Permalink
Merge pull request #906 from traPtitech/supress-lint-warning
Browse files Browse the repository at this point in the history
add .spectral.yml
  • Loading branch information
wtks authored May 10, 2020
2 parents 51e198c + 386b618 commit 58bad44
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .spectral.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extends: spectral:oas
rules:
operation-2xx-response: false
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ golangci-lint:

.PHONY: swagger-lint
swagger-lint:
spectral lint -q docs/*.yaml
@cd dev/bin && ./swagger-lint.sh

.PHONY: db-gen-docs
db-gen-docs:
Expand Down
11 changes: 11 additions & 0 deletions dev/bin/swagger-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -eu

cd ../../

if type spectral >/dev/null 2>&1; then
spectral lint -r .spectral.yml -q docs/v3-api.yaml
else
docker run --rm -it -v $(pwd):/tmp stoplight/spectral lint -r /tmp/.spectral.yml -q /tmp/docs/v3-api.yaml
fi

0 comments on commit 58bad44

Please sign in to comment.