ci: pylint target via flake8

Ref: https://github.com/neovim/neovim/pull/10631#issuecomment-515756591
This commit is contained in:
Daniel Hahler 2019-07-29 05:04:12 +02:00
parent d7b04ae7a7
commit d651710de1
5 changed files with 21 additions and 7 deletions

2
.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length = 88

View File

@ -516,6 +516,7 @@ if(NOT BUSTED_OUTPUT_TYPE)
endif() endif()
find_program(LUACHECK_PRG luacheck) find_program(LUACHECK_PRG luacheck)
find_program(FLAKE8_PRG flake8)
find_program(GPERF_PRG gperf) find_program(GPERF_PRG gperf)
include(InstallHelpers) include(InstallHelpers)
@ -667,6 +668,15 @@ else()
COMMENT "lualint: LUACHECK_PRG not defined") COMMENT "lualint: LUACHECK_PRG not defined")
endif() endif()
if(FLAKE8_PRG)
add_custom_target(pylint
COMMAND ${FLAKE8_PRG} contrib/ scripts/ src/ test/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_custom_target(pylint false
COMMENT "flake8: FLAKE8_PRG not defined")
endif()
set(CPACK_PACKAGE_NAME "Neovim") set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io") set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM}) set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})

View File

@ -138,6 +138,9 @@ functionaltest-lua: | nvim
lualint: | build/.ran-cmake deps lualint: | build/.ran-cmake deps
$(BUILD_CMD) -C build lualint $(BUILD_CMD) -C build lualint
pylint: | build/.ran-cmake deps
$(BUILD_CMD) -C build pylint
unittest: | nvim unittest: | nvim
+$(BUILD_CMD) -C build unittest +$(BUILD_CMD) -C build unittest
@ -179,6 +182,6 @@ appimage:
appimage-%: appimage-%:
bash scripts/genappimage.sh $* bash scripts/genappimage.sh $*
lint: check-single-includes clint lualint lint: check-single-includes clint lualint pylint
.PHONY: test lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix .PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix

View File

@ -4,6 +4,7 @@ set -e
set -o pipefail set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then if [[ "${CI_TARGET}" == lint ]]; then
python -m pip -q install --user --upgrade flake8
exit exit
fi fi

View File

@ -9,26 +9,24 @@ source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh" source "${CI_DIR}/common/suite.sh"
enter_suite 'clint' enter_suite 'clint'
run_test 'make clint-full' clint run_test 'make clint-full' clint
exit_suite --continue exit_suite --continue
enter_suite 'lualint' enter_suite 'lualint'
run_test 'make lualint' lualint run_test 'make lualint' lualint
exit_suite --continue
enter_suite 'pylint'
run_test 'make pylint' pylint
exit_suite --continue exit_suite --continue
enter_suite single-includes enter_suite single-includes
CLICOLOR_FORCE=1 run_test_wd \ CLICOLOR_FORCE=1 run_test_wd \
--allow-hang \ --allow-hang \
10s \ 10s \
'make check-single-includes' \ 'make check-single-includes' \
'csi_clean' \ 'csi_clean' \
single-includes single-includes
exit_suite --continue exit_suite --continue
end_tests end_tests