Open AlejandroSuero opened 3 months ago
While trying to work on some test, I started with testing if the setup function works correctly.
As you can see I am setting the model to codellama:7b
but getting back the default model bigcode/starcoder2-15b
.
Maybe I am using the plugin incorrectly, but I copied the configs from the examples in the README.md
.
Thank you very very much for taking the time to write everything down. There is definitely a lot of room for improvement on making the project more contribution-friendly.
I've went ahead and merged #97 but rejected #98 as I feel it is a bit too opinionated to warrant adding CI checks.
Very happy to get some more contribution on this front, tests are also more than welcome. Let me know if there is anything I can do to help!
@McPatate I understand, the CI part was from experience in other projects where people usually don't look at the PR and notice that conflicts have been found, and GitHub decided to remove the notification for that.
If you want me to I can setup stylua
and selene
checks in CI for PRs.
stylua
there is this action JohnnyMorganz/stylua-actionselene
there is this one NTBBloodbath/selene-action, but hasn't been updated since 3y ago, so I made mine following the aforementioned one AlejandroSuero/selene-linter-action[!NOTE] Both
stylua
andselene
are installable viacargo
but I think this method is slower sincecargo
.Both actions will just download latest release if none is found or the version using is behind and use that instead of having to build it.
Motivation
When I was working on the files, there were no rules for the linters nor lsp,
lua_ls
and (in my case)selene
will complain about unused variables, parameters, shadowing, etc.Proposal
Configuration example
Linters
Expand to see configuration
```toml # selene.toml or .selene.toml std="neovim" # looks for a `neovim.yml` file to use as configuration [rules] global_usage = "warn" deprecated = "warn" # If changed to `allow` it will rely in `lua_ls` diagnostics alone multiple_statements = "warn" incorrect_standard_library_use = "allow" # This is for cases like `string.format`, `package.config`, etc. mixed_table = "allow" unused_variable = "warn" undefined_variable = "warn" ``` ```yml # neovim.yml --- base: lua51 # to use lua5.1 what Neovim uses globals: jit: any: true vim: any: true assert: args: - type: bool - type: string required: false after_each: args: - type: function before_each: args: - type: function describe: args: - type: string - type: function it: args: - type: string - type: function ```Expand to see configuration
```lua -- .luacheckrc -- Rerun tests only if their modification time changed. cache = true std = luajit codes = true self = false -- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html ignore = { "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. "122", -- Indirectly setting a readonly global } globals = { "_", "_PlenaryLeafTable", "_PlenaryBustedOldAssert", "_AssociatedBufs", } -- Global objects defined by the C code read_globals = { "vim", } exclude_files = { "lua/plenary/profile/lua_profiler.lua", "lua/plenary/profile/memory_profiler.lua", "lua/plenary/async_lib/*.lua", } files = { ["lua/plenary/busted.lua"] = { globals = { "describe", "it", "pending", "before_each", "after_each", "clear", "assert", "print", }, }, ["lua/plenary/async/init.lua"] = { globals = { "a", }, }, ["lua/plenary/async/tests.lua"] = { globals = { "describe", "it", "pending", "before_each", "after_each", }, }, } ```Formatter
We can also add a
Makefile
to usemake lint
andmake format
.Also the native support for
.editorconfig
in Neovim to ensure code style not only in lua files.Integrating linters and formatters in worflows
Contributing rules, standards and code of conduct
Adding a
CONTRIBUTING.md
and aCODE_OF_CONDUCT.md
for easy to follow instructions on how to change the repo.In
CONTRIBUTING.md
we could specify and tell the linters and formatters, how to structure the code, if following conventional commits standards or not and some how tofork
the repo just in case. We could also add aminimal.lua
configuration to test errors for bugs.minimal.lua config example
```bash nvim -nu minimal.lua ``` ```lua vim.cmd([[set runtimepath=$VIMRUNTIME]]) vim.cmd([[set packpath=/tmp/nvim/lazy/]]) local lazypath = "/tmp/nvim/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ { "huggingface/llm.nvim", config = function() require("llm").setup({ -- cf Setup }), end, lazy = false, enabled = true, }, }) ```Some example of this here.
Issue and PR templating
Establish issues templates at leats for differentiating from BUG or FEATURE REQUEST, and adding
bug
orenhancement
labels for easy to spot on the issues page.Some example of this here.
Adding a PR template to follow a changes made format on how it was being tested or not tested, which issue or features closes or fixes with
Fixes #<issue number>
.Some example of this here.
Workflows actions
Labelers
We could some actions to improve labeling depending on the files touched in the PRs with actions/labeler in combination with amannn/action-semantic-pull-request
Another action that I find very useful is eps1lon/actions-label-merge-conflict, labels the PR with a label (
conflicted
for example) and sends a message to the PR telling the people on the PR that they need to solve conflicts with their PR.Commits
For linting commits I find more useful and less annoying to use commitlint in CI than in
hooks
, allowing the person committing a change to not have to wait locally to commit changes. This action is as simple as: