mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
vim-vint: add module (#3604)
* vim-vint: add module * vim-vint: add tests * maintainers: add tomodachi94 * vim-vint: fix tests --------- Co-authored-by: Naïm Favier <n@monade.li>
This commit is contained in:
parent
e716961d78
commit
ffc022b6a7
8 changed files with 92 additions and 0 deletions
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -335,6 +335,9 @@ Makefile @thiagokokada
|
|||
/modules/programs/topgrade.nix @msfjarvis
|
||||
/tests/modules/programs/topgrade @msfjarvis
|
||||
|
||||
/modules/programs/vim-vint.nix @tomodachi94
|
||||
/tests/modules/programs/vim-vint @tomodachi94
|
||||
|
||||
/modules/programs/watson.nix @polykernel
|
||||
/tests/modules/programs/watson @polykernel
|
||||
|
||||
|
|
|
@ -360,4 +360,11 @@
|
|||
keys =
|
||||
[{ fingerprint = "7944 74B7 D236 DAB9 C9EF E7F9 5CCE 6F14 66D4 7C9E"; }];
|
||||
};
|
||||
tomodachi94 = {
|
||||
email = "tomodachi94+nixpkgs@protonmail.com";
|
||||
matrix = "@tomodachi94:matrix.org";
|
||||
github = "tomodachi94";
|
||||
githubId = 68489118;
|
||||
name = "tomodachi94";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -186,6 +186,7 @@ let
|
|||
./programs/topgrade.nix
|
||||
./programs/urxvt.nix
|
||||
./programs/vim.nix
|
||||
./programs/vim-vint.nix
|
||||
./programs/vscode.nix
|
||||
./programs/vscode/haskell.nix
|
||||
./programs/pywal.nix
|
||||
|
|
36
modules/programs/vim-vint.nix
Normal file
36
modules/programs/vim-vint.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.vim-vint;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.tomodachi94 ];
|
||||
|
||||
options = {
|
||||
programs.vim-vint = {
|
||||
enable = mkEnableOption "the Vint linter for Vimscript";
|
||||
package = mkPackageOption pkgs "vim-vint" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/.vintrc.yaml</filename>
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile.".vintrc.yaml".source =
|
||||
yamlFormat.generate "vim-vint-config" cfg.settings;
|
||||
};
|
||||
}
|
|
@ -122,6 +122,7 @@ import nmt {
|
|||
./modules/programs/tmate
|
||||
./modules/programs/tmux
|
||||
./modules/programs/topgrade
|
||||
./modules/programs/vim-vint
|
||||
./modules/programs/vscode
|
||||
./modules/programs/watson
|
||||
./modules/programs/wezterm
|
||||
|
|
27
tests/modules/programs/vim-vint/basic-configuration.nix
Normal file
27
tests/modules/programs/vim-vint/basic-configuration.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ config, pkgs, lib, xdg, ... }:
|
||||
|
||||
{
|
||||
programs.vim-vint = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cmdargs = {
|
||||
severity = "error";
|
||||
color = true;
|
||||
env = { neovim = true; };
|
||||
};
|
||||
policies = {
|
||||
ProhibitEqualTildeOperator.enabled = false;
|
||||
ProhibitUsingUndeclaredVariable.enabled = false;
|
||||
ProhibitAbbreviationOption.enabled = false;
|
||||
ProhibitImplicitScopeVariable.enabled = false;
|
||||
ProhibitSetNoCompatible.enabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent home-files/.config/.vintrc.yaml ${
|
||||
./basic-configuration.yaml
|
||||
}
|
||||
'';
|
||||
}
|
16
tests/modules/programs/vim-vint/basic-configuration.yaml
Normal file
16
tests/modules/programs/vim-vint/basic-configuration.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
cmdargs:
|
||||
color: true
|
||||
env:
|
||||
neovim: true
|
||||
severity: error
|
||||
policies:
|
||||
ProhibitAbbreviationOption:
|
||||
enabled: false
|
||||
ProhibitEqualTildeOperator:
|
||||
enabled: false
|
||||
ProhibitImplicitScopeVariable:
|
||||
enabled: false
|
||||
ProhibitSetNoCompatible:
|
||||
enabled: false
|
||||
ProhibitUsingUndeclaredVariable:
|
||||
enabled: false
|
1
tests/modules/programs/vim-vint/default.nix
Normal file
1
tests/modules/programs/vim-vint/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ vim-vint-basic-configuration = ./basic-configuration.nix; }
|
Loading…
Reference in a new issue