blob: cf87be4afd42431a6a02118b618aa7496abb7710 [file] [log] [blame]
Joey Armstronge6cdd8e2022-12-29 11:58:15 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong25589d82024-01-02 22:31:35 -05003# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstronge6cdd8e2022-12-29 11:58:15 -05004# -----------------------------------------------------------------------
5
Joey Armstronge66eaaf2023-01-15 18:58:52 -05006##-------------------##
7##---] GLOBALS [---##
8##-------------------##
Joey Armstronge6cdd8e2022-12-29 11:58:15 -05009
Joey Armstronge66eaaf2023-01-15 18:58:52 -050010# Gather sources to check
11# TODO: implement deps, only check modified files
12shell-check-find := find . -name '*.sh' -type f -print0
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050013
Joey Armstronge66eaaf2023-01-15 18:58:52 -050014# shell-check := $(env-clean) pylint
15shell-check := shellcheck
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050016
Joey Armstronge66eaaf2023-01-15 18:58:52 -050017shell-check-args += -a
18
19##-------------------##
20##---] TARGETS [---##
21##-------------------##
22ifndef NO-LINT-SHELL
23 lint : lint-shell
24endif
25
26## -----------------------------------------------------------------------
27## -----------------------------------------------------------------------
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050028lint-shell:
Joey Armstronge66eaaf2023-01-15 18:58:52 -050029 $(shell-check) -V
30 @echo
31 $(HIDE)$(env-clean) $(shell-check-find) \
32 | $(xargs-n1) $(shell-check) $(shell-check-args)
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050033
Joey Armstronge66eaaf2023-01-15 18:58:52 -050034## -----------------------------------------------------------------------
35## -----------------------------------------------------------------------
36help ::
Joey Armstrong761579c2023-05-08 11:59:57 -040037 @echo ' lint-shell Syntax check shell sources'
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050038
39# [EOF]