blob: 9bce9d6e7f8071df78ba43b5c595fd9ca22a5926 [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
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 ::
Joey Armstrong761579c2023-05-08 11:59:57 -040037 @echo ' lint-python Syntax check python sources'
Joey Armstronge6cdd8e2022-12-29 11:58:15 -050038
39# [EOF]