diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1375ac1..d656f72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,11 +36,12 @@ jobs: - name: Build binary and tests run: cargo build --bins --tests --release - - name: Lint code - uses: actions-rs/clippy-check@v1 + - name: Clippy + uses: giraffate/clippy-action@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --release + filter_mode: nofilter + fail_on_error: true + clippy_flags: --all-features --release - name: Run tests run: cargo test --release diff --git a/CHANGELOG.md b/CHANGELOG.md index e1cb28c..173f395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format of this file is based on [Keep a Changelog](https://keepachangelog.co - Update all dependencies, except `hyper` (#260) - Allow overriding the token through an argument or envvar (#261) +- Replace Lint code in our CI with Clippy+reviewdog (#262) ## [2.11.0] diff --git a/src/notebooks.rs b/src/notebooks.rs index 5416b58..3c7bd23 100644 --- a/src/notebooks.rs +++ b/src/notebooks.rs @@ -191,7 +191,7 @@ async fn handle_create_command(args: CreateArgs) -> Result<()> { None => NewNotebook::builder() .title(String::new()) .time_range(NewTimeRange::Absolute(TimeRange { from, to })) - .front_matter(args.front_matter.unwrap_or_else(FrontMatter::new)) + .front_matter(args.front_matter.unwrap_or_default()) .build(), }; diff --git a/src/templates.rs b/src/templates.rs index 69b928c..143d5f9 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -540,7 +540,7 @@ async fn expand_template_file( let notebook = expand_template(template, template_args).context("expanding template")?; - let notebook = notebook_create(&client, workspace_id, notebook) + let notebook = notebook_create(client, workspace_id, notebook) .await .context("Error creating notebook")?; diff --git a/src/update.rs b/src/update.rs index 1fce061..38c93b4 100644 --- a/src/update.rs +++ b/src/update.rs @@ -127,7 +127,7 @@ pub async fn retrieve_sha256_hash(version: &str, arch: &str) -> Result { response .lines() .find_map(|line| match line.split_once(" ") { - Some((sha256_hash, file)) if file == "fp" => Some(sha256_hash.to_owned()), + Some((sha256_hash, "fp")) => Some(sha256_hash.to_owned()), _ => None, }) .map_or_else(|| Err(anyhow!("version not found in checksum.sha256")), Ok)