Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 1 | # dhcpd Makefile |
| 2 | # |
| 3 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | SHELL = bash -eu -o pipefail |
| 7 | |
| 8 | .DEFAULT_GOAL := help |
| 9 | .PHONY: test lint yamllint ansiblelint license help |
| 10 | |
Zack Williams | 98725e2 | 2021-03-18 10:21:26 -0700 | [diff] [blame] | 11 | test: filter_test ## run tests on the playbook with molecule |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 12 | molecule --version |
| 13 | molecule test |
| 14 | |
Zack Williams | 98725e2 | 2021-03-18 10:21:26 -0700 | [diff] [blame] | 15 | filter_test: ## test filter plugins |
| 16 | python filter_plugins/rfc3442_words.py |
| 17 | |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 18 | lint: yamllint ansiblelint ## run all lint checks |
| 19 | |
| 20 | # all YAML files |
| 21 | YAML_FILES ?= $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print ) |
| 22 | |
| 23 | yamllint: ## lint check with yamllint |
| 24 | yamllint --version |
| 25 | yamllint \ |
| 26 | -d "{extends: default, rules: {line-length: {max: 99}}}" \ |
| 27 | -s $(YAML_FILES) |
| 28 | |
Zack Williams | 7f58df0 | 2021-09-14 13:49:57 -0700 | [diff] [blame] | 29 | # List of molecule files, not including base molecule.yml which isn't ansible format |
| 30 | MOLECULE_FILES ?= $(shell find molecule -type f -name '*.yml' \! -name 'molecule.yml' -print ) |
| 31 | |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 32 | ansiblelint: ## lint check with ansible-lint |
| 33 | ansible-lint --version |
| 34 | ansible-lint -v . |
Zack Williams | 7f58df0 | 2021-09-14 13:49:57 -0700 | [diff] [blame] | 35 | ansible-lint -v $(MOLECULE_FILES) |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 36 | |
| 37 | license: ## Check license with the reuse tool |
| 38 | reuse --version |
| 39 | reuse --root . lint |
| 40 | |
| 41 | help: ## Print help for each target |
| 42 | @echo dhcpd test targets |
| 43 | @echo |
| 44 | @grep '^[[:alnum:]_-]*:.* ##' $(MAKEFILE_LIST) \ |
| 45 | | sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};' |