blob: cadc08412e866d89844f90cb07c6e03135f52a1c [file] [log] [blame]
Joey Armstrongb085c502023-01-17 13:56:24 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
3# Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors
4# -----------------------------------------------------------------------
5
6##-------------------##
7##---] GLOBALS [---##
8##-------------------##
9
10# Gather sources to check
11# TODO: implement deps, only check modified files
12shell-check-find := find .
13# vendor scripts but they really should be lintable
14shell-check-find += -name 'vendor' -prune
15shell-check-find += -o \( -name '*.sh' \)
16shell-check-find += -type f -print0
17
18# shell-check := $(env-clean) pylint
19shell-check := shellcheck
20
21shell-check-args += -a
22
23##-------------------##
24##---] TARGETS [---##
25##-------------------##
26ifndef NO-LINT-SHELL
27 lint : lint-shell
28endif
29
30## -----------------------------------------------------------------------
31## -----------------------------------------------------------------------
32lint-shell:
33 $(shell-check) -V
34 @echo
35 $(HIDE)$(env-clean) $(shell-check-find) \
36 | $(xargs-n1) $(shell-check) $(shell-check-args)
37
38## -----------------------------------------------------------------------
39## -----------------------------------------------------------------------
40help ::
41 @echo ' lint-shell Syntax check shell sources'
42
43# [EOF]