diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-07-22 16:03:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-22 16:03:57 +0200 |
| commit | dea50dfb0ded322d0f2d3385e11658143a1d210a (patch) | |
| tree | 8dee6b19d109b487bca23c3ab4b4e4262a550825 /Makefile | |
| parent | fe8559ec092aea60bf4104dfb1f91cd790ce9b55 (diff) | |
| parent | b7a24e7f4945d43deebaa5b33fbcc54e29618938 (diff) | |
| download | vyos-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-- | Makefile | 10 |
1 files changed, 7 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,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 |
