rust-lang-nursery/rust-clippy => rust-lang/rust-clippy

This commit is contained in:
Matthias Krüger 2018-11-22 04:40:09 +01:00
parent 1d5108c264
commit f5929e0797
30 changed files with 51 additions and 52 deletions

View File

@ -52,14 +52,14 @@ matrix:
- os: windows
env: BASE_TEST=true
- env: INTEGRATION=rust-lang/cargo
- env: INTEGRATION=rust-lang-nursery/rand
- env: INTEGRATION=rust-random/rand
- env: INTEGRATION=rust-lang-nursery/stdsimd
- env: INTEGRATION=rust-lang-nursery/rustfmt
- env: INTEGRATION=rust-lang/rustfmt
- env: INTEGRATION=rust-lang-nursery/futures-rs
- env: INTEGRATION=rust-lang-nursery/failure
- env: INTEGRATION=rust-lang-nursery/log
- env: INTEGRATION=rust-lang-nursery/chalk
- env: INTEGRATION=rust-lang-nursery/rls
- env: INTEGRATION=rust-lang/rls
- env: INTEGRATION=chronotope/chrono
- env: INTEGRATION=serde-rs/serde
- env: INTEGRATION=Geal/nom

View File

@ -35,27 +35,27 @@ High level approach:
All issues on Clippy are mentored, if you want help with a bug just ask @Manishearth, @llogiq, @mcarton or @oli-obk.
Some issues are easier than others. The [`good first issue`](https://github.com/rust-lang-nursery/rust-clippy/labels/good%20first%20issue)
Some issues are easier than others. The [`good first issue`](https://github.com/rust-lang/rust-clippy/labels/good%20first%20issue)
label can be used to find the easy issues. If you want to work on an issue, please leave a comment
so that we can assign it to you!
Issues marked [`T-AST`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-AST) involve simple
Issues marked [`T-AST`](https://github.com/rust-lang/rust-clippy/labels/T-AST) involve simple
matching of the syntax tree structure, and are generally easier than
[`T-middle`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-middle) issues, which involve types
[`T-middle`](https://github.com/rust-lang/rust-clippy/labels/T-middle) issues, which involve types
and resolved paths.
[`T-AST`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-AST) issues will generally need you to match against a predefined syntax structure. To figure out
[`T-AST`](https://github.com/rust-lang/rust-clippy/labels/T-AST) issues will generally need you to match against a predefined syntax structure. To figure out
how this syntax structure is encoded in the AST, it is recommended to run `rustc -Z ast-json` on an
example of the structure and compare with the
[nodes in the AST docs](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast). Usually
the lint will end up to be a nested series of matches and ifs,
[like so](https://github.com/rust-lang-nursery/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34).
[like so](https://github.com/rust-lang/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34).
[`E-medium`](https://github.com/rust-lang-nursery/rust-clippy/labels/E-medium) issues are generally
[`E-medium`](https://github.com/rust-lang/rust-clippy/labels/E-medium) issues are generally
pretty easy too, though it's recommended you work on an E-easy issue first. They are mostly classified
as `E-medium`, since they might be somewhat involved code wise, but not difficult per-se.
[`T-middle`](https://github.com/rust-lang-nursery/rust-clippy/labels/T-middle) issues can
[`T-middle`](https://github.com/rust-lang/rust-clippy/labels/T-middle) issues can
be more involved and require verifying types. The
[`ty`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty) module contains a
lot of methods that are useful, though one of the most useful would be `expr_ty` (gives the type of
@ -249,10 +249,10 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->
[main_entry]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/src/lib.rs#L14
[lint_crate]: https://github.com/rust-lang-nursery/rust-clippy/tree/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src
[lint_crate_entry]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/lib.rs
[else_if_without_else]: https://github.com/rust-lang-nursery/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/else_if_without_else.rs
[main_entry]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/src/lib.rs#L14
[lint_crate]: https://github.com/rust-lang/rust-clippy/tree/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src
[lint_crate_entry]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/lib.rs
[else_if_without_else]: https://github.com/rust-lang/rust-clippy/blob/c5b39a5917ffc0f1349b6e414fa3b874fdcf8429/clippy_lints/src/else_if_without_else.rs
[compiler_plugin]: https://doc.rust-lang.org/unstable-book/language-features/plugin.html#lint-plugins
[plugin_registry]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_plugin/registry/struct.Registry.html
[reg_early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_plugin/registry/struct.Registry.html#method.register_early_lint_pass

View File

@ -9,7 +9,7 @@ authors = [
"Oliver Schneider <clippy-iethah7aipeen8neex1a@oli-obk.de>"
]
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang-nursery/rust-clippy"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
license = "MIT/Apache-2.0"
keywords = ["clippy", "lint", "plugin"]
@ -19,8 +19,8 @@ edition = "2018"
publish = false
[badges]
travis-ci = { repository = "rust-lang-nursery/rust-clippy" }
appveyor = { repository = "rust-lang-nursery/rust-clippy" }
travis-ci = { repository = "rust-lang/rust-clippy" }
appveyor = { repository = "rust-lang/rust-clippy" }
[lib]
name = "clippy"

View File

@ -2,14 +2,14 @@ We are currently in the process of discussing Clippy 1.0 via the RFC process in
# Clippy
[![Build Status](https://travis-ci.org/rust-lang-nursery/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/rust-clippy)
[![Build Status](https://travis-ci.org/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang/rust-clippy)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/id677xpw1dguo7iw?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/rust-clippy)
[![Current Version](https://meritbadge.herokuapp.com/clippy)](https://crates.io/crates/clippy)
[![License: MIT/Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
[There are 288 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
[There are 288 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
@ -22,7 +22,7 @@ We have a bunch of lint categories to allow you to choose how much Clippy is sup
* `clippy::cargo` (checks against the cargo manifest)
* **`clippy::correctness`** (code that is just outright wrong or very very useless)
More to come, please [file an issue](https://github.com/rust-lang-nursery/rust-clippy/issues) if you have ideas!
More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!
Only the following of those categories are enabled by default:
@ -84,7 +84,7 @@ in your code, you can use:
cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
```
*[Note](https://github.com/rust-lang-nursery/rust-clippy/wiki#a-word-of-warning):*
*[Note](https://github.com/rust-lang/rust-clippy/wiki#a-word-of-warning):*
Be sure that Clippy was compiled with the same version of rustc that cargo invokes here!
### Travis CI

View File

@ -32,7 +32,7 @@ lazy_static! {
"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
"#).unwrap();
static ref NL_ESCAPE_RE: Regex = Regex::new(r#"\\\n\s*"#).unwrap();
pub static ref DOCS_LINK: String = "https://rust-lang-nursery.github.io/rust-clippy/master/index.html".to_string();
pub static ref DOCS_LINK: String = "https://rust-lang.github.io/rust-clippy/master/index.html".to_string();
}
/// Lint data parsed from the Clippy source code.

View File

@ -82,13 +82,13 @@ fn update_lints(update_mode: &UpdateMode) {
let mut file_change = replace_region_in_file(
"../README.md",
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang-nursery.github.io/rust-clippy/master/index.html\)"#,
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"#,
"",
true,
update_mode == &UpdateMode::Change,
|| {
vec![
format!("[There are {} lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)", lint_count)
format!("[There are {} lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)", lint_count)
]
}
).changed;

View File

@ -7,7 +7,7 @@ readme = "crates-readme.md"
description = "A bunch of helpful lints to avoid common pitfalls in Rust."
build = 'build.rs'
repository = "https://github.com/rust-lang-nursery/rust-clippy"
repository = "https://github.com/rust-lang/rust-clippy"
license = "MIT/Apache-2.0"
keywords = ["clippy", "lint", "plugin"]

View File

@ -6,4 +6,4 @@ rustup component add clippy-preview
on a Rust version 1.29 or later. You may need to run `rustup self update` if it complains about a missing clippy binary.
See [the homepage](https://github.com/rust-lang-nursery/rust-clippy/#clippy) for more information
See [the homepage](https://github.com/rust-lang/rust-clippy/#clippy) for more information

View File

@ -10,7 +10,7 @@ authors = [
"Martin Carton <cartonmartin@gmail.com>"
]
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang-nursery/rust-clippy"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
license = "MPL-2.0"
keywords = ["clippy", "lint", "plugin"]

View File

@ -1,3 +1,3 @@
This crate contains Clippy lints. For the main crate, check
[*crates.io*](https://crates.io/crates/clippy) or
[GitHub](https://github.com/rust-lang-nursery/rust-clippy).
[GitHub](https://github.com/rust-lang/rust-clippy).

View File

@ -177,7 +177,7 @@ declare_clippy_lint! {
///
/// **Known problems:** This lint doesn't detect crate level inner attributes, because they get
/// processed before the PreExpansionPass lints get executed. See
/// [#3123](https://github.com/rust-lang-nursery/rust-clippy/pull/3123#issuecomment-422321765)
/// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
///
/// **Example:**
///
@ -537,4 +537,3 @@ impl EarlyLintPass for CfgAttrPass {
}
}
}

View File

@ -31,7 +31,7 @@ use cargo_metadata;
/// name = "clippy"
/// version = "0.0.212"
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
/// repository = "https://github.com/rust-lang-nursery/rust-clippy"
/// repository = "https://github.com/rust-lang/rust-clippy"
/// readme = "README.md"
/// license = "MIT/Apache-2.0"
/// keywords = ["clippy", "lint", "plugin"]

View File

@ -80,7 +80,7 @@ declare_clippy_lint! {
///
/// **Known problems:** False positive possible with order dependent `match`
/// (see issue
/// [#860](https://github.com/rust-lang-nursery/rust-clippy/issues/860)).
/// [#860](https://github.com/rust-lang/rust-clippy/issues/860)).
///
/// **Example:**
/// ```rust,ignore

View File

@ -28,7 +28,7 @@ pub struct EtaPass;
/// **Known problems:** If creating the closure inside the closure has a side-
/// effect then moving the closure creation out will change when that side-
/// effect runs.
/// See https://github.com/rust-lang-nursery/rust-clippy/issues/1439 for more
/// See https://github.com/rust-lang/rust-clippy/issues/1439 for more
/// details.
///
/// **Example:**

View File

@ -1532,7 +1532,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AbsurdExtremeComparisons {
/// `u8`.
///
/// **Known problems:**
/// https://github.com/rust-lang-nursery/rust-clippy/issues/886
/// https://github.com/rust-lang/rust-clippy/issues/886
///
/// **Example:**
/// ```rust

View File

@ -539,7 +539,7 @@ impl<'a> DiagnosticWrapper<'a> {
fn docs_link(&mut self, lint: &'static Lint) {
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
self.0.help(&format!(
"for further information visit https://rust-lang-nursery.github.io/rust-clippy/v{}/index.html#{}",
"for further information visit https://rust-lang.github.io/rust-clippy/v{}/index.html#{}",
env!("CARGO_PKG_VERSION"),
lint.name_lower().replacen("clippy::", "", 1)
));

View File

@ -10,7 +10,7 @@ authors = [
]
license = "MPL-2.0"
description = "A macro to test clippy's procedural macro checks"
repository = "https://github.com/rust-lang-nursery/rust-clippy"
repository = "https://github.com/rust-lang/rust-clippy"
[lib]
name = "clippy_mini_macro_test"

View File

@ -12,7 +12,7 @@
/// Should not trigger an ICE in `SpanlessEq` / `consts::constant`
///
/// Issue: https://github.com/rust-lang-nursery/rust-clippy/issues/1782
/// Issue: https://github.com/rust-lang/rust-clippy/issues/1782
use std::{mem, ptr};

View File

@ -14,7 +14,7 @@
/// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
///
/// Issue: https://github.com/rust-lang-nursery/rust-clippy/issues/2499
/// Issue: https://github.com/rust-lang/rust-clippy/issues/2499
fn f(s: &[u8]) -> bool {
let t = s[0] as char;

View File

@ -12,7 +12,7 @@
/// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
///
/// Issue: https://github.com/rust-lang-nursery/rust-clippy/issues/2594
/// Issue: https://github.com/rust-lang/rust-clippy/issues/2594
fn spanless_hash_ice() {
let txt = "something";

View File

@ -17,7 +17,7 @@
//
// error[E0277]: the trait bound `T: Foo` is not satisfied
//
// See https://github.com/rust-lang-nursery/rust-clippy/issues/2760
// See https://github.com/rust-lang/rust-clippy/issues/2760
trait Foo {
type Bar;

View File

@ -12,7 +12,7 @@
use std::collections::HashSet;
// See https://github.com/rust-lang-nursery/rust-clippy/issues/2774
// See https://github.com/rust-lang/rust-clippy/issues/2774
#[derive(Eq, PartialEq, Debug, Hash)]
pub struct Bar {

View File

@ -10,14 +10,14 @@
#![allow(dead_code)]
/// Issue: https://github.com/rust-lang-nursery/rust-clippy/issues/2596
/// Issue: https://github.com/rust-lang/rust-clippy/issues/2596
pub fn loop_on_block_condition(u: &mut isize) {
while { *u < 0 } {
*u += 1;
}
}
/// https://github.com/rust-lang-nursery/rust-clippy/issues/2584
/// https://github.com/rust-lang/rust-clippy/issues/2584
fn loop_with_unsafe_condition(ptr: *const u8) {
let mut len = 0;
while unsafe { *ptr.offset(len) } != 0 {
@ -25,7 +25,7 @@ fn loop_with_unsafe_condition(ptr: *const u8) {
}
}
/// https://github.com/rust-lang-nursery/rust-clippy/issues/2710
/// https://github.com/rust-lang/rust-clippy/issues/2710
static mut RUNNING: bool = true;
fn loop_on_static_condition() {
unsafe {

View File

@ -68,7 +68,7 @@ fn methods_with_negation() {
let _ = !c ^ c || !a.is_some();
}
// Simplified versions of https://github.com/rust-lang-nursery/rust-clippy/issues/2638
// Simplified versions of https://github.com/rust-lang/rust-clippy/issues/2638
// clippy::nonminimal_bool should only check the built-in Result and Some type, not
// any other types like the following.
enum CustomResultOk<E> { Ok, Err(E) }

View File

@ -153,7 +153,7 @@ fn main() {
}
// The following tests check for the fix of https://github.com/rust-lang-nursery/rust-clippy/issues/798
// The following tests check for the fix of https://github.com/rust-lang/rust-clippy/issues/798
if x == "hello" {// Not collapsible
if y == "world" {
println!("Hello world!");

View File

@ -62,7 +62,7 @@ fn test_units() {
}
/// This test has [a link_with_underscores][chunked-example] inside it. See #823.
/// See also [the issue tracker](https://github.com/rust-lang-nursery/rust-clippy/search?q=clippy::doc_markdown&type=Issues)
/// See also [the issue tracker](https://github.com/rust-lang/rust-clippy/search?q=clippy::doc_markdown&type=Issues)
/// on GitHub (which is a camel-cased word, but is OK). And here is another [inline link][inline_link].
/// It can also be [inline_link2].
///
@ -154,7 +154,7 @@ fn four_quotes() {
/// See [NIST SP 800-56A, revision 2].
///
/// [NIST SP 800-56A, revision 2]:
/// https://github.com/rust-lang-nursery/rust-clippy/issues/902#issuecomment-261919419
/// https://github.com/rust-lang/rust-clippy/issues/902#issuecomment-261919419
fn issue_902_comment() {}
#[cfg_attr(feature = "a", doc = " ```")]

View File

@ -24,7 +24,7 @@ mod foo {
}
}
// No warning. See <https://github.com/rust-lang-nursery/rust-clippy/issues/1220>.
// No warning. See <https://github.com/rust-lang/rust-clippy/issues/1220>.
mod bar {
#[allow(clippy::module_inception)]
mod bar {

View File

@ -25,7 +25,7 @@ fn main() {
// should have done this but produced an ICE
//
// We may not want to suggest changing these anyway
// See: https://github.com/rust-lang-nursery/rust-clippy/issues/650#issuecomment-184328984
// See: https://github.com/rust-lang/rust-clippy/issues/650#issuecomment-184328984
x.split("ß");
x.split("");
x.split("💣");

View File

@ -125,7 +125,7 @@
</div>
</div>
<a href="https://github.com/rust-lang-nursery/rust-clippy">
<a href="https://github.com/rust-lang/rust-clippy">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on Github"/>
</a>

View File

@ -43,7 +43,7 @@
</div>
</div>
<a href="https://github.com/rust-lang-nursery/rust-clippy">
<a href="https://github.com/rust-lang/rust-clippy">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"/>
</a>