Skip to content

Commit 5ce81df

Browse files
committed
Auto merge of #1932 - jtgeibel:clippy-cleanups, r=carols10cents
Add `-D warnings` to `RUSTFLAGS` on CI By denying warnings explicitly on CI, we don't need to deny warnings in each library or binary. `#![warn(clippy::all)]` is used to automatically enable clippy in RLS enabled IDEs and `rust_2018_idioms` is now applied consistently. Finally, clippy allow attributes that are no longer needed have been removed.
2 parents 05b1399 + d2ed9de commit 5ce81df

16 files changed

+15
-25
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
- PERCY_PROJECT=crates-io/crates.io
2222
- PGPORT=5433
2323
- PATH=$HOME/.cargo/bin:$PATH
24-
- RUSTFLAGS="-C debuginfo=0"
24+
- RUSTFLAGS="-C debuginfo=0 -D warnings"
2525

2626
install:
2727
- sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/11/main/pg_hba.conf

src/bin/background-worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! Usage:
1111
//! cargo run --bin background-worker
1212
13-
#![deny(warnings, clippy::all, rust_2018_idioms)]
13+
#![warn(clippy::all, rust_2018_idioms)]
1414

1515
use cargo_registry::git::{Repository, RepositoryConfig};
1616
use cargo_registry::{background_jobs::*, db};

src/bin/delete-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Usage:
66
// cargo run --bin delete-crate crate-name
77

8-
#![deny(warnings, clippy::all, rust_2018_idioms)]
8+
#![warn(clippy::all, rust_2018_idioms)]
99

1010
use cargo_registry::{db, models::Crate, schema::crates};
1111
use std::{

src/bin/delete-version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Usage:
66
// cargo run --bin delete-version crate-name version-number
77

8-
#![deny(warnings, clippy::all, rust_2018_idioms)]
8+
#![warn(clippy::all, rust_2018_idioms)]
99

1010
use cargo_registry::{
1111
db,

src/bin/monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Usage:
55
//! cargo run --bin monitor
66
7-
#![deny(warnings, clippy::all, rust_2018_idioms)]
7+
#![warn(clippy::all, rust_2018_idioms)]
88

99
mod on_call;
1010

src/bin/populate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Usage:
55
// cargo run --bin populate version_id1 version_id2 ...
66

7-
#![deny(warnings, clippy::all, rust_2018_idioms)]
7+
#![warn(clippy::all, rust_2018_idioms)]
88

99
use cargo_registry::{db, schema::version_downloads};
1010
use std::env;

src/bin/render-readmes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Warning: this can take a lot of time.
55

6-
#![deny(warnings, clippy::all, rust_2018_idioms)]
6+
#![warn(clippy::all, rust_2018_idioms)]
77

88
#[macro_use]
99
extern crate serde;

src/bin/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(warnings, clippy::all, rust_2018_idioms)]
1+
#![warn(clippy::all, rust_2018_idioms)]
22

33
use cargo_registry::{boot, App, Env};
44
use std::{

src/bin/test-pagerduty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//!
66
//! Event type can be trigger, acknowledge, or resolve
77
8-
#![deny(warnings, clippy::all, rust_2018_idioms)]
8+
#![warn(clippy::all, rust_2018_idioms)]
99

1010
mod on_call;
1111

src/bin/transfer-crates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Usage:
44
// cargo run --bin transfer-crates from-user to-user
55

6-
#![deny(warnings, clippy::all, rust_2018_idioms)]
6+
#![warn(clippy::all, rust_2018_idioms)]
77

88
use cargo_registry::{
99
db,

src/email.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ fn build_email(
4343
.map(|s| s.smtp_login.as_str())
4444
.unwrap_or("test@localhost");
4545

46-
#[allow(clippy::redundant_closure)]
4746
let email = Email::builder()
4847
.to(recipient)
4948
.from(sender)

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
//! All implemented routes are defined in the [middleware](fn.middleware.html) function and
44
//! implemented in the [category](category/index.html), [keyword](keyword/index.html),
55
//! [krate](krate/index.html), [user](user/index.html) and [version](version/index.html) modules.
6-
#![deny(warnings, clippy::all, rust_2018_idioms)]
7-
#![deny(missing_debug_implementations, missing_copy_implementations)]
8-
#![deny(bare_trait_objects)]
9-
#![recursion_limit = "256"]
6+
7+
#![warn(clippy::all, rust_2018_idioms)]
8+
#![warn(missing_debug_implementations, missing_copy_implementations)]
109

1110
#[macro_use]
1211
extern crate derive_deref;

src/models/version.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ impl Version {
122122
}
123123

124124
impl NewVersion {
125-
#[allow(clippy::new_ret_no_self)]
126125
pub fn new(
127126
crate_id: i32,
128127
num: &semver::Version,

src/s3/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(warnings, clippy::all, rust_2018_idioms)]
1+
#![warn(clippy::all, rust_2018_idioms)]
22

33
extern crate base64;
44
extern crate chrono;

src/tests/all.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
#![deny(warnings, clippy::all, rust_2018_idioms)]
2-
// TODO: Remove after we can bump to Rust 1.35 stable in `RustConfig`
3-
#![allow(
4-
renamed_and_removed_lints,
5-
clippy::cyclomatic_complexity,
6-
clippy::unknown_clippy_lints
7-
)]
1+
#![warn(clippy::all, rust_2018_idioms)]
82

93
#[macro_use]
104
extern crate diesel;

src/tests/krate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,6 @@ fn yank_by_a_non_owner_fails() {
15051505
}
15061506

15071507
#[test]
1508-
#[allow(clippy::cognitive_complexity)]
15091508
fn yank_max_version() {
15101509
let (_, anon, _, token) = TestApp::full().with_token();
15111510

0 commit comments

Comments
 (0)