Zack Williams | 583833b | 2020-04-10 08:17:44 -0700 | [diff] [blame] | 1 | # kind-voltha testing Makefile |
| 2 | # |
| 3 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | SHELL = bash -eu -o pipefail |
| 7 | |
| 8 | .DEFAULT_GOAL := help |
| 9 | .PHONY: test shellcheck yamllint jsonlint help |
| 10 | |
| 11 | test: ## run all tests |
| 12 | @echo "No tests enabled yet" |
| 13 | |
| 14 | SHELL_FILES := voltha $(wildcard releases/*) $(wildcard scripts/*) |
| 15 | shellcheck: ## check shell scripts with shellcheck |
| 16 | shellcheck --version |
| 17 | echo shellcheck $(SHELL_FILES) |
| 18 | |
| 19 | YAML_FILES ?= $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' -o -name '*.cfg' \) -print ) |
| 20 | yamllint: ## lint check YAML files with yamllint |
| 21 | yamllint --version |
| 22 | yamllint \ |
| 23 | -d "{extends: default, rules: {line-length: {max: 99}}}" \ |
| 24 | -s $(YAML_FILES) |
| 25 | |
| 26 | JSON_FILES ?= $(shell find . -type f -name '*.json' -print ) |
| 27 | jsonlint: ## lint check JSON files with yamllint |
| 28 | echo "Not supported yet, would check these files: $(JSON_FILES)" |
| 29 | |
| 30 | help: ## Print help for each target |
| 31 | @echo kind-voltha Makefile targets |
| 32 | @echo |
| 33 | @grep '^[[:alpha:]_-]*:.* ##' $(MAKEFILE_LIST) \ |
| 34 | | sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};' |