From 322754652477965e1f01d2d00e6830fbfb6e9d2c Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 31 Aug 2016 17:04:29 -0700 Subject: [PATCH] Linewrap the error message from check_metadata. This lets test result expected output pass the long-line style check. --- src/cargo/ops/cargo_package.rs | 2 +- tests/package.rs | 20 +++++++++++++++----- tests/publish.rs | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 2ed76ab75..78fde8ed7 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -114,7 +114,7 @@ fn check_metadata(pkg: &Package, config: &Config) -> CargoResult<()> { things.push_str(&missing.last().unwrap()); try!(config.shell().warn( - &format!("manifest has no {things}. \ + &format!("manifest has no {things}.\n\ See http://doc.crates.io/manifest.html#package-metadata for more info.", things = things))) } diff --git a/tests/package.rs b/tests/package.rs index c9bbfd0f7..d23cc539a 100644 --- a/tests/package.rs +++ b/tests/package.rs @@ -37,6 +37,7 @@ fn simple() { assert_that(p.cargo_process("package"), execs().with_status(0).with_stderr(&format!("\ [WARNING] manifest has no documentation[..] +See [..] [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) @@ -82,8 +83,8 @@ fn metadata_warning() { assert_that(p.cargo_process("package"), execs().with_status(0).with_stderr(&format!("\ warning: manifest has no description, license, license-file, documentation, \ -homepage or repository. See \ -http://doc.crates.io/manifest.html#package-metadata for more info. +homepage or repository. +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) @@ -104,8 +105,8 @@ http://doc.crates.io/manifest.html#package-metadata for more info. "#); assert_that(p.cargo_process("package"), execs().with_status(0).with_stderr(&format!("\ -warning: manifest has no description, documentation, homepage or repository. See \ -http://doc.crates.io/manifest.html#package-metadata for more info. +warning: manifest has no description, documentation, homepage or repository. +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) @@ -165,6 +166,7 @@ fn package_verbose() { assert_that(cargo.clone().arg("package").arg("-v").arg("--no-verify"), execs().with_status(0).with_stderr("\ [WARNING] manifest has no description[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ([..]) [ARCHIVING] [..] [ARCHIVING] [..] @@ -175,6 +177,7 @@ fn package_verbose() { .cwd(p.root().join("a")), execs().with_status(0).with_stderr("\ [WARNING] manifest has no description[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] a v0.0.1 ([..]) [ARCHIVING] [..] [ARCHIVING] [..] @@ -198,6 +201,7 @@ fn package_verification() { assert_that(p.cargo("package"), execs().with_status(0).with_stderr(&format!("\ [WARNING] manifest has no description[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) @@ -231,7 +235,8 @@ fn path_dependency_no_version() { assert_that(p.cargo_process("package"), execs().with_status(101).with_stderr("\ -[WARNING] manifest has no documentation, homepage or repository. See http://doc.crates.io/manifest.html#package-metadata for more info. +[WARNING] manifest has no documentation, homepage or repository. +See http://doc.crates.io/manifest.html#package-metadata for more info. [ERROR] all path dependencies must have a version specified when packaging. dependency `bar` does not specify a version. ")); @@ -256,6 +261,7 @@ fn exclude() { assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"), execs().with_status(0).with_stderr("\ [WARNING] manifest has no description[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ([..]) [ARCHIVING] [..] [ARCHIVING] [..] @@ -282,6 +288,7 @@ fn include() { assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"), execs().with_status(0).with_stderr("\ [WARNING] manifest has no description[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] foo v0.0.1 ([..]) [ARCHIVING] [..] [ARCHIVING] [..] @@ -391,6 +398,7 @@ fn ignore_nested() { assert_that(p.cargo_process("package"), execs().with_status(0).with_stderr(&format!("\ [WARNING] manifest has no documentation[..] +See http://doc.crates.io/manifest.html#package-metadata for more info. [PACKAGING] nested v0.0.1 ({dir}) [VERIFYING] nested v0.0.1 ({dir}) [COMPILING] nested v0.0.1 ({dir}[..]) @@ -439,6 +447,7 @@ fn package_weird_characters() { assert_that(p.cargo_process("package"), execs().with_status(101).with_stderr("\ warning: [..] +See [..] [PACKAGING] foo [..] [ERROR] failed to prepare local package for uploading @@ -479,6 +488,7 @@ fn repackage_on_source_change() { // Check that cargo rebuilds the tarball assert_that(pro, execs().with_status(0).with_stderr(&format!("\ [WARNING] [..] +See [..] [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) diff --git a/tests/publish.rs b/tests/publish.rs index 38ccad219..eb3221b63 100644 --- a/tests/publish.rs +++ b/tests/publish.rs @@ -60,6 +60,7 @@ fn simple() { execs().with_status(0).with_stderr(&format!("\ [UPDATING] registry `{reg}` [WARNING] manifest has no documentation, [..] +See [..] [PACKAGING] foo v0.0.1 ({dir}) [UPLOADING] foo v0.0.1 ({dir}) ", @@ -357,6 +358,7 @@ fn dry_run() { execs().with_status(0).with_stderr(&format!("\ [UPDATING] registry `[..]` [WARNING] manifest has no documentation, [..] +See [..] [PACKAGING] foo v0.0.1 ({dir}) [VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 [..] -- 2.39.5