about summary refs log tree commit diff
path: root/clippy_dev/src
AgeCommit message (Collapse)AuthorLines
2020-02-03Decrease line length limit for stderrsYuki Okushi-1/+1
2020-01-31Auto merge of #5109 - phansch:ciao_util_dev, r=flip1995bors-61/+46
Deprecate util/dev in favor of cargo alias This means one less shell script and a bit more cross-platform support for contributors. If you've been using `./util/dev` before, this now becomes `cargo dev`. The key part of this change is found in `.cargo/config` where an alias for calling the `clippy_dev` binary is defined. changelog: none
2020-01-31Mark clippy_project_root as `must_use`Phil Hansch-0/+1
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2020-01-31Replace one more copy-pasted clippy_project_root fnPhilipp Hansch-20/+3
2020-01-30Move project_root function to clippy_dev/src/lib.rsPhilipp Hansch-30/+21
This allows us to use the method in both `fmt.rs` and `lib.rs` in multiple places. The downside is that we panic inside the method now, instead of using the error handling in `fmt.rs`. We may want to centralize the error handling for clippy_dev at some point, though.
2020-01-30Deprecate util/dev in favor of cargo aliasPhilipp Hansch-16/+26
If you've been using `./util/dev` before, this now becomes `cargo dev`. The key part of this change is found in `.cargo/config`. This means one less shell script and a bit more cross-platform support for contributors.
2020-01-30Decrease line length limit for stderr filesYuki Okushi-1/+1
2020-01-21Decrease line length limit for stderr filesYuki Okushi-1/+1
2020-01-16Add lifetimes to `LateLintPass`Krishna Sai Veera Reddy-4/+7
2020-01-16Fix rustc lint import paths generated by `new_lint`Krishna Sai Veera Reddy-1/+1
2020-01-15Generate new lints easilyBrad Sherman-0/+234
- Add option in clippy_dev to automatically generate boilerplate code for adding new lints
2019-12-24do minor cleanupsLzu Tao-1/+1
* ToString and AsRef are in prelude, no need to import them
2019-12-23a few small cleanupsLzu Tao-4/+0
2019-11-25Enable deny-warnings feature everywhere in CIflip1995-0/+4
2019-10-24Fix dogfood findingsflip1995-2/+9
2019-10-24Run ./util/dev fmtflip1995-3/+3
2019-10-24Update clippy_devMark Rousskov-8/+32
2019-10-14new lints around `#[must_use]` fnsAndre Bogus-0/+8
`must_use_unit` lints unit-returning functions with a `#[must_use]` attribute, suggesting to remove it. `double_must_use` lints functions with a plain `#[must_use]` attribute, but which return a type which is already `#[must_use]`, so the attribute has no benefit. `must_use_candidate` is a pedantic lint that lints functions and methods that return some non-unit type that is not already `#[must_use]` and suggests to add the annotation.
2019-10-08Auto merge of #4641 - sinkuu:revert_workaround, r=phanschbors-12/+3
Revert "Workaround cargo bug on Windows" [Cargo is fixed on rust master](https://github.com/rust-lang/rust/pull/65186). This reverts PR #4624. Fixes #4638 changelog: none
2019-10-08Auto merge of #4611 - rust-lang:doc-visibility, r=flip1995bors-1/+1
account for doc visibility This fixes #4608. Also I noticed that the lint failed to look at trait and impl items. There's a small bit of fallout in the code, too, but not enough to warrant its own commit. changelog: check docs of trait items and impl items, also make `missing_safety_doc` account for visibility
2019-10-08Revert "Workaround cargo bug on Windows"Shotaro Yamada-12/+3
This reverts commit 248251b3b26c5f21e2c2f5bfa5d85cc17b13fc05. This reverts commit 20b73514395bb442fb16ce913b6c2b3965ff3156.
2019-10-04Rollup merge of #4509 - sinkuu:redundant_clone_fix, r=llogiqPhil Hansch-4/+1
Fix false-positive of redundant_clone and move to clippy::perf This PR introduces dataflow analysis to `redundant_clone` lint to filter out borrowed variables, which had been incorrectly detected. Depends on https://github.com/rust-lang/rust/pull/64207. changelog: Moved `redundant_clone` lint to `perf` group # What this lint catches ## `clone`/`to_owned` ```rust let s = String::new(); let t = s.clone(); ``` ```rust // MIR _1 = String::new(); _2 = &_1; _3 = clone(_2); // (*) ``` We can turn this `clone` call into a move if 1. `_2` is the sole borrow of `_1` at the statement `(*)` 2. `_1` is not used hereafter ## `Deref` + type-specific `to_owned` method ```rust let s = std::path::PathBuf::new(); let t = s.to_path_buf(); ``` ```rust // MIR _1 = PathBuf::new(); _2 = &1; _3 = call deref(_2); _4 = _3; // Copies borrow StorageDead(_2); _5 = Path::to_path_buf(_4); // (*) ``` We can turn this `to_path_buf` call into a move if 1. `_3` `_4` are the sole borrow of `_1` at `(*)` 2. `_1` is not used hereafter # What this PR introduces 1. `MaybeStorageLive` that determines whether a local lives at a particular location 2. `PossibleBorrowerVisitor` that constructs [`TransitiveRelation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/transitive_relation/struct.TransitiveRelation.html) of possible borrows, e.g. visiting `_2 = &1; _3 = &_2:` will result in `_3 -> _2 -> _1` relation. Then `_3` and `_2` will be counted as possible borrowers of `_1` in the sole-borrow analysis above.
2019-10-04Use home::cargo_homeShotaro Yamada-1/+1
2019-10-04Workaround cargo bug on WindowsShotaro Yamada-3/+12
2019-10-03Test fixesShotaro Yamada-4/+1
2019-10-02account for doc visibilityAndre Bogus-1/+1
2019-08-19Add option_and_then_some lintLzu Tao-3/+3
2019-08-12Update lint deprecation for tool lintsPhilipp Hansch-3/+3
Our lint deprecation previously didn't work for tool lints, because `register_removed` was registering lints to be removed _without_ the `clippy` prefix.
2019-08-01Merge branch 'master' into dev-fmt-20190728Michael Wright-2/+2
2019-07-31Update all the code to pass the updated `use_self` lint.Jakub Wieczorek-2/+2
One struct required a temporary `#[allow(dead_code)]` annotation due to a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.
2019-07-28dev-fmt: better error handlingMichael Wright-0/+29
Check if rustfmt is installed at the start and exit if it isn't.
2019-07-17Decrease maximum length for stderr filesPhilipp Hansch-1/+1
Now at 275.
2019-07-11Avoid rustfmt bug on WindowsMichael Wright-1/+5
2019-07-07Fix crash on `dev --limit-stderr-length`Michael Wright-1/+1
2019-07-07Add dev fmt subcommandMichael Wright-18/+208
2019-06-14Use replace_region_in_file for creating the lint listflip1995-16/+17
2019-06-12make it pass dogfoodJane Lusby-2/+2
2019-06-12run rustfmtJane Lusby-1/+1
2019-06-12fix padding and put clippy someplacesJane Lusby-0/+1
2019-06-12show default lint levelsJane Lusby-0/+1
2019-06-12prelim arg parseJane Lusby-2/+2
2019-06-12move Lint static def into its own moduleJane Lusby-10/+3
2019-06-12switch to sorted usable lintsJane Lusby-5/+10
2019-06-12Update clippy_dev/src/main.rsJane Lusby-1/+1
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-06-12initial commit for help improvements on clippy-driverJane Lusby-0/+22
2019-05-17Collect at callsite, use eprintln instead of printlnPhilipp Hansch-4/+3
2019-05-16Add a stderr file length check to clippy_devPhilipp Hansch-2/+65
This adds a check to `clippy_dev` that enforces a maximum line count for `stderr` files. CI will fail if the line count is exceeded. It's currently set to `320` lines. Ideally this would be implemented in `compiletest-rs` but there are plans to move Rust's `compiletest` into the `compiletest-rs` repository and I don't want to do the work in `compiletest` twice. However, I also don't want to wait until the move is done, so I added the check to `clippy_dev` until it makes sense to add it to compiletest-rs. cc #2038
2019-04-15Remove clippy::default_hash_types internal lintflip1995-2/+0
2019-03-10Various cosmetic improvements.Alexander Regueiro-2/+2
2019-03-08Improve Clippy dev helpMichael Wright-2/+4
+ Print help if no subcommand is supplied + Make a short version of `update_lints` help for the subcommand listing