From 58bbc0b268542d81983391aa2917e08d7e6f1e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Tue, 26 Sep 2023 13:38:54 +0300 Subject: [PATCH] style(format): add .editorconfig --- .editorconfig | 14 ++++++++++++++ .github/workflows/ci.yml | 8 +++++++- src/args.rs | 6 +++--- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3b2db60 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# configuration for https://editorconfig.org + +root = true + +[*.rs] +indent_style = space +indent_size = 4 + +[args.rs] +indent_size = unset + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d8309..2459641 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,9 +102,15 @@ jobs: - name: Cache Cargo dependencies uses: Swatinem/rust-cache@v2 - - name: Check formatting + - name: Check code formatting run: cargo fmt --all -- --check + - name: Install editorconfig-checker + uses: editorconfig-checker/action-editorconfig-checker@main + + - name: Check file formatting + run: editorconfig-checker + - name: Check lints run: cargo clippy -- -D warnings diff --git a/src/args.rs b/src/args.rs index b3d6319..b8ae73f 100644 --- a/src/args.rs +++ b/src/args.rs @@ -19,9 +19,9 @@ pub const BANNER: &str = r#" version, author = clap::crate_authors!("\n"), about, - rename_all_env = "screaming-snake", - before_help = BANNER, - help_template = "\ + rename_all_env = "screaming-snake", + before_help = BANNER, + help_template = "\ {before-help}-=[ {name} {version} ]=-\n {about-with-newline}Written by {author-with-newline} {usage-heading}