blob: 92526576193a98dc5a735bcd24a5ca5391376bd5 [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
12python-check-find := find . -name '*venv*' -prune\
13 -o \( -name '*.py' \)\
14 -type f -print0
15
16# python-check := $(env-clean) pylint
17python-check := pylint
18
19# python-check-args += --dry-run
20
21##-------------------##
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'
38
39# [EOF]