Skip to content

Commit 426c5b2

Browse files
committed
add clippy to travis integration
1 parent 1276cc7 commit 426c5b2

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ script:
2222
- if [ "$BUILD_NET_TOKIO" == "1" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose; fi
2323
- if [ "$BUILD_NET_TOKIO" != "1" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose -p lightning; fi
2424
- rm -f target/debug/lightning-* # Make sure we drop old test binaries
25+
# Run clippy on Rust 1.39.0
26+
- if [ "$(rustup show | grep default | grep 1.39.0)" != "" ]; then
27+
rustup component add clippy &&
28+
cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else; fi
2529
# Test the appropriate workspace(s)
2630
- if [ "$BUILD_NET_TOKIO" == "1" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose; fi
2731
- if [ "$BUILD_NET_TOKIO" != "1" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose -p lightning; fi

CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ Coding Conventions
7777
Use tabs. If you want to align lines, use spaces. Any desired alignment should
7878
display fine at any tab-length display setting.
7979

80+
Our CI enforces [clippy's](https://github.com/rust-lang/rust-clippy) default linting
81+
[settings](https://rust-lang.github.io/rust-clippy/rust-1.39.0/index.html).
82+
This includes all lint groups except for nursery, pedantic, and cargo in addition to allowing the following lints:
83+
`erasing_op`, `never_loop`, `if_same_then_else`.
84+
85+
If you use rustup, feel free to lint locally, otherwise you can just push to CI for automated linting.
86+
87+
```bash
88+
rustup component add clippy
89+
cargo clippy
90+
```
91+
8092
Security
8193
--------
8294

lightning/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ pub mod util;
3636
pub mod chain;
3737
pub mod ln;
3838
pub mod routing;
39-

lightning/src/ln/channelmanager.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
//! It does not manage routing logic (see routing::router::get_route for that) nor does it manage constructing
1717
//! on-chain transactions (it only monitors the chain to watch for any force-closes that might
1818
//! imply it needs to fail HTLCs/payments/channels it manages).
19+
//!
1920
2021
use bitcoin::blockdata::block::BlockHeader;
2122
use bitcoin::blockdata::constants::genesis_block;

0 commit comments

Comments
 (0)