blob: 92526576193a98dc5a735bcd24a5ca5391376bd5 [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
12python-check-find := find . -name '*venv*' -prune\
13 -o \( -name '*.py' \)\
14 -type f -print0
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050015
Joey Armstronge66eaaf2023-01-15 18:58:52 -050016# python-check := $(env-clean) pylint
17python-check := pylint
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050018
Joey Armstronge66eaaf2023-01-15 18:58:52 -050019# python-check-args += --dry-run
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050020
Joey Armstronge66eaaf2023-01-15 18:58:52 -050021##-------------------##
22##---] TARGETS [---##
23##-------------------##
24ifndef NO-LINT-PYTHON
25 lint : lint-python
26endif
27
28## -----------------------------------------------------------------------
29## -----------------------------------------------------------------------
30lint-python:
31 $(HIDE)$(env-clean) $(python-check-find) \
32 | $(xargs-n1) $(python-check) $(python-check-args)
33
34## -----------------------------------------------------------------------
35## -----------------------------------------------------------------------
36help ::
37 @echo ' lint-python Syntax check python sources'
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050038
39# [EOF]