[Chronik] Add clippy linter as build target
Summary:
cargo clippy catches common mistakes and improves the Rust code.
- Refactor: Add add_cargo_custom_target function to invoke a cargo command as custom target.
- Rename check-bitcoinsuite to check-bitcoinsuite-test to test bitcoinsuite crates.
- Add check-bitcoinsuite-clippy to lint bitcoinsuite crates.
- Add check-bitcoinsuite custom target that has the above two as dependencies.
Test Plan:
- ninja check-bitcoinsuite runs cargo clippy and cargo test successfully.
- 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