chore: add pre-commit

This commit is contained in:
ThetaDev 2024-11-26 19:06:53 +01:00
parent 20b060475b
commit 7d95fb0674
Signed by: ThetaDev
GPG key ID: E319D3C5148D65B6
2 changed files with 26 additions and 0 deletions

14
.editorconfig Normal file
View file

@ -0,0 +1,14 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 88
[{Makefile,*.go}]
indent_style = tab
[*.{json,md,rst,ini,yml,yaml,xml,html,js,jsx,ts,tsx,vue,kt}]
indent_size = 2

12
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/cathiele/pre-commit-rust
rev: v0.1.0
hooks:
- id: cargo-fmt
- id: cargo-clippy
args: ["--all", "--tests", "--", "-D", "warnings"]