From 048c0df91527a999e5019c8d63948e16ffc38897 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 14 Apr 2022 14:31:19 +0200 Subject: [PATCH] Setup Neovim yamllint the same way as xmllint Do not install globally. Provide configuration at expected location as default / fallback. --- home.nix | 2 +- home/files/yamllint/config | 23 +++++++++++++++++++++++ home/programs/neovim.nix | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 home/files/yamllint/config diff --git a/home.nix b/home.nix index 59c4237..1ba0926 100644 --- a/home.nix +++ b/home.nix @@ -67,7 +67,6 @@ pkgs.silver-searcher pkgs.curl pkgs.wget - pkgs.yamllint pkgs.kcachegrind pkgs.geckodriver @@ -134,6 +133,7 @@ "ctags/config.ctags".source = ./home/files/ctags; "litecli/config".source = ./home/files/litecli; "phpactor".source = ./home/files/phpactor; + "yamllint/config".source = ./home/files/yamllint/config; "tig/config".source = ./home/files/tig; "cmus/smyckblue.theme".source = ./home/files/cmus/smyckblue.theme; diff --git a/home/files/yamllint/config b/home/files/yamllint/config new file mode 100644 index 0000000..d951aa6 --- /dev/null +++ b/home/files/yamllint/config @@ -0,0 +1,23 @@ +extends: default + +rules: + line-length: disable + document-start: disable + braces: + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + brackets: + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + comments: + level: error + min-spaces-from-content: 1 + comments-indentation: + level: error + empty-lines: + max: 1 + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + indentation: + spaces: 2 diff --git a/home/programs/neovim.nix b/home/programs/neovim.nix index 25e9810..9877d3d 100644 --- a/home/programs/neovim.nix +++ b/home/programs/neovim.nix @@ -321,6 +321,7 @@ in { # Keep line break as fileContents strips last EOL + '' + let g:ale_yaml_yamllint_executable = '${pkgs.yamllint}/bin/yamllint' let g:ale_xml_xmllint_executable = '${pkgs.libxml2}/bin/xmllint' let g:ale_gitcommit_gitlint_executable = '${pkgs.gitlint}/bin/gitlint' let g:ale_nix_statix_check_executable = '${pkgs.statix}/bin/statix'