summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-07-22 16:03:57 +0200
committerGitHub <noreply@github.com>2025-07-22 16:03:57 +0200
commitdea50dfb0ded322d0f2d3385e11658143a1d210a (patch)
tree8dee6b19d109b487bca23c3ab4b4e4262a550825 /Makefile
parentfe8559ec092aea60bf4104dfb1f91cd790ce9b55 (diff)
parentb7a24e7f4945d43deebaa5b33fbcc54e29618938 (diff)
downloadvyos-1x-dea50dfb0ded322d0f2d3385e11658143a1d210a.tar.gz
vyos-1x-dea50dfb0ded322d0f2d3385e11658143a1d210a.zip
Merge pull request #4613 from c-po/add-pylint
T7648: Set up a linter check to check complete files for syntax errors and missing imports
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 218fc4ae1..3235c7214 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,6 @@ LIBS := -lzmq
CFLAGS :=
BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH)
J2LINT := $(shell command -v j2lint 2> /dev/null)
-PYLINT_FILES := $(shell git ls-files *.py src/migration-scripts src/services)
LIBVYOSCONFIG_BUILD_PATH := /tmp/libvyosconfig/_build/libvyosconfig.so
LIBVYOSCONFIG_STATUS := $(shell git submodule status)
@@ -89,7 +88,7 @@ vyshim:
$(MAKE) -C $(SHIM_DIR)
.PHONY: all
-all: clean copyright libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json
+all: clean copyright pylint libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json
.PHONY: copyright
copyright:
@@ -116,6 +115,11 @@ check_migration_scripts_executable:
@echo "Checking if migration scripts have executable bit set..."
find src/migration-scripts -type f -not -executable -print -exec false {} + || sh -c 'echo "Found files that are not executable! Add permissions." && exit 1'
+.PHONE: pylint
+pylint:
+ @echo Running "pylint --errors-only ..."
+ @PYTHONPATH=python/ pylint --errors-only $(shell git ls-files python/vyos/ifconfig/*.py python/vyos/utils/*.py src/conf_mode/*.py src/op_mode/*.py src/migration-scripts src/services/vyos*)
+
.PHONY: j2lint
j2lint:
ifndef J2LINT
@@ -129,7 +133,7 @@ sonar:
.PHONY: unused-imports
unused-imports:
- @pylint --disable=all --enable=W0611 $(PYLINT_FILES)
+ @pylint --disable=all --enable=W0611 $(shell git ls-files *.py src/migration-scripts src/services)
deb:
dpkg-buildpackage -uc -us -tc -b