From 5fee0201535fafceabd384ff3da3426e1fbd13fd Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 4 Sep 2025 21:35:37 +0200 Subject: T7787: Makefile check for unused-imports should be mandatory Currently our make target for "unused-imports" check is optional and a "suggestion". As we now also use pylint to check for missing imports and code issues, we will now make the unused import check mandatory. This improves overall code quality. --- .github/workflows/check-unused-imports.yml | 14 -------------- Makefile | 6 ++---- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/check-unused-imports.yml diff --git a/.github/workflows/check-unused-imports.yml b/.github/workflows/check-unused-imports.yml deleted file mode 100644 index d6dd61483..000000000 --- a/.github/workflows/check-unused-imports.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check for unused imports using Pylint -on: - pull_request_target: - branches: - - current - -permissions: - pull-requests: write - contents: read - -jobs: - check-unused-imports: - uses: vyos/.github/.github/workflows/check-unused-imports.yml@current - secrets: inherit diff --git a/Makefile b/Makefile index 333505ef0..d6cefcf91 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,8 @@ check_migration_scripts_executable: pylint: interface_definitions @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*) + @echo Running "pylint to check for unused imports ..." + @PYTHONPATH=python/ pylint --disable=all --enable=W0611 $(shell git ls-files *.py src/migration-scripts src/services) .PHONY: j2lint j2lint: @@ -131,10 +133,6 @@ endif sonar: sonar-scanner -X -Dsonar.login=${SONAR_TOKEN} -.PHONY: unused-imports -unused-imports: - @pylint --disable=all --enable=W0611 $(shell git ls-files *.py src/migration-scripts src/services) - deb: dpkg-buildpackage -uc -us -tc -b -- cgit v1.2.3