HomePhabricator

[Chronik] Add clippy linter as build target

Description

[Chronik] Add clippy linter as build target

Summary:
cargo clippy catches common mistakes and improves the Rust code.

  1. Refactor: Add add_cargo_custom_target function to invoke a cargo command as custom target.
  2. Rename check-bitcoinsuite to check-bitcoinsuite-test to test bitcoinsuite crates.
  3. Add check-bitcoinsuite-clippy to lint bitcoinsuite crates.
  4. Add check-bitcoinsuite custom target that has the above two as dependencies.

Test Plan:

  1. ninja check-bitcoinsuite runs cargo clippy and cargo test successfully.
  2. Adding pub struct X; at the end of chronik/bitcoinsuite-core/src/lib.rs, then running ninja check-bitcoinsuite makes the build fail.

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D11706

Details

Provenance
tobias_ruckAuthored on Jul 4 2022, 19:44
tobias_ruckPushed on Jul 5 2022, 14:35
Reviewer
Restricted Project
Differential Revision
D11706: [Chronik] Add clippy linter as build target
Parents
rABC95d89c6f1896: [Automated] Update timing.json
Branches
Unknown
Tags
Unknown