Skip to content

Commit 2742561

Browse files
fgfm999breezewish
authored andcommitted
Use cargo clippy instead of the clippy plugin #176 (#184)
1 parent 350fc45 commit 2742561

File tree

7 files changed

+8
-24
lines changed

7 files changed

+8
-24
lines changed

.travis.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,17 @@ env:
2525
matrix:
2626
fast_finish: true
2727
include:
28-
- env: LINT="dev"
28+
- env: CLIPPY='yes'
2929
rust: nightly
3030
allow_failures:
31-
- env: LINT="dev"
31+
- env: CLIPPY='yes'
3232

3333
script:
3434
# Test common features.
3535
- cargo test --features="$FEATURES"
3636
- |
37-
if [ $TRAVIS_RUST_VERSION = 'nightly' ]; then
38-
# Enable dev for clippy linting.
39-
cargo test --features="$FEATURES $LINT";
40-
# Lint nightly feature.
41-
cargo test --features="$FEATURES $LINT nightly";
37+
if [ $CLIPPY = 'yes' ]; then
38+
cargo install clippy && cargo clippy --all-features -- -D warnings;
4239
fi
4340
- |
4441
if [ $TRAVIS_RUST_VERSION = 'stable' ]; then

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ travis-ci = { repository = "pingcap/rust-prometheus" }
1515

1616
[features]
1717
default = []
18-
dev = ["clippy"]
1918
nightly = ["libc", "spin/unstable"]
2019
push = ["hyper", "libc"]
2120
process = ["libc", "procinfo"]
@@ -24,7 +23,6 @@ gen = ["protobuf-codegen-pure"]
2423
[dependencies]
2524
protobuf = "2.0"
2625
quick-error = "0.2"
27-
clippy = {version = "^0", optional = true}
2826
fnv = "1.0"
2927
lazy_static = "0.2"
3028
libc = {version = "0.2", optional = true}

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ build:
88
test:
99
cargo test --features="${ENABLE_FEATURES}" -- --nocapture
1010

11-
dev: format
12-
cargo test --features="${ENABLE_FEATURES} dev" -- --nocapture
11+
dev: format test
1312

1413
bench: format
1514
cargo bench --features=${ENABLE_FEATURES} -- --nocapture
1615

1716
format:
18-
@cargo fmt --all -- --write-mode diff >/dev/null || cargo fmt --all
17+
@cargo fmt --all -- --check >/dev/null || cargo fmt --all
1918

2019
clean:
2120
cargo clean

proto/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is generated by rust-protobuf 2.0.0. Do not edit
1+
// This file is generated by rust-protobuf 2.0.2. Do not edit
22
// @generated
33

44
// https://github.com/Manishearth/rust-clippy/issues/702

rustfmt.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
reorder_imports = true
2-
reorder_imports_in_group = true
3-
reorder_extern_crates = true
4-
reorder_extern_crates_in_group = true
52
use_try_shorthand = true

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
The Rust client library for [Prometheus](https://prometheus.io/).
1616
*/
1717

18-
#![cfg_attr(feature = "dev", feature(plugin))]
19-
#![cfg_attr(feature = "dev", plugin(clippy))]
20-
#![cfg_attr(not(feature = "dev"), allow(unknown_lints))]
21-
#![cfg_attr(feature = "dev", allow(needless_pass_by_value))]
22-
#![cfg_attr(feature = "dev", allow(new_without_default_derive))]
18+
#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value, new_without_default_derive))]
2319
#![cfg_attr(feature = "nightly", feature(integer_atomics))]
2420

2521
#[macro_use]

static-metric/rustfmt.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
reorder_imports = true
2-
reorder_imports_in_group = true
3-
reorder_extern_crates = true
4-
reorder_extern_crates_in_group = true
52
use_try_shorthand = true

0 commit comments

Comments
 (0)