Skip to content

Commit

Permalink
Add Spectral linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Jun 17, 2024
1 parent de95bb3 commit f1c669f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ rules:
given: $.paths[*].[get,put,post,delete,options,head,patch,trace]
then:
field: summary
function: defined
function: defined
operation-summary-length:
description: Operation summary should be between 5 and 45 characters
given: "$.paths[*].[get,put,post,delete,options,head,patch,trace]"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ setup: ## Install dependencies for contrib target
@make clean-dep
@npm install --prefix compiler
@npm install --prefix typescript-generator
@npm install @stoplight/spectral-cli

clean-dep: ## Clean npm dependencies
@rm -rf compiler/node_modules
Expand All @@ -58,6 +59,9 @@ dump-routes: ## Create a new schema with all generics expanded

contrib: | generate license-check spec-format-fix transform-to-openapi ## Pre contribution target

lint-docs: ## Lint the OpenAPI documents
@npx @stoplight/spectral-cli lint output/openapi/elasticsearch-serverless-openapi.json

help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
#------------- <https://suva.sh/posts/well-documented-makefiles> --------------
Expand Down

0 comments on commit f1c669f

Please sign in to comment.