Skip to content
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

Ensure clippy is run for all targets and switch to clippy-preview on stable #1493

Merged
merged 1 commit into from
Oct 8, 2018
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
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ matrix:
allow_failures:
- rust: nightly
include:
- rust: nightly-2018-06-26
script:
- cargo install --force clippy --vers 0.0.210
- cargo clippy
- rust: stable
before_install:
- nvm install 10
- rustup component add rustfmt-preview
- rustup component add clippy-preview
script:
- cargo fmt -- --check
# TODO: Once clippy:: lint syntax is stable, remove everything after the -- below
- cargo clippy --all-targets -- -A renamed_and_removed_lints
- cargo build
- cargo test
- npm install
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![deny(missing_debug_implementations, missing_copy_implementations)]
#![deny(bare_trait_objects)]
#![recursion_limit = "256"]
#![allow(unknown_lints, proc_macro_derive_resolution_fallback)] // This can be removed after diesel-1.4
#![allow(unknown_lints, proc_macro_derive_resolution_fallback)] // TODO: This can be removed after diesel-1.4

extern crate ammonia;
extern crate chrono;
Expand Down
17 changes: 10 additions & 7 deletions src/tests/all.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#![deny(warnings)]
#![allow(unknown_lints, proc_macro_derive_resolution_fallback)] // This can be removed after diesel-1.4
#![allow(unknown_lints, proc_macro_derive_resolution_fallback)] // TODO: This can be removed after diesel-1.4

// Several test methods trip this clippy lint
#![cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))]

extern crate cargo_registry;
extern crate chrono;
Expand Down Expand Up @@ -162,7 +165,7 @@ fn app() -> (
};

let config = cargo_registry::Config {
uploader: uploader,
uploader,
session_key: "test this has to be over 32 bytes long".to_string(),
git_repo_checkout: git::checkout(),
gh_client_id: env::var("GH_CLIENT_ID").unwrap_or_default(),
Expand All @@ -172,7 +175,7 @@ fn app() -> (
max_upload_size: 3000,
max_unpack_size: 2000,
mirror: Replica::Primary,
api_protocol: api_protocol,
api_protocol,
};
let app = App::new(&config);
t!(t!(app.diesel_database.get()).begin_test_transaction());
Expand Down Expand Up @@ -251,7 +254,7 @@ fn user(login: &str) -> User {
fn new_team(login: &str) -> NewTeam<'_> {
NewTeam {
github_id: NEXT_ID.fetch_add(1, Ordering::SeqCst) as i32,
login: login,
login,
name: None,
avatar: None,
}
Expand Down Expand Up @@ -379,9 +382,9 @@ struct CrateBuilder<'a> {
impl<'a> CrateBuilder<'a> {
fn new(name: &str, owner_id: i32) -> CrateBuilder<'_> {
CrateBuilder {
owner_id: owner_id,
owner_id,
krate: NewCrate {
name: name,
name,
..NewCrate::default()
},
downloads: None,
Expand Down Expand Up @@ -702,7 +705,7 @@ fn new_req_body(
name: u::CrateName(krate.name),
vers: u::CrateVersion(semver::Version::parse(version).unwrap()),
features: HashMap::new(),
deps: deps,
deps,
authors: vec!["foo".to_string()],
description: Some("description".to_string()),
homepage: krate.homepage,
Expand Down
16 changes: 8 additions & 8 deletions src/tests/badge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,22 @@ fn set_up() -> (Arc<App>, Crate, BadgeRef) {
);

let badges = BadgeRef {
appveyor: appveyor,
appveyor,
appveyor_attributes: badge_attributes_appveyor,
travis_ci: travis_ci,
travis_ci,
travis_ci_attributes: badge_attributes_travis_ci,
gitlab: gitlab,
gitlab,
gitlab_attributes: badge_attributes_gitlab,
isitmaintained_issue_resolution: isitmaintained_issue_resolution,
isitmaintained_issue_resolution,
isitmaintained_issue_resolution_attributes:
badge_attributes_isitmaintained_issue_resolution,
isitmaintained_open_issues: isitmaintained_open_issues,
isitmaintained_open_issues,
isitmaintained_open_issues_attributes: badge_attributes_isitmaintained_open_issues,
codecov: codecov,
codecov,
codecov_attributes: badge_attributes_codecov,
coveralls: coveralls,
coveralls,
coveralls_attributes: badge_attributes_coveralls,
circle_ci: circle_ci,
circle_ci,
circle_ci_attributes: badge_attributes_circle_ci,
maintenance,
maintenance_attributes,
Expand Down
8 changes: 1 addition & 7 deletions src/tests/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,7 @@ fn record_http(
hyper_response.status(status);
let mut hyper_response = hyper_response.body(body.into()).unwrap();
*hyper_response.headers_mut() = headers;
(
hyper_response,
Exchange {
response: response,
request: request,
},
)
(hyper_response, Exchange { response, request })
})
}))
}
Expand Down