Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 3 | # Copyright 2022 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 4 | # ----------------------------------------------------------------------- |
| 5 | |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 6 | ##-------------------## |
| 7 | ##---] GLOBALS [---## |
| 8 | ##-------------------## |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 9 | |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 10 | # Gather sources to check |
| 11 | # TODO: implement deps, only check modified files |
| 12 | python-check-find := find . -name '*venv*' -prune\ |
| 13 | -o \( -name '*.py' \)\ |
| 14 | -type f -print0 |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 15 | |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 16 | # python-check := $(env-clean) pylint |
| 17 | python-check := pylint |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 18 | |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 19 | # python-check-args += --dry-run |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 20 | |
Joey Armstrong | e66eaaf | 2023-01-15 18:58:52 -0500 | [diff] [blame] | 21 | ##-------------------## |
| 22 | ##---] TARGETS [---## |
| 23 | ##-------------------## |
| 24 | ifndef NO-LINT-PYTHON |
| 25 | lint : lint-python |
| 26 | endif |
| 27 | |
| 28 | ## ----------------------------------------------------------------------- |
| 29 | ## ----------------------------------------------------------------------- |
| 30 | lint-python: |
| 31 | $(HIDE)$(env-clean) $(python-check-find) \ |
| 32 | | $(xargs-n1) $(python-check) $(python-check-args) |
| 33 | |
| 34 | ## ----------------------------------------------------------------------- |
| 35 | ## ----------------------------------------------------------------------- |
| 36 | help :: |
| 37 | @echo ' lint-python Syntax check python sources' |
Joey Armstrong | e6cdd8e | 2022-12-29 11:58:15 -0500 | [diff] [blame] | 38 | |
| 39 | # [EOF] |