Skip to content

Commit a76a61d

Browse files
Add rustfmt config and travis integration.
1 parent 3b76c77 commit a76a61d

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.travis.yml

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

13+
before_script:
14+
- rustup component add rustfmt
1315
script:
16+
- cargo fmt --all -- --check && cd fuzz && cargo fmt --all -- --check && cd ../lightning-net-tokio && cargo fmt --all -- --check && cd ../
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Non-defaults
2+
hard_tabs = true # use tab characters for indentation, spaces for alignment
3+
max_width = 80 # default = 100
4+
use_field_init_shorthand = true
5+
6+
# Default
7+
edition = "2015"
8+
fn_args_layout = "Tall"
9+
force_explicit_abi = true
10+
merge_derives = true
11+
newline_style = "Auto" # Unix or Windows line endings
12+
remove_nested_parens = true
13+
reorder_imports = true
14+
reorder_modules = true
15+
tab_spaces = 4
16+
use_small_heuristics = "Default"
17+
use_try_shorthand = false

lightning-net-tokio/rustfmt.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Non-defaults
2+
hard_tabs = true # use tab characters for indentation, spaces for alignment
3+
max_width = 80 # default = 100
4+
use_field_init_shorthand = true
5+
6+
# Default
7+
edition = "2015"
8+
fn_args_layout = "Tall"
9+
force_explicit_abi = true
10+
merge_derives = true
11+
newline_style = "Auto" # Unix or Windows line endings
12+
remove_nested_parens = true
13+
reorder_imports = true
14+
reorder_modules = true
15+
tab_spaces = 4
16+
use_small_heuristics = "Default"
17+
use_try_shorthand = false

rustfmt.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Non-defaults
2+
hard_tabs = true # use tab characters for indentation, spaces for alignment
3+
max_width = 80 # default = 100
4+
use_field_init_shorthand = true
5+
6+
# Default
7+
edition = "2015"
8+
fn_args_layout = "Tall"
9+
force_explicit_abi = true
10+
merge_derives = true
11+
newline_style = "Auto" # Unix or Windows line endings
12+
remove_nested_parens = true
13+
reorder_imports = true
14+
reorder_modules = true
15+
tab_spaces = 4
16+
use_small_heuristics = "Default"
17+
use_try_shorthand = false

0 commit comments

Comments
 (0)