style: add editorconfig & check hook

This commit is contained in:
winston 2023-02-10 09:13:56 +01:00
parent 8f4f64aa70
commit 9f906e0822
Signed by: winston
GPG key ID: 3786770EDBC2B481
8 changed files with 147 additions and 92 deletions

20
.ecrc Normal file
View file

@ -0,0 +1,20 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [
".gitsecret",
"lazy-lock.json",
"*.secret"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false
}
}

34
.editorconfig Normal file
View file

@ -0,0 +1,34 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
charset = utf-8
indent_size = 2
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# go
[*.go]
indent_style = tab
indent_size = 4
# python
[*.{ini,py,py.tpl,rst}]
indent_size = 4
# rust
[*.rs]
indent_size = 4
# documentation, utils
[*.{md,mdx,diff}]
trim_trailing_whitespace = false
# windows shell scripts
[*.{cmd,bat,ps1}]
end_of_line = crlf

View file

@ -7,6 +7,7 @@ in {
src = ./.; src = ./.;
hooks = { hooks = {
alejandra.enable = true; alejandra.enable = true;
editorconfig-checker.enable = true;
shellcheck.enable = true; shellcheck.enable = true;
stylua.enable = true; stylua.enable = true;
}; };