diff --git a/CHANGELOG.md b/CHANGELOG.md index a1caf46..38d9f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2023-10-29 ### Changed -- Remove uses of `plenary.nvim`, +- POTENTIALLY BREAKING: Remove uses of `plenary.nvim`, [which may be removed as a dependency from `telescope.nvim`](https://github.com/nvim-telescope/telescope.nvim/issues/2552). NOTE: This should not break anything, but it may bump the minimum Neovim version requirement. The telescope picker may be a bit slower on Neovim 0.9. This will improve again with Neovim 0.10. +- Internal: Add type checks for `neovim stable` and `neovim nightly`. ## [0.5.0] - 2023-09-04 ### Added diff --git a/README.md b/README.md index 2540932..c389df5 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,15 @@ extension for [Manix](https://github.com/mlvzk/manix) ## Prerequisites +- Neovim >= 0.9 - Depends on [Manix](https://github.com/mlvzk/manix). - [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) +> **Note** +> +> This plugin may work with older Neovim versions, +> but is only tested with the latest stable version and nightly. + ## Installation Using lazy.nvim: diff --git a/flake.nix b/flake.nix index 79315bf..14f3ebd 100644 --- a/flake.nix +++ b/flake.nix @@ -44,42 +44,74 @@ docgen = pkgs.callPackage ./nix/docgen.nix {}; + mkTypeCheck = { + nvim-api ? [], + disabled-diagnostics ? [], + }: + pre-commit-hooks.lib.${system}.run { + src = self; + hooks = { + lua-ls.enable = true; + }; + settings = { + lua-ls = { + config = { + runtime.version = "LuaJIT"; + Lua = { + workspace = { + library = + nvim-api + ++ [ + "${pkgs.vimPlugins.telescope-nvim}/lua" + ]; + checkThirdParty = false; + ignoreDir = [ + ".git" + ".github" + ".direnv" + "result" + "nix" + "doc" + ]; + }; + diagnostics = { + libraryFiles = "Disable"; + disable = disabled-diagnostics; + }; + }; + }; + }; + }; + }; + + type-check-stable = mkTypeCheck { + nvim-api = [ + "${pkgs.neovim}/share/nvim/runtime/lua" + "${pkgs.vimPlugins.neodev-nvim}/types/stable" + ]; + disabled-diagnostics = [ + "undefined-doc-name" + "redundant-parameter" + "invisible" + ]; + }; + + type-check-nightly = mkTypeCheck { + nvim-api = [ + "${pkgs.neovim-nightly}/share/nvim/runtime/lua" + "${pkgs.vimPlugins.neodev-nvim}/types/nightly" + ]; + }; + pre-commit-check = pre-commit-hooks.lib.${system}.run { src = self; hooks = { alejandra.enable = true; stylua.enable = true; luacheck.enable = true; - lua-ls.enable = true; editorconfig-checker.enable = true; markdownlint.enable = true; }; - settings = { - lua-ls = { - config = { - runtime.version = "LuaJIT"; - Lua = { - workspace = { - library = [ - "${pkgs.neovim-nightly}/share/nvim/runtime/lua" - "${pkgs.vimPlugins.telescope-nvim}/lua" - "${pkgs.vimPlugins.neodev-nvim}/types/nightly" - ]; - checkThirdParty = false; - ignoreDir = [ - ".git" - ".github" - ".direnv" - "result" - "nix" - "doc" - ]; - }; - diagnostics.libraryFiles = "Disable"; - }; - }; - }; - }; }; telescope-manix-shell = pkgs.mkShell { @@ -110,7 +142,11 @@ }; checks = { - inherit pre-commit-check; + inherit + pre-commit-check + type-check-stable + type-check-nightly + ; }; }) // {