diff mbox series

[7/9] Makefile: Add a way to check for pylint errors

Message ID 20220211202327.851395-8-sjg@chromium.org
State Accepted
Commit f44a52af4df0a56c0971ede516a1ac2194f29951
Delegated to: Tom Rini
Headers show
Series Enable the pylint checker in CI | expand

Commit Message

Simon Glass Feb. 11, 2022, 8:23 p.m. UTC
Add a new 'pylint_err' target which only reports errors, not warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Tom Rini March 2, 2022, 6:55 p.m. UTC | #1
On Fri, Feb 11, 2022 at 01:23:24PM -0700, Simon Glass wrote:

> Add a new 'pylint_err' target which only reports errors, not warnings.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 1ee7089c52..97e597ed43 100644
--- a/Makefile
+++ b/Makefile
@@ -521,7 +521,8 @@  env_h := include/generated/environment.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
 			 help %docs check% coccicheck \
-			 ubootversion backup tests check qcheck tcheck pylint
+			 ubootversion backup tests check qcheck tcheck pylint \
+			 pylint_err
 
 config-targets := 0
 mixed-targets  := 0
@@ -2259,7 +2260,7 @@  distclean: mrproper
 	@rm -f boards.cfg CHANGELOG
 
 # See doc/develop/python_cq.rst
-PHONY += pylint
+PHONY += pylint pylint_err
 PYLINT_BASE := scripts/pylint.base
 PYLINT_CUR := pylint.cur
 PYLINT_DIFF := pylint.diff
@@ -2301,6 +2302,11 @@  pylint:
 			echo "No pylint regressions"; \
 		fi
 
+# Check for errors only
+pylint_err:
+	$(Q)pylint -E  -j 0 --ignore-imports=yes \
+		$(shell find tools test -name "*.py")
+
 backup:
 	F=`basename $(srctree)` ; cd .. ; \
 	gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F