diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-07-21 21:09:47 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-07-21 21:09:47 +0200 |
| commit | 1dc4f02a6c51e3903fe40f7cc97a5b3298e423ac (patch) | |
| tree | 512355f7257e7d36a9905babeb8e518e149b7ef3 | |
| parent | ef3ed4feae0a08be815020a0013bd6217d70381c (diff) | |
| download | vyos-1x-1dc4f02a6c51e3903fe40f7cc97a5b3298e423ac.tar.gz vyos-1x-1dc4f02a6c51e3903fe40f7cc97a5b3298e423ac.zip | |
T7648: enable pylint target for "make all" to check for e.g. missing imports
| -rw-r--r-- | Makefile | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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,10 @@ 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: + @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) + .PHONY: j2lint j2lint: ifndef J2LINT @@ -129,7 +132,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 |
