blob: 0180e904ae63d4eeb2e0af5a00aebe21fecad082 [file] [log] [blame]
Joey Armstronge6cdd8e2022-12-29 11:58:15 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstronge66eaaf2023-01-15 18:58:52 -05003# Copyright 2022 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 ::
37 @echo ' lint-shell Syntax check shell sources'
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050038
39# [EOF]