Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local developer installation and CI setup #6

Open
matu3ba opened this issue Oct 3, 2021 · 1 comment
Open

local developer installation and CI setup #6

matu3ba opened this issue Oct 3, 2021 · 1 comment

Comments

@matu3ba
Copy link

matu3ba commented Oct 3, 2021

  1. lua cov local dev and CI installation
  2. stylua also has nice github actions => column width 4, spaces or tabs?!
  3. luacheck local dev installation
  4. for completeness: luarocks installation as local user => plugins may want to use the lua plugin manager

For stylua, I failed to define autocmds like this:

Styluafmt = function()
-- hardcoding formatting option for not needing a config file
-- single quote and emptyspace are consisently readable independ of editor
vim.api.nvim_command([[
if &modified
  let cursor_pos = getpos('.')
  :!stylua --indent-type Spaces --quote-style AutoPreferSingle %
  call setpos('.', cursor_pos)
end
]])
end
vim.api.nvim_exec([[
augroup TESTME
autocmd!
autocmd BufWritePre *.lua :lua Styluafmt()
augroup END
]], false)

The github setup for stylua is quite simple: nvim-lua/plenary.nvim@6a51028 though I didnt check if this includes spaces/tabs formatting.

@matu3ba
Copy link
Author

matu3ba commented Mar 31, 2023

Collecting my ideas while working on a thing:

Developing dependencies:

  • luacheck
    • lurocks install --local luacheck
    • luarocks install --local lanes
  • luacov
    • luarocks install --local luacov
  • stylua
    • cargo install stylua
Developing manual commands
  • luacheck
    • luacheck .
  • luacov
    • lua -lluacov test/* && TODO
  • stylua
    • stylua --color always --check lua/ tests/
  • plenary
    • nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
    • not working yet nvim --headless --noplugin -u tests/minimal_init.lua -c "PlenaryBustedDirectory ../plenary.nvim/ {minimal_init = 'tests/minimal_init.lua'}"

Afaiu, minima_init.lua needs the rtp paths to the root files for neovim runtime to pick dependencies up (lua files are atomatically picked up).

-- vim.api.nvim_list_runtime_paths(), :h nvim_list_runtime_paths
-- vim.opt.runtimepath:get(), :h vim.opt
-- vim.opt.rtp:append()

Developing command suggestion

TODO

I very much dislike a CI setup being different from the local one, so I'll add that one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant