Commit Graph

83 Commits

Author SHA1 Message Date
Alex Macleod b5bae09184 Add cargo dev lint to manually run clippy on a file
I found the manual run command really useful, this makes it a bit easier
to type
2021-11-06 17:20:15 +00:00
Michael Wright 3f804ca6d3 Move update_lints specific code out of lib 2021-09-29 05:46:43 +02:00
Michael Wright e6747df5cd Fix lint register code format
Also change the generation functions to return `String` instead of
`Vec<String>`. This makes sense now as the updates aren't line oriented
anymore.
2021-09-29 05:46:39 +02:00
Michael Wright 50ea370619 Move code generated by update_lints to includes 2021-09-29 05:43:25 +02:00
Cameron Steffen 68b4a43e23 Remove stderr limit 2021-08-23 11:02:03 -05:00
xFrednet 0a5f28c4b0 Added cargo dev setup git-hook 2021-06-25 11:16:59 +02:00
xFrednet 0941d9f14d Moved dev ide_setup to setup/intellij.rs 2021-06-25 11:16:55 +02:00
flip1995 ff452d5ba6 Deny warning in every main sub-crate
This enables the same warnings that are enabled in `clippy_lints` also
in `clippy_utils` and `clippy_dev`. Then it makes sure, that the
`deny-warnings` feature is passed down to `clippy_lints` and
`clippy_utils` when compiling Clippy.
2021-05-18 11:05:48 +02:00
Jason Newcomb 12fce55766 Fix all occurences of needless_borrow internally 2021-04-06 10:43:47 -04:00
Matthias Krüger a62e4263d5 rename cargo dev ra_setup to cargo dev ide_setup 2021-03-17 10:12:45 +01:00
Matthias Krüger 2546e6f006 lintcheck: move out of clippy-dev into own crate 2021-03-11 13:26:26 +01:00
flip1995 4aaad086d2 Fix dogfood errors in clippy_dev 2021-03-05 13:36:55 +01:00
Caden Haustein bde667af7e Add missing_panics_doc lint 2021-02-02 16:36:32 +01:00
Matthias Krüger 83fcf95f52 rename cargo dev crater to cargo dev lintcheck 2021-01-23 02:18:11 +01:00
Matthias Krüger bec916d02d cargo dev crater: lay out the base plan 2021-01-23 02:18:11 +01:00
Philipp Hansch 4bd9ed9b88 Rewrite update-all-references bash scripts in Rust
This replaces the `update-all-references` scripts with a single

    cargo dev bless

command.

cc #5394
2020-12-12 15:09:57 +01:00
Matthias Krüger 252083f7e0 address review comments and rebase
ci: always build with internal lints
group up internal lints in lib.rs
dogfood: we already pass --all-features, no need to enable internal-lints again
2020-11-29 23:43:23 +01:00
Matthias Krüger 958e2e20de fix clippy-dev update_lints 2020-11-29 21:07:47 +01:00
David Tolnay e6a71066c8 Clippy dev subcommand to build and serve website 2020-10-08 06:43:02 -07:00
Philipp Hansch 4b459596a9 clippy_dev: Replace lazy_static with SyncLazy 2020-10-06 08:18:11 +02:00
Matthias Krüger 7b49090380 clippy_dev: add ra_setup
This takes an absolute path to a rustc repo and adds path-dependencies
that point towards the respective rustc subcrates into the Cargo.tomls of
the clippy and clippy_lints crate.

This allows rustc-analyzer to show proper type annotations etc on rustc-internals inside the clippy repo.

Usage: cargo dev ra-setup /absolute/path/to/rust/

cc https://github.com/rust-analyzer/rust-analyzer/issues/3517
cc https://github.com/rust-lang/rust-clippy/issues/5514
2020-05-28 04:14:04 +02:00
Matthias Krüger d021d3ef88 clippy_dev: make it fatal when the regex for updating lint count does not match
Fixes #5510
2020-04-23 16:11:11 +02:00
flip1995 d89bb50f72 Make lint modules private 2020-04-03 21:19:33 +02:00
flip1995 a186d9fafd Don't filter lints in code generation functions 2020-04-03 21:19:32 +02:00
flip1995 98c30fea8c Build lint lists once and the reuse them to update files 2020-04-03 21:19:32 +02:00
flip1995 da679825e0 Get rid of Lint::is_internal method 2020-04-03 21:19:32 +02:00
flip1995 ffb2e41234 Clean up update_lints 2020-04-03 21:18:36 +02:00
flip1995 8b9d70d349 Define modules in lib.rs instead of main.rs 2020-03-31 17:24:09 +02:00
flip1995 50a2f971fc Adapt gen_lint_group_list test to also generate internal lints 2020-02-14 14:42:24 +01:00
flip1995 4a9bfe4184 Let update_lints also generate the internal lints 2020-02-14 14:37:56 +01:00
flip1995 3da2c9183a Save Lint::module as full path of module 2020-02-14 14:37:56 +01:00
flip1995 560559bafe Make Lint::by_lint_group take impl Iterator as argument 2020-02-14 14:37:55 +01:00
Lzu Tao cf58537bd6 dev: Move DOCS_LINK out of lazy_static and reuse it 2020-02-07 08:33:05 +07:00
Lzu Tao 729f943c53 dev: Prefer fs::read* and improvement to replace text region 2020-02-07 08:33:05 +07:00
Phil Hansch 8f457fa4c9 Mark clippy_project_root as must_use
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2020-01-31 07:32:53 +01:00
Philipp Hansch 3036a2c30e Move project_root function to clippy_dev/src/lib.rs
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-30 21:34:25 +01:00
Philipp Hansch 4d1a11d354 Deprecate util/dev in favor of cargo alias
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-30 21:34:31 +01:00
Lzu Tao f5b896451a do minor cleanups
* ToString and AsRef are in prelude, no need to import them
2019-12-24 03:06:52 +07:00
flip1995 d51a80c57e Enable deny-warnings feature everywhere in CI 2019-11-25 17:23:48 +01:00
flip1995 b2616641d9 Fix dogfood findings 2019-10-24 14:39:19 +02:00
Mark Rousskov 8c205018d2 Update clippy_dev 2019-10-24 11:47:00 +02:00
Andre Bogus cc622608db new lints around #[must_use] fns
`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-14 12:09:04 +02:00
Andre Bogus e3f143ff0a account for doc visibility 2019-10-02 21:15:28 +02:00
Lzu Tao 7065239da5 Add option_and_then_some lint 2019-08-19 03:54:40 +00:00
Philipp Hansch 5114050839 Update lint deprecation for tool lints
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-12 19:20:36 +02:00
flip1995 5361b842d1 Remove clippy::default_hash_types internal lint 2019-04-15 13:21:52 +02:00
Alexander Regueiro d43966a176 Various cosmetic improvements. 2019-03-10 18:06:28 +00:00
Andy Russell fe96ffeac9 move lint documentation into macro invocations 2019-03-05 18:45:08 -05:00
Grzegorz 16881390e1 removing redundant closures in the whole project 2019-02-10 13:35:44 +01:00
Matthias Krüger 873fe11ca5 dependencies: update itertools from 0.7 to 0.8 2019-01-25 20:25:14 +01:00