Skip to content

Add -D warnings to RUSTFLAGS on CI #1932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
- PERCY_PROJECT=crates-io/crates.io
- PGPORT=5433
- PATH=$HOME/.cargo/bin:$PATH
- RUSTFLAGS="-C debuginfo=0"
- RUSTFLAGS="-C debuginfo=0 -D warnings"

install:
- sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/11/main/pg_hba.conf
Expand Down
2 changes: 1 addition & 1 deletion src/bin/background-worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! Usage:
//! cargo run --bin background-worker

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::git::{Repository, RepositoryConfig};
use cargo_registry::{background_jobs::*, db};
Expand Down
2 changes: 1 addition & 1 deletion src/bin/delete-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Usage:
// cargo run --bin delete-crate crate-name

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::{db, models::Crate, schema::crates};
use std::{
Expand Down
2 changes: 1 addition & 1 deletion src/bin/delete-version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Usage:
// cargo run --bin delete-version crate-name version-number

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::{
db,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! Usage:
//! cargo run --bin monitor

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

mod on_call;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/populate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Usage:
// cargo run --bin populate version_id1 version_id2 ...

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::{db, schema::version_downloads};
use std::env;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/render-readmes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Warning: this can take a lot of time.

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

#[macro_use]
extern crate serde;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::{boot, App, Env};
use std::{
Expand Down
2 changes: 1 addition & 1 deletion src/bin/test-pagerduty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! Event type can be trigger, acknowledge, or resolve

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

mod on_call;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/transfer-crates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Usage:
// cargo run --bin transfer-crates from-user to-user

#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

use cargo_registry::{
db,
Expand Down
1 change: 0 additions & 1 deletion src/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ fn build_email(
.map(|s| s.smtp_login.as_str())
.unwrap_or("test@localhost");

#[allow(clippy::redundant_closure)]
let email = Email::builder()
.to(recipient)
.from(sender)
Expand Down
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
//! All implemented routes are defined in the [middleware](fn.middleware.html) function and
//! implemented in the [category](category/index.html), [keyword](keyword/index.html),
//! [krate](krate/index.html), [user](user/index.html) and [version](version/index.html) modules.
#![deny(warnings, clippy::all, rust_2018_idioms)]
#![deny(missing_debug_implementations, missing_copy_implementations)]
#![deny(bare_trait_objects)]
#![recursion_limit = "256"]

#![warn(clippy::all, rust_2018_idioms)]
#![warn(missing_debug_implementations, missing_copy_implementations)]

#[macro_use]
extern crate derive_deref;
Expand Down
1 change: 0 additions & 1 deletion src/models/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ impl Version {
}

impl NewVersion {
#[allow(clippy::new_ret_no_self)]
pub fn new(
crate_id: i32,
num: &semver::Version,
Expand Down
2 changes: 1 addition & 1 deletion src/s3/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, clippy::all, rust_2018_idioms)]
#![warn(clippy::all, rust_2018_idioms)]

extern crate base64;
extern crate chrono;
Expand Down
8 changes: 1 addition & 7 deletions src/tests/all.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#![deny(warnings, clippy::all, rust_2018_idioms)]
// TODO: Remove after we can bump to Rust 1.35 stable in `RustConfig`
#![allow(
renamed_and_removed_lints,
clippy::cyclomatic_complexity,
clippy::unknown_clippy_lints
)]
#![warn(clippy::all, rust_2018_idioms)]

#[macro_use]
extern crate diesel;
Expand Down
1 change: 0 additions & 1 deletion src/tests/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ fn yank_by_a_non_owner_fails() {
}

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

Expand Down