aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-11-14 00:04:21 -0500
committerJustin M. Keyes <justinkz@gmail.com>2025-11-14 00:14:19 -0500
commit2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4 (patch)
tree46218335ce05ef46ed48338d6551932bb43898ed
parentfix(angularls): reference to invalid field #4184 (diff)
downloadnvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar.gz
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar.bz2
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar.lz
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar.xz
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.tar.zst
nvim-lspconfig-2d113e6c02fb11af1cadf2d7c277c43fd94f8cc4.zip
ci: emmylua
- Introduce emmylua CI job to type-check code. - Drop old analyzers that haven't reported anything useful in a long time and are redundant with luals/emmylua.
-rw-r--r--.emmyrc.json30
-rw-r--r--.github/workflows/lint.yml22
-rw-r--r--.luacheckrc15
-rw-r--r--Makefile6
-rw-r--r--flake.nix2
-rw-r--r--lsp/lua_ls.lua1
-rw-r--r--selene.toml7
7 files changed, 42 insertions, 41 deletions
diff --git a/.emmyrc.json b/.emmyrc.json
new file mode 100644
index 00000000..d5678fdb
--- /dev/null
+++ b/.emmyrc.json
@@ -0,0 +1,30 @@
+{
+ "$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
+ "runtime": {
+ "version": "LuaJIT"
+ },
+ "diagnostics" : {
+ "disable" : [
+ "unnecessary-if"
+ ],
+ "enables": [
+ "iter-variable-reassign",
+ "non-literal-expressions-in-assert",
+ "incomplete-signature-doc",
+ "missing-global-doc"
+ ]
+ },
+ "strict": {
+ "typeCall": true,
+ "arrayIndex": true
+ },
+ "codeAction": {
+ "insertSpace": true
+ },
+ "workspace": {
+ "ignoreDir": [
+ "lspconfig/lua/",
+ "deps"
+ ]
+ }
+}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f80ce4cc..080de5ad 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -21,22 +21,18 @@ jobs:
exit 1
fi
- luacheck:
+ emmylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- - uses: lunarmodules/luacheck@v1
- with:
- args: lua/* test/*
-
- selene:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v5
- - uses: NTBBloodbath/selene-action@v1.0.0
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- args: --display-style=quiet .
+ - name: Install emmylua
+ run: |
+ mkdir -p build/emmylua
+ curl -L -o emmylua.tar.gz https://github.com/EmmyLuaLs/emmylua-analyzer-rust/releases/download/0.17.0/emmylua_check-linux-x64.tar.gz
+ tar -xzf emmylua.tar.gz -C build/emmylua
+ - name: Run emmylua
+ run: |
+ ./build/emmylua/emmylua_check --config=.emmyrc.json .
stylua:
runs-on: ubuntu-latest
diff --git a/.luacheckrc b/.luacheckrc
deleted file mode 100644
index ac6af148..00000000
--- a/.luacheckrc
+++ /dev/null
@@ -1,15 +0,0 @@
--- vim: ft=lua tw=80
-
--- Rerun tests only if their modification time changed.
-cache = true
-
-ignore = {
- "122", -- Setting a read-only field of a global variable.
- "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
- "631", -- max_line_length, vscode pkg URL is too long
-}
-
--- Global objects defined by the C code
-read_globals = {
- "vim",
-}
diff --git a/Makefile b/Makefile
index af2557f1..3e05b8c7 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,9 @@ test:
vusted ./test
lint:
- @printf "\nRunning luacheck\n"
- luacheck -q lua/* test/*
- @printf "\nRunning selene\n"
- selene --display-style=quiet .
@printf "\nRunning stylua\n"
stylua --check .
+ @printf "\nRunning emmylua\n"
+ emmylua_check .
.PHONY: test lint
diff --git a/flake.nix b/flake.nix
index 04681a1c..77fc8778 100644
--- a/flake.nix
+++ b/flake.nix
@@ -13,9 +13,7 @@
default = pkgs.mkShell {
packages = [
pkgs.stylua
- pkgs.luaPackages.luacheck
pkgs.luajitPackages.vusted
- pkgs.selene
];
};
});
diff --git a/lsp/lua_ls.lua b/lsp/lua_ls.lua
index 85bd8846..9b159ef7 100644
--- a/lsp/lua_ls.lua
+++ b/lsp/lua_ls.lua
@@ -73,6 +73,7 @@ return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = {
+ '.emmyrc.json',
'.luarc.json',
'.luarc.jsonc',
'.luacheckrc',
diff --git a/selene.toml b/selene.toml
deleted file mode 100644
index 08829537..00000000
--- a/selene.toml
+++ /dev/null
@@ -1,7 +0,0 @@
-std = "neovim"
-
-[rules]
-global_usage = "allow"
-multiple_statements = "allow"
-incorrect_standard_library_use = "allow"
-mixed_table = "allow"