mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-15 05:21:06 +01:00
editorconfig: add module (#3204)
Add a module to generate `~/.editorconfig` configuration file. Co-authored-by: Robert Helgesson <robert@rycee.net> Co-authored-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
583a99f016
commit
de94878b6b
8 changed files with 109 additions and 0 deletions
1
tests/modules/misc/editorconfig/default.nix
Normal file
1
tests/modules/misc/editorconfig/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ editorconfig-simple-config = ./editorconfig-simple-config.nix; }
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Generated by Home Manager
|
||||
root=true
|
||||
|
||||
[*]
|
||||
charset=utf-8
|
||||
end_of_line=lf
|
||||
indent_style=space
|
||||
insert_final_newline=true
|
||||
max_line_width=78
|
||||
trim_trailing_whitespace=true
|
||||
|
||||
[*.md]
|
||||
indent_size=unset
|
||||
trim_trailing_whitespace=false
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
editorconfig = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"*" = {
|
||||
charset = "utf-8";
|
||||
end_of_line = "lf";
|
||||
trim_trailing_whitespace = true;
|
||||
insert_final_newline = true;
|
||||
max_line_width = 78;
|
||||
indent_style = "space";
|
||||
};
|
||||
"*.md" = {
|
||||
indent_size = "unset";
|
||||
trim_trailing_whitespace = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.editorconfig
|
||||
assertFileContent home-files/.editorconfig ${
|
||||
./editorconfig-simple-config-expected
|
||||
}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue