From f8a657abecb1a63d68f0906f3107d8e65cda39e2 Mon Sep 17 00:00:00 2001 From: wunder957 Date: Sun, 27 Aug 2023 20:59:51 +0800 Subject: [PATCH] Support pre-commit --- .github/workflows/lint.yml | 5 +++++ .pre-commit-config.yaml | 6 ++++++ src/main.rs | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4117b47..95adb2c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,5 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true - uses: actions/setup-python@v3 - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e45e964..1a49f8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,9 @@ repos: - id: debug-statements - id: forbid-new-submodules - id: trailing-whitespace + + - repo: https://github.com/doublify/pre-commit-rust + rev: master + hooks: + - id: fmt + - id: cargo-check diff --git a/src/main.rs b/src/main.rs index ef05134..50c9af6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,7 +125,7 @@ fn main() { .arg( Arg::new("auto_unmount") .long("auto_unmount") - .help("Automatically unmount on process exit") + .help("Automatically unmount on process exit"), ) .arg( Arg::new("allow-root")