blob: 9e9da23b3c998de76c74e93ae203f4569997698e [file] [log] [blame]
Zack Williams583833b2020-04-10 08:17:44 -07001# kind-voltha testing Makefile
2#
3# SPDX-FileCopyrightText: © 2020 Open Networking Foundation
4# SPDX-License-Identifier: Apache-2.0
5
6SHELL = bash -eu -o pipefail
7
8.DEFAULT_GOAL := help
9.PHONY: test shellcheck yamllint jsonlint help
10
11test: ## run all tests
12 @echo "No tests enabled yet"
13
14SHELL_FILES := voltha $(wildcard releases/*) $(wildcard scripts/*)
15shellcheck: ## check shell scripts with shellcheck
16 shellcheck --version
17 echo shellcheck $(SHELL_FILES)
18
19YAML_FILES ?= $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' -o -name '*.cfg' \) -print )
20yamllint: ## 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
26JSON_FILES ?= $(shell find . -type f -name '*.json' -print )
27jsonlint: ## lint check JSON files with yamllint
28 echo "Not supported yet, would check these files: $(JSON_FILES)"
29
30help: ## 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};'