Skip to content

Commit

Permalink
Merge pull request #5582 from stacks-network/feat/clippy-ci
Browse files Browse the repository at this point in the history
Add clippy to CI
  • Loading branch information
wileyj authored Dec 18, 2024
2 parents bf1e4f2 + 906c012 commit 952d939
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Perform Clippy checks - currently set to defaults
## https://github.com/rust-lang/rust-clippy#usage
## https://rust-lang.github.io/rust-clippy/master/index.html
##
name: Clippy Checks

# Only run when:
# - PRs are (re)opened against develop branch
on:
pull_request:
branches:
- develop
types:
- opened
- reopened
- synchronize

jobs:
clippy_check:
name: Clippy Check
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@v3
- name: Define Rust Toolchain
id: define_rust_toolchain
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
- name: Setup Rust Toolchain
id: setup_rust_toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy
- name: Clippy
id: clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -p libstackerdb -p stacks-signer -p pox-locking --no-deps --tests --all-features -- -D warnings
2 changes: 1 addition & 1 deletion stacks-signer/src/chainstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ enum ProposedBy<'a> {
CurrentSortition(&'a SortitionState),
}

impl<'a> ProposedBy<'a> {
impl ProposedBy<'_> {
pub fn state(&self) -> &SortitionState {
match self {
ProposedBy::LastSortition(x) => x,
Expand Down
6 changes: 2 additions & 4 deletions stacks-signer/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ use stacks_common::types::chainstate::StacksPrivateKey;

extern crate alloc;

#[derive(Parser, Debug)]
#[command(author, version, about)]
#[command(long_version = VERSION_STRING.as_str())]

/// The CLI arguments for the stacks signer
#[derive(Parser, Debug)]
#[command(author, version, about, long_version = VERSION_STRING.as_str())]
pub struct Cli {
/// Subcommand action to take
#[command(subcommand)]
Expand Down

0 comments on commit 952d939

Please sign in to comment.