diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..e84119f1 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files +- repo: local + hooks: + - id: fmt + name: fmt + entry: bash -c "cargo fmt --all" + language: system + types: [rust] + args: [""] diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 00000000..5b55cdb0 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,8 @@ +edition = "2021" +use_field_init_shorthand = true +newline_style = "Unix" +comment_width = 100 +format_code_in_doc_comments = true +imports_granularity = "Crate" +wrap_comments = true +group_imports = "StdExternalCrate"