Page MenuHomePhabricator

[Chronik] Add clippy linter as build target
ClosedPublic

Authored by tobias_ruck on Jul 4 2022, 19:49.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC023ec18fb65e: [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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fix indentation, add CARGO_BUILD_DIR to clean files.

Fabien requested changes to this revision.Jul 5 2022, 07:43
Fabien added inline comments.
chronik/CMakeLists.txt
18 ↗(On Diff #34241)

Do you plan to add more parameters ? Otherwise you can just use ARGN directly, and make it a macro

46 ↗(On Diff #34241)

This can be integrated into the add_cargo_custom_target facility

This revision now requires changes to proceed.Jul 5 2022, 07:43

Refactor: add add_crate_test_targets; intended to be used for chronik- crates later

This revision is now accepted and ready to land.Jul 5 2022, 14:33