Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint target to Makefile. #9

Merged
merged 2 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PROXY_TARGET ?= http://mock:4010

SPEC_FILE ?= DigitalOcean-public.v2.yaml

## TODO: This is an inital (temporary) collection
## TODO: This is an inital (temporary) collection
## This file is generated through Postman from the spec (through the app)
## This will be replaced with an automated way to generate the collection in APICLI-401
COLLECTION_PATH ?= tests/DigitalOcean.postman_collection.json
Expand All @@ -16,6 +16,10 @@ DO_TOKEN ?= XXXXXX
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: dev-dependencies
dev-dependencies: ## Install development tooling using npm
npm install --only=dev

.PHONY: start-mockedproxy
start-mockedproxy: ## Start a prism proxy (port 8080) targeting a local mock api (port 4010)
PROXY_TARGET=$(PROXY_TARGET) docker-compose up -d
Expand All @@ -25,7 +29,7 @@ stop-services: ## Stop the proxy with mock docker services
docker-compose down

.PHONY: start-prodproxy
start-prodproxy: ## Start a proxy to the production
start-prodproxy: ## Start a proxy to the production
PROXY_TARGET=https://api.digitalocean.com/v2 docker-compose up proxy

.PHONY: _sleep
Expand All @@ -39,3 +43,7 @@ test: start-mockedproxy _sleep ## Run Postman collection against local proxy wit
--env-var accessToken=${DO_TOKEN} \
--reporters json,cli \
--reporter-json-export newman-results.json

.PHONY: lint
lint: dev-dependencies ## Lint the OpenAPI spec using Spectral
npm run lint
Loading