Skip to content

Commit 67a7f20

Browse files
committed
add clippy to travis integration
1 parent 1276cc7 commit 67a7f20

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-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

+11
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ 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+
Please lint your code using [clippy](https://github.com/rust-lang/rust-clippy).
81+
82+
```bash
83+
rustup component add clippy
84+
cargo clippy
85+
```
86+
87+
We use the [default linting settings](https://rust-lang.github.io/rust-clippy/rust-1.39.0/index.html), which includes all lint
88+
groups except for nursery, pedantic, and cargo. Our CI will use these default settings in addition to allowing the
89+
following lints: `erasing_op`, `never_loop`, `if_same_then_else`.
90+
8091
Security
8192
--------
8293

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)