Skip to content

Commit 8c2c002

Browse files
Add rustfmt config and travis integration.
1 parent f8b06ec commit 8c2c002

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ before_install:
1111
- sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
1212

1313
script:
14+
# Check formatting.
15+
- if [ "$(rustup show | grep default | grep stable)" != "" ]; then rustup component add rustfmt && cargo fmt --all -- --check; fi
16+
- if [ "$(rustup show | grep default | grep 1.34.2)" != "" ]; then rustup component add rustfmt && cd fuzz && cargo fmt --all -- --check && cd ../; fi
1417
# Build workspaces with Rust stable, beta, and 1.34.0
1518
- if [ "$(rustup show | grep default | grep 1.22.0)" == "" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose; fi
1619
# Build lightning workspace with Rust 1.22.0

fuzz/rustfmt.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Non-default stable features
2+
hard_tabs = true # use tab characters for indentation, spaces for alignment
3+
use_field_init_shorthand = true
4+
max_width = 5000 # Initially set this to a big number to split the diff of the formatter into multiple commits.
5+
6+
# Non-default unstable features
7+
unstable_features = true
8+
fn_single_line = true
9+
match_block_trailing_comma = true
10+
format_macro_bodies = false

rustfmt.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Non-default stable features
2+
hard_tabs = true # use tab characters for indentation, spaces for alignment
3+
use_field_init_shorthand = true
4+
max_width = 5000 # Initially set this to a big number to split the diff of the formatter into multiple commits.
5+
6+
# Non-default unstable features
7+
unstable_features = true
8+
fn_single_line = true
9+
match_block_trailing_comma = true
10+
format_macro_bodies = false

0 commit comments

Comments
 (0)