aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-06-09 17:09:24 +0200
committerGitHub <noreply@github.com>2022-06-09 08:09:24 -0700
commit6d57bb89c1ee376b60198f4a4b75430905844138 (patch)
tree5e9b522be1202cedd601e01a983cc7893b581bf4 /Makefile
parent9662cd7f48c5dc3b7ab5f5ca3e5b217a03faa6c9 (diff)
downloadrneovim-6d57bb89c1ee376b60198f4a4b75430905844138.tar.gz
rneovim-6d57bb89c1ee376b60198f4a4b75430905844138.tar.bz2
rneovim-6d57bb89c1ee376b60198f4a4b75430905844138.zip
build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake Cmake is our source of truth. We should have as much of our build process there as possible so everyone can make use of it. * build: remove redundant check for ninja generator The minimum cmake version as of writing this is 3.10, which has ninja support.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile66
1 files changed, 8 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index 3039d84a6b..5a5bd80763 100644
--- a/Makefile
+++ b/Makefile
@@ -47,13 +47,7 @@ endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(CMAKE_GENERATOR))
- ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
- BUILD_TOOL = ninja
- else
- # User's version of CMake doesn't support Ninja
- BUILD_TOOL = $(MAKE)
- CMAKE_GENERATOR := Unix Makefiles
- endif
+ BUILD_TOOL = ninja
else
BUILD_TOOL = $(MAKE)
endif
@@ -140,51 +134,19 @@ build/runtime/doc/tags helptags: | nvim
helphtml: | nvim build/runtime/doc/tags
+$(BUILD_TOOL) -C build doc_html
-functionaltest: | nvim
- +$(BUILD_TOOL) -C build functionaltest
+functionaltest functionaltest-lua unittest benchmark: | nvim
+ $(BUILD_TOOL) -C build $@
-functionaltest-lua: | nvim
- +$(BUILD_TOOL) -C build functionaltest-lua
+lintlua lintsh lintpy lintuncrustify lintc lintcfull check-single-includes generated-sources: | build/.ran-cmake
+ $(CMAKE_PRG) --build build --target $@
-stylua:
- stylua --check runtime/
-
-lualint: | build/.ran-cmake deps
- $(BUILD_TOOL) -C build lualint
-
-_opt_stylua:
- @command -v stylua && { $(MAKE) stylua; exit $$?; } \
- || echo "SKIP: stylua (stylua not found)"
-
-shlint:
- @shellcheck --version | head -n 2
- shellcheck scripts/vim-patch.sh
-
-_opt_shlint:
- @command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
- || echo "SKIP: shlint (shellcheck not found)"
-
-pylint:
- flake8 contrib/ scripts/ src/ test/
-
-# Run pylint only if flake8 is installed.
-_opt_pylint:
- @command -v flake8 && { $(MAKE) pylint; exit $$?; } \
- || echo "SKIP: pylint (flake8 not found)"
-
-commitlint:
+commitlint: | nvim
$(NVIM_PRG) -u NONE -es +"lua require('scripts.lintcommit').main({trace=false})"
_opt_commitlint:
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|| echo "SKIP: commitlint (build/bin/nvim not found)"
-unittest: | nvim
- +$(BUILD_TOOL) -C build unittest
-
-benchmark: | nvim
- +$(BUILD_TOOL) -C build benchmark
-
test: functionaltest unittest
clean:
@@ -200,18 +162,6 @@ distclean:
install: checkprefix nvim
+$(BUILD_TOOL) -C build install
-clint: build/.ran-cmake
- +$(BUILD_TOOL) -C build clint
-
-clint-full: build/.ran-cmake
- +$(BUILD_TOOL) -C build clint-full
-
-check-single-includes: build/.ran-cmake
- +$(BUILD_TOOL) -C build check-single-includes
-
-generated-sources: build/.ran-cmake
- +$(BUILD_TOOL) -C build generated-sources
-
appimage:
bash scripts/genappimage.sh
@@ -221,7 +171,7 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
-lint: check-single-includes clint _opt_stylua lualint _opt_pylint _opt_shlint _opt_commitlint
+lint: check-single-includes lintc lintlua lintpy lintsh _opt_commitlint lintuncrustify
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
@@ -233,4 +183,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
-.PHONY: test stylua lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
+.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint