mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
Warn if none of documentation, homepage or repository are provided
It's really hard to find out any information about a project if it doesn't have any of these. As a bonus I added a shebang to .travis.install.deps.sh so the README instructions actually work. Closes #998
This commit is contained in:
parent
4b6ebe48bd
commit
9673f7298c
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ fn check_metadata(pkg: &Package, shell: &mut MultiShell) -> CargoResult<()> {
|
||||||
)*
|
)*
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
lacking!(description, license || license_file)
|
lacking!(description, license || license_file, documentation || homepage || repository)
|
||||||
|
|
||||||
if !missing.is_empty() {
|
if !missing.is_empty() {
|
||||||
let mut things = missing.slice_to(missing.len() - 1).connect(", ");
|
let mut things = missing.slice_to(missing.len() - 1).connect(", ");
|
||||||
|
|
|
@ -81,7 +81,8 @@ test!(metadata_warning {
|
||||||
compiling = COMPILING,
|
compiling = COMPILING,
|
||||||
dir = p.url()).as_slice())
|
dir = p.url()).as_slice())
|
||||||
.with_stderr("\
|
.with_stderr("\
|
||||||
warning: manifest has no description, license or license-file. See \
|
warning: manifest has no description, license, license-file, documentation, \
|
||||||
|
homepage or repository. See \
|
||||||
http://doc.crates.io/manifest.html#package-metadata for more info."));
|
http://doc.crates.io/manifest.html#package-metadata for more info."));
|
||||||
|
|
||||||
let p = project("one")
|
let p = project("one")
|
||||||
|
@ -106,10 +107,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
|
||||||
compiling = COMPILING,
|
compiling = COMPILING,
|
||||||
dir = p.url()).as_slice())
|
dir = p.url()).as_slice())
|
||||||
.with_stderr("\
|
.with_stderr("\
|
||||||
warning: manifest has no description. See \
|
warning: manifest has no description, documentation, homepage or repository. See \
|
||||||
http://doc.crates.io/manifest.html#package-metadata for more info."));
|
http://doc.crates.io/manifest.html#package-metadata for more info."));
|
||||||
|
|
||||||
let p = project("both")
|
let p = project("all")
|
||||||
.file("Cargo.toml", format!(r#"
|
.file("Cargo.toml", format!(r#"
|
||||||
[project]
|
[project]
|
||||||
name = "foo"
|
name = "foo"
|
||||||
|
@ -117,6 +118,7 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
|
||||||
authors = []
|
authors = []
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "foo"
|
description = "foo"
|
||||||
|
repository = "bar"
|
||||||
"#))
|
"#))
|
||||||
.file("src/main.rs", r#"
|
.file("src/main.rs", r#"
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -179,6 +179,7 @@ test!(package_with_path_deps {
|
||||||
authors = []
|
authors = []
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "foo"
|
description = "foo"
|
||||||
|
repository = "bar"
|
||||||
|
|
||||||
[dependencies.notyet]
|
[dependencies.notyet]
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
|
@ -491,6 +492,7 @@ test!(bad_license_file {
|
||||||
authors = []
|
authors = []
|
||||||
license-file = "foo"
|
license-file = "foo"
|
||||||
description = "bar"
|
description = "bar"
|
||||||
|
repository = "baz"
|
||||||
"#)
|
"#)
|
||||||
.file("src/main.rs", r#"
|
.file("src/main.rs", r#"
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Reference in a new issue