From 5ff0bbe4b2cd093f655832db3c90fcb09638b81a Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 23 Nov 2020 11:14:42 +0100 Subject: [PATCH] test/static: enforce E501 length check iteratively (MR 1993) Enforce the E501 length check of max 79 characters for all files where this test passes already. We can add more to the list as we adjust them and eventuelly require the check for all files. --- test/static_code_analysis.sh | 87 ++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/test/static_code_analysis.sh b/test/static_code_analysis.sh index f629920c..10ea6c74 100755 --- a/test/static_code_analysis.sh +++ b/test/static_code_analysis.sh @@ -46,5 +46,92 @@ $flake8_command --exclude=__init__.py --ignore "$_ignores" $py_files # shellcheck disable=SC2086 $flake8_command --filename=__init__.py --ignore "F401,$_ignores" $py_files +# Enforce max line length of 79 characters (#1986). We are iteratively fixing +# up the source files to adhere to this rule, so only check the ones that were +# fixed for now. Eventually, E501 can be removed from _ignores above, and this +# whole block can be removed. +echo "Test with flake8: *.py (E501)" +py_files=" + .gitlab/check_mr_settings.py + pmb/aportgen/device.py + pmb/build/__init__.py + pmb/build/autodetect.py + pmb/build/checksum.py + pmb/build/menuconfig.py + pmb/build/newapkbuild.py + pmb/chroot/__init__.py + pmb/chroot/binfmt.py + pmb/chroot/distccd.py + pmb/chroot/mount.py + pmb/chroot/other.py + pmb/chroot/shutdown.py + pmb/chroot/user.py + pmb/config/pmaports.py + pmb/config/save.py + pmb/config/workdir.py + pmb/export/__init__.py + pmb/export/frontend.py + pmb/export/symlinks.py + pmb/flasher/__init__.py + pmb/helpers/__init__.py + pmb/helpers/aportupgrade.py + pmb/helpers/args.py + pmb/helpers/file.py + pmb/helpers/git.py + pmb/helpers/lint.py + pmb/helpers/mount.py + pmb/helpers/package.py + pmb/helpers/repo.py + pmb/helpers/repo_missing.py + pmb/helpers/run.py + pmb/helpers/status.py + pmb/helpers/ui.py + pmb/install/__init__.py + pmb/install/recovery.py + pmb/parse/__init__.py + pmb/parse/arch.py + pmb/parse/arguments.py + pmb/parse/cpuinfo.py + pmb/parse/version.py + pmb/qemu/__init__.py + pmbootstrap.py + test/pmb_test/__init__.py + test/pmb_test/const.py + test/pmb_test/git.py + test/test_aportgen.py + test/test_bootimg.py + test/test_config_init.py + test/test_config_pmaports.py + test/test_config_workdir.py + test/test_cross_compile_distcc.py + test/test_crossdirect.py + test/test_envkernel.py + test/test_file.py + test/test_folder_size.py + test/test_frontend.py + test/test_helpers_git.py + test/test_helpers_lint.py + test/test_helpers_package.py + test/test_helpers_pmaports.py + test/test_helpers_repo.py + test/test_helpers_repo_missing.py + test/test_helpers_status.py + test/test_helpers_ui.py + test/test_install.py + test/test_kconfig_check.py + test/test_keys.py + test/test_mount.py + test/test_newapkbuild.py + test/test_parse_apkindex.py + test/test_parse_deviceinfo.py + test/test_questions.py + test/test_run_core.py + test/test_shell_escape.py + test/test_version.py + test/test_version_validate.py +" +# shellcheck disable=SC2086 +$flake8_command --select="E501" $py_files + # Done echo "Success!"