Skip to content

Commit

Permalink
tests: add type checking for neovim-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Oct 29, 2023
1 parent af1dd04 commit bd3118c
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 29 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
92 changes: 64 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -110,7 +142,11 @@
};

checks = {
inherit pre-commit-check;
inherit
pre-commit-check
type-check-stable
type-check-nightly
;
};
})
// {
Expand Down

0 comments on commit bd3118c

Please sign in to comment.