Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabe clippy on CI #1061

Merged
merged 10 commits into from Jun 23, 2022
Merged

Commits on Jun 23, 2022

  1. Remove redundant field names

    clippy emits two warnings of form:
    
     warning: redundant field names in struct initialization
    
    Remove the redundant field names.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    63f4ff6 View commit details
    Browse the repository at this point in the history
  2. Allow clippy::collapsible_else_if

    clippy emits:
    
      warning: this `else { if .. }` block can be collapsed
    
    In this instance the code is more readable how it is, we should ignore
    clippy.
    
    Add compiler directive to quieten warning.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    3102a48 View commit details
    Browse the repository at this point in the history
  3. Remove unnecessary 'static lifetime

    clippy emits a bunch of:
    
     warning: statics have by default a `'static` lifetime
    
    Remove the unnecessary 'static lifetimes.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    acd551e View commit details
    Browse the repository at this point in the history
  4. Use custom digit grouping

    clippy emits a bunch of:
    
     warning: digits grouped inconsistently by underscores
    
    We have a custom grouping elsewhere in this file
    
      10_000_000_00 sats == 10 BTC
    
    Fix up all instances of large sats amount to uniformly using this format
    and add compiler directives where needed to shoosh clippy.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    fd4239f View commit details
    Browse the repository at this point in the history
  5. Remove unneeded reference

    clippy emits:
    
     warning: this expression creates a reference which is immediately
     dereferenced by the compiler
    
    As suggested, remove the explicit reference.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    eccd401 View commit details
    Browse the repository at this point in the history
  6. Remove unneeded clone

    clippy emits:
    
     warning: using `clone` on type `blockdata::transaction::OutPoint` which
     implements the `Copy` trait
    
    Remove unneeded call to `clone`.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    67ed8f6 View commit details
    Browse the repository at this point in the history
  7. Remove unnecessary ? operator

    clippy emits:
    
      warning: question mark operator is useless here
    
    As suggested, remove the `?` operator.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    a2a54b3 View commit details
    Browse the repository at this point in the history
  8. Enable clippy on CI

    Add a clippy configuration file configuring the MSRV. Add a github
    actions job to run clippy on CI.
    
    Please note the job does _not_ use `--all-targets` because doing so
    causes:
    ```
    error[E0554]: `#![feature]` may not be used on the stable release channel
    --> src/lib.rs:46:54
    |
    46 | #![cfg_attr(all(test, feature = "unstable"), feature(test))]
    ```
    tcharding committed Jun 23, 2022
    Copy the full SHA
    668b37a View commit details
    Browse the repository at this point in the history
  9. Add githooks directory

    Add a `githooks` directory. Copy the sample pre-commit hook into it.
    Add a section to the README explaining how to take advantage of the
    githooks.
    
    The sample pre-commit hook includes checks for trailing whitespace that
    we are seeing occasionally in PRs.
    
    Done in preparation for adding a clippy githook.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    820adc0 View commit details
    Browse the repository at this point in the history
  10. Add clippy to pre-commit githook

    We have a `pre-commit` githook, add to it a call to `cargo clippy`.
    tcharding committed Jun 23, 2022
    Copy the full SHA
    e2e4650 View commit details
    Browse the repository at this point in the history