aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-05-09 11:23:26 +0200
committerChristian Clason <c.clason@uni-graz.at>2022-05-09 16:31:55 +0200
commit676e9e9334043ce74af74f85f889b0327a443d0b (patch)
tree989665897b46546ef089482c285b12fbd1dc19ab
parente31b32a293f6ba8708499a176234f8be1df6a145 (diff)
downloadrneovim-676e9e9334043ce74af74f85f889b0327a443d0b.tar.gz
rneovim-676e9e9334043ce74af74f85f889b0327a443d0b.tar.bz2
rneovim-676e9e9334043ce74af74f85f889b0327a443d0b.zip
ci: lint runtime with stylua
-rw-r--r--.github/workflows/ci.yml7
-rw-r--r--.stylua.toml6
-rw-r--r--.styluaignore3
-rw-r--r--Makefile11
4 files changed, 25 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1aa0906ffc..87c270afbe 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -87,6 +87,13 @@ jobs:
run: ./ci/run_lint.sh clint-full
- if: "!cancelled()"
+ name: stylua
+ uses: JohnnyMorganz/stylua-action@1.0.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ args: --check runtime/
+
+ - if: "!cancelled()"
name: lualint
run: ./ci/run_lint.sh lualint
diff --git a/.stylua.toml b/.stylua.toml
new file mode 100644
index 0000000000..255bfd939d
--- /dev/null
+++ b/.stylua.toml
@@ -0,0 +1,6 @@
+column_width = 120
+line_endings = "Unix"
+indent_type = "Spaces"
+indent_width = 2
+quote_style = "AutoPreferSingle"
+call_parentheses = "Always"
diff --git a/.styluaignore b/.styluaignore
new file mode 100644
index 0000000000..c1871de90a
--- /dev/null
+++ b/.styluaignore
@@ -0,0 +1,3 @@
+/scripts
+/src
+/test
diff --git a/Makefile b/Makefile
index df4f2995d8..3039d84a6b 100644
--- a/Makefile
+++ b/Makefile
@@ -146,9 +146,16 @@ functionaltest: | nvim
functionaltest-lua: | nvim
+$(BUILD_TOOL) -C build functionaltest-lua
+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
@@ -214,7 +221,7 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
-lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
+lint: check-single-includes clint _opt_stylua lualint _opt_pylint _opt_shlint _opt_commitlint
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
@@ -226,4 +233,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
-.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
+.PHONY: test stylua lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint