Skip to content

Commit

Permalink
Use cargo clippy instead of the clippy plugin #176 (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgfm999 authored and breezewish committed Jun 22, 2018
1 parent 350fc45 commit 2742561
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 24 deletions.
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@ env:
matrix:
fast_finish: true
include:
- env: LINT="dev"
- env: CLIPPY='yes'
rust: nightly
allow_failures:
- env: LINT="dev"
- env: CLIPPY='yes'

script:
# Test common features.
- cargo test --features="$FEATURES"
- |
if [ $TRAVIS_RUST_VERSION = 'nightly' ]; then
# Enable dev for clippy linting.
cargo test --features="$FEATURES $LINT";
# Lint nightly feature.
cargo test --features="$FEATURES $LINT nightly";
if [ $CLIPPY = 'yes' ]; then
cargo install clippy && cargo clippy --all-features -- -D warnings;
fi
- |
if [ $TRAVIS_RUST_VERSION = 'stable' ]; then
Expand Down
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ travis-ci = { repository = "pingcap/rust-prometheus" }

[features]
default = []
dev = ["clippy"]
nightly = ["libc", "spin/unstable"]
push = ["hyper", "libc"]
process = ["libc", "procinfo"]
Expand All @@ -24,7 +23,6 @@ gen = ["protobuf-codegen-pure"]
[dependencies]
protobuf = "2.0"
quick-error = "0.2"
clippy = {version = "^0", optional = true}
fnv = "1.0"
lazy_static = "0.2"
libc = {version = "0.2", optional = true}
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ build:
test:
cargo test --features="${ENABLE_FEATURES}" -- --nocapture

dev: format
cargo test --features="${ENABLE_FEATURES} dev" -- --nocapture
dev: format test

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

format:
@cargo fmt --all -- --write-mode diff >/dev/null || cargo fmt --all
@cargo fmt --all -- --check >/dev/null || cargo fmt --all

clean:
cargo clean
Expand Down
2 changes: 1 addition & 1 deletion proto/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is generated by rust-protobuf 2.0.0. Do not edit
// This file is generated by rust-protobuf 2.0.2. Do not edit
// @generated

// https://github.com/Manishearth/rust-clippy/issues/702
Expand Down
3 changes: 0 additions & 3 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
reorder_imports = true
reorder_imports_in_group = true
reorder_extern_crates = true
reorder_extern_crates_in_group = true
use_try_shorthand = true
6 changes: 1 addition & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
The Rust client library for [Prometheus](https://prometheus.io/).
*/

#![cfg_attr(feature = "dev", feature(plugin))]
#![cfg_attr(feature = "dev", plugin(clippy))]
#![cfg_attr(not(feature = "dev"), allow(unknown_lints))]
#![cfg_attr(feature = "dev", allow(needless_pass_by_value))]
#![cfg_attr(feature = "dev", allow(new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value, new_without_default_derive))]
#![cfg_attr(feature = "nightly", feature(integer_atomics))]

#[macro_use]
Expand Down
3 changes: 0 additions & 3 deletions static-metric/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
reorder_imports = true
reorder_imports_in_group = true
reorder_extern_crates = true
reorder_extern_crates_in_group = true
use_try_shorthand = true

0 comments on commit 2742561

Please sign in to comment.