Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .emmyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"runtime": {
"version": "LuaJIT",
"requirePattern": ["lua/?.lua", "lua/?/init.lua"]
},
"workspace": {
"library": ["$VIMRUNTIME", "$LLS_Addons/luvit"]
}
}
8 changes: 0 additions & 8 deletions .github/workflows/.luarc.json

This file was deleted.

26 changes: 17 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,28 @@ jobs:
version: latest
args: --check .

typecheck:
typecheck-emmylua:
name: Typecheck sources
strategy:
matrix:
os: [ubuntu-latest]
neovim_version: ["v0.11.0"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Type Check Code Base
uses: stevearc/nvim-typecheck-action@v2
- name: Install emmylua_check from crates.io
uses: baptiste0928/cargo-install@v3
with:
crate: emmylua_check
version: '^0.10.0'
- name: Setup neovim
uses: rhysd/action-setup-vim@v1
with:
configpath: .github/workflows/.luarc.json
path: lua
level: Warning
nvim-version: v0.11.0
neovim: true
version: ${{ matrix.neovim_version }}
- uses: actions/checkout@v4
# TODO (sbadragan): need to fetch LLS_Addons -> luvit library as well
- name: Run emmylua_check
run: |
export VIMRUNTIME=$( nvim -u NORC --headless -c 'echo $VIMRUNTIME' -c 'q' 2>&1)
echo $VIMRUNTIME
emmylua_check -c .emmyrc.json ./lua ./tests
4 changes: 3 additions & 1 deletion lua/grug-far/test/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function M.getBufExtmarksVirtText(buf, namespaceName)

for i = 1, #marks do
local _, _, _, details = unpack(marks[i])
---@diagnostic disable-next-line: need-check-nil
local virt_lines = details.virt_lines
if virt_lines then
for j = 1, #virt_lines do
Expand All @@ -36,6 +37,7 @@ function M.getBufExtmarksVirtText(buf, namespaceName)
end
end

---@diagnostic disable-next-line: need-check-nil
local virt_text = details.virt_text
if virt_text then
for l = 1, #virt_text do
Expand Down Expand Up @@ -248,7 +250,7 @@ end

--- writes files given based on given spec to temp test dir
--- clears out temp test dir beforehand
---@param files {[string]: string}
---@param files {filename: string, content: string}[]
---@param dirs? string[]
function M.writeTestFiles(files, dirs)
vim.fn.delete('./temp_test_dir', 'rf')
Expand Down
Loading