Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 518f357 | 2024-02-11 07:56:25 -0500 | [diff] [blame] | 3 | # Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | dd33449 | 2023-07-09 17:59:02 -0400 | [diff] [blame] | 4 | # ----------------------------------------------------------------------- |
| 5 | |
| 6 | ##-------------------## |
| 7 | ##---] GLOBALS [---## |
| 8 | ##-------------------## |
| 9 | env-clean = /usr/bin/env --ignore-environment |
| 10 | xargs-n1 := xargs -0 -t -n1 --no-run-if-empty |
| 11 | |
| 12 | yamllint := $(env-clean) $(YAMLLINT) |
| 13 | yamllint-args := -c .yamllint |
| 14 | |
| 15 | ##-------------------## |
| 16 | ##---] TARGETS [---## |
| 17 | ##-------------------## |
| 18 | lint : lint-yaml |
| 19 | |
| 20 | ## ----------------------------------------------------------------------- |
| 21 | ## ----------------------------------------------------------------------- |
| 22 | lint-yaml: |
| 23 | $(HIDE)$(env-clean) find . -name '*.yaml' -type f -print0 \ |
| 24 | | $(xargs-n1) $(yamllint) $(yamllint-args) |
| 25 | |
| 26 | ## ----------------------------------------------------------------------- |
| 27 | ## ----------------------------------------------------------------------- |
| 28 | help: |
| 29 | @echo |
| 30 | @echo "USAGE: $(MAKE)" |
| 31 | @echo " lint perform syntax checks on source" |
| 32 | @echo " test perform syntax checks on source" |
| 33 | @echo " pre-check Verify tools and deps are available for testing" |
| 34 | @echo |
| 35 | @echo "[LINT]" |
| 36 | @echo " lint-json Syntax check .json sources" |
| 37 | @echo " lint-yaml Syntax check .yaml sources" |
| 38 | @echo |
| 39 | # [EOF] |