From 799483a16d3b1d0ff670cec4261a6f7edbf97012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Lehmann?= Date: Sat, 3 Feb 2024 22:27:59 +0100 Subject: [PATCH] run clippy in the ci --- .github/workflows/ci.yml | 13 +++++++++++++ build.rs | 2 +- src/util.rs | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f493b6..95a6d15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,3 +161,16 @@ jobs: components: rustfmt - name: Check formatting run: cargo fmt --all --check + + clippy: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy + - name: Lint code with Clippy + run: cargo clippy -- -D warnings diff --git a/build.rs b/build.rs index 5ec0caf..56fddaf 100644 --- a/build.rs +++ b/build.rs @@ -26,7 +26,7 @@ fn generate_man() -> std::io::Result<()> { } fn generate_markdown() -> std::io::Result<()> { - let md = clap_markdown::help_markdown::(); + let md = clap_markdown::help_markdown::(); let mut f = fs::File::create("doc/CommandLineHelp.md")?; write!(f, "{md}")?; Ok(()) diff --git a/src/util.rs b/src/util.rs index fd7542b..30fc7be 100644 --- a/src/util.rs +++ b/src/util.rs @@ -28,7 +28,7 @@ pub fn stdin_or_file(path: &Path) -> Result>> { } pub fn is_yage_encoded(s: &str) -> bool { - s.starts_with("yage[") && s.ends_with("]") + s.starts_with("yage[") && s.ends_with(']') } pub fn decrypt_yaml(value: &sy::Value, identities: &[x25519::Identity]) -> Result {