1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 02:39:48 +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:
Tomo 2023-02-05 02:12:28 -08:00 committed by GitHub
parent e716961d78
commit ffc022b6a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 92 additions and 0 deletions

3
.github/CODEOWNERS vendored
View file

@ -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

View file

@ -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";
};
}

View file

@ -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

View 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;
};
}

View file

@ -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

View 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
}
'';
}

View 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

View file

@ -0,0 +1 @@
{ vim-vint-basic-configuration = ./basic-configuration.nix; }