Commit Graph

1402 Commits

Author SHA1 Message Date
Krishna Veera Reddy
728a2418cb Fix clippy build failure
Clippy build fails because the feature `result_map_or` has been
stabilized in v1.41.0 but we still have an explicit feature
attribute for it.
2019-12-16 22:29:05 -08:00
Krishna Veera Reddy
c77fc06d52 Add lint to detect transmutes from float to integer
Add lint that detects transmutation from a float to an integer
and suggests usage of `{f32, f64}.to_bits()` instead.
2019-12-07 16:33:49 -08:00
RobbieClarken
f5d0a452ba Add lint for pub fns returning a Result without documenting errors
The Rust Book recommends that functions that return a `Result` type have
a doc comment with an `# Errors` section describing the kind of errors
that can be returned
(https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commonly-used-sections).
This change adds a lint to enforce this. The lint is allow by default;
it can be enabled with `#![warn(clippy::missing_errors_doc)]`.

Closes #4854.
2019-12-06 17:19:05 +10:30
Philipp Hansch
44eec0884d
Feed the dog 2019-11-29 20:47:50 +01:00
Philipp Hansch
36c6a18217
Update custom ICE function with latest rustc 2019-11-29 20:47:50 +01:00
Philipp Hansch
fc57c84abe
Use Clippy version in ICE message 2019-11-29 20:47:50 +01:00
Philipp Hansch
676f14baa0
Add custom ICE message that points to Clippy repo
This utilizes https://github.com/rust-lang/rust/pull/60584 by setting
our own `panic_hook` and pointing to our own issue tracker instead of
the rustc issue tracker.

This also adds a new internal lint to test the ICE message.

**Potential downsides**

* This essentially copies rustc's `report_ice` function as
  `report_clippy_ice`. I think that's how it's meant to be implemented, but
  maybe @jonas-schievink could have a look as well =)

  The downside of more-or-less copying this function is that we have to
  maintain it as well now.
  The original function can be found [here][original].
* `driver` now depends directly on `rustc` and `rustc_errors`

Closes #2734

[original]: 59367b074f/src/librustc_driver/lib.rs (L1185)
2019-11-29 20:47:47 +01:00
bors
04036877ef Auto merge of #4863 - phansch:use_self, r=flip1995
Move use_self to nursery

Closes #4859

We have a lot of false positives in this lint, so I think it makes sense
to move this to the nursery until they are resolved.

changelog: Move `use_self` lint to nursery, due to many false positives
2019-11-29 18:17:41 +00:00
Philipp Hansch
70a2a29453
Move use_self to nursery
Closes #4859

We have a lot of false positives in this lint, so I think it makes sense
to move this to the nursery until they are resolved.

changelog: Move `use_self` lint to nursery, due to many false positives
2019-11-29 07:51:49 +01:00
flip1995
a61fd43a79
Don't error on clippy.toml of dependencies 2019-11-28 16:42:29 +01:00
bors
d377486561 Auto merge of #4821 - Areredify:as_conversions, r=flip1995
Add `as_conversions` lint

changelog: closes #4771, adding a new pedantic allow-by-default lint that lints against any usage of `as`.
2019-11-28 08:53:36 +00:00
Lzu Tao
d0e0ffa99f make use of Result::map_or 2019-11-28 10:52:20 +07:00
Mikhail Babenko
9ec8888b91 implemented as_conversions lint
actuall add files

add better example and change pedantic to restriction
2019-11-25 18:12:52 +03:00
flip1995
9b4faf97f3
Run update_lints 2019-11-23 17:57:28 +01:00
flip1995
7db973d06f
Merge remote-tracking branch 'FlorianRohm/issue/4623' into rollup-new-lints 2019-11-23 17:56:13 +01:00
flip1995
353668ee6c
Merge remote-tracking branch 'Areredify/large_stack_arrays' into rollup-new-lints 2019-11-23 17:55:10 +01:00
flip1995
213765a1d3
Merge remote-tracking branch 'popzxc/if-same-cond-fn' into rollup-new-lints 2019-11-23 17:54:26 +01:00
flip1995
d151ef7437
Merge remote-tracking branch 'upstream/zst-offset' into rollup-new-lints 2019-11-23 17:53:41 +01:00
flip1995
7bae5bd828
Add comment for mir_opt_level=0 2019-11-23 01:26:19 +01:00
flip1995
e3a74ed2b5
Set mir_opt_level=0
This introduces some FNs. But a building Clippy is more important for now
2019-11-22 14:25:44 +01:00
Igor Aleksanov
bbb8cd4fbb Implement if_same_cond_fn lint
Run ./util/dev

Revert changelog entry

Rename lint to same_functions_in_if_condition and add a doc example

Add testcases with different arg in fn invocation
2019-11-20 06:54:46 +03:00
Andre Bogus
c21b198576 New lint: zst_offset 2019-11-15 22:39:27 +01:00
Florian Rohm
73806b72a9 register new lint "tabs in doc comments" and update readme 2019-11-15 16:26:30 +01:00
Areredify
7fddac0404 Add new lint: large stack array
added documentation

minor style fix

change as to ::from

add ignore to doc

include threshold in lint message/make suggestion more apparent/use Scalar api instead of matching

style fix

shange snippet_opt to snippet
2019-11-13 21:44:29 +03:00
Mikhail Babenko
227dc44aee display help on empty command line arguments 2019-11-13 04:27:43 +03:00
Michael Wright
5817a4fa06 Add to_digit_is_some lint 2019-11-10 15:52:59 +02:00
Heinz N. Gies
2f1370d64c Update lints 2019-11-07 17:13:26 +01:00
Heinz N. Gies
eae6a62db7 Simplify dentry point detection 2019-11-07 17:11:05 +01:00
Heinz N. Gies
60c2fdd0b9 Update lints 2019-11-07 17:10:18 +01:00
flip1995
08fd397c2c
Deprecate into_iter_on_array lint
This lint was uplifted/reimplemented by rustc.
Rustup to rust-lang/rust#66017
2019-11-07 14:04:29 +01:00
bors
eae7b997dd Auto merge of #4714 - msizanoen1:remove-plugin, r=Manishearth
Remove clippy plugin

This PR removes the clippy plugin, which is already deprecated and is causing the `fmt_macros` not found error in rust-lang/rust#62558: https://github.com/rust-lang/rust/issues/62558#issuecomment-529884322

changelog: remove plugin interface
2019-11-06 03:21:01 +00:00
flip1995
1e1d45a005
Move manual_mul_add into nursery 2019-10-26 19:57:01 +02:00
msizanoen
a127e14631 Remove clippy plugin 2019-10-24 21:12:19 +07:00
Mark Rousskov
7e77f3c29f
Update clippy for latest rustc changes
Specifically, this revises the clippy integration to utilize a new
callback to register its lints, as the prior editing of lint store in
Session is no longer possible.
2019-10-24 11:40:45 +02:00
Marcel Hellwig
5572476a36 Add lint for debug_assert_with_mut_call
This lint will complain when you put a mutable function/method call
inside a `debug_assert` macro, because it will not be executed in
release mode, therefore it will change the execution flow, which is not
wanted.
2019-10-22 10:39:55 +02:00
Heinz N. Gies
7f454d8d06 Split out tests 2019-10-18 07:40:48 +02:00
Heinz N. Gies
98dc3aabea Add todo and tests 2019-10-18 07:37:58 +02:00
HMPerson1
76b44f34b9
Add inefficient_to_string lint 2019-10-16 15:54:20 -04:00
James Wang
e23a424b31
Change lint to be pedantic 2019-10-15 09:58:11 +02:00
James Wang
664522badd
Add a new lint for unused self 2019-10-15 09:58:11 +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
Nikos Filippakis
5143fe1a78 New lint: suspicious_unary_op_formatting
Lints when, on the RHS of a BinOp, there is a UnOp without a space
before the operator but with a space after (e.g. foo >- 1).

Signed-off-by: Nikos Filippakis <nikolaos.filippakis@cern.ch>
2019-10-09 16:22:00 +02:00
Ethan Lam
327c91f8c7 Addresses Issue #4001
Fixed typo

Fixes lint name and uses appropriate linting suggestion

changed lint help message

Added autofixable test

Added Autofixable Test

Removed Broken Autofixable File

updated lints

Generated Autofixable/Nonfixable Test Cases

Changed Suggestion Applicability

Updated Lint Count
2019-10-08 08:46:29 -05:00
bors
e2393b09ac Auto merge of #4592 - rust-lang:transmute-collection, r=flip1995
New lint: `unsound_collection_transmute`

changelog: Add `unsound_collection_transmute` lint

This fixes #4515
2019-10-08 05:51:07 +00:00
Shotaro Yamada
301ef6bb2a Fix false-positive of redundant_clone and move to clippy::perf 2019-10-03 08:10:29 +09:00
Andre Bogus
27fa2b7944 New lint: unsound_collection_transmute 2019-10-02 21:18:00 +02:00
Andre Bogus
23a9c02120 New lint: needless_doc_main 2019-10-02 17:17:22 +02:00
James Wang
52408f5b7d
Add a new lint for comparison chains 2019-09-24 16:55:05 -05:00
Michael Wright
d04bf15114 Merge branch 'master' into unneeded_wildcard_pattern 2019-09-22 08:59:23 +02:00
Andre Bogus
8d884c8a1a new lint: mem-replace-with-uninit 2019-09-20 00:25:57 +02:00
bors
f08f171530 Auto merge of #4539 - jolson88:cast-lossless-pedantic, r=flip1995
Changes cast-lossless to a pedantic lint

As discussed in #4528, this moves the cast-lossless lint from `all` to `pedantic`.

I couldn't tell from description alone if it should also be removed from the complexity category, so I left it as part of complexity for now. I didn't see any impact to the tests from this change, but I could be wrong (as this is my first PR).

fixes #4528

changelog: Moves cast-lossless from default to checking only as a `pedantic` lint.
2019-09-19 08:50:31 +00:00
Andre Bogus
70a7dab773 New lint: Require # Safety section in pub unsafe fn docs 2019-09-19 09:19:55 +02:00
Jason Olson
cc68d8135b
Changes to catch_fatal_errors in rustc driver
A [recent PR](https://github.com/rust-lang/rust/pull/60584/files#diff-707a0eda6b2f1a0537abc3d23133748cL1151)
changed the function name from `report_ices_to_stderr_if_any` to `catch_fatal_errors`. This PR changes to using
the new function name.
2019-09-16 11:08:45 -07:00
Jason Olson
6f1f413717
Changes cast-lossless to a pedantic lint
Fixes #4528
2019-09-15 10:32:45 -07:00
Michael Wright
4a3bc6b592 Add unneeded-wildcard-pattern lint 2019-09-12 08:25:05 +02:00
Yuki Okushi
e236740f28 Fix redundant_pattern false positive 2019-09-05 00:36:48 +09:00
bors
9d2772207e Auto merge of #4418 - euclio:byte-lit-suggestion, r=flip1995
use a structured suggestion for char-lit-as-u8

changelog: use a structured suggestion for char-lit-as-u8
2019-09-04 13:33:47 +00:00
flip1995
14d1d040b4
Run update_lints 2019-09-04 15:33:14 +02:00
Shotaro Yamada
4960f79476 Add manual_saturating_arithmetic lint 2019-09-04 18:38:25 +09:00
Andre Bogus
b01f2d1126 lint against MaybeUninit::uninit().assume_init() 2019-09-03 17:37:38 +02:00
Lzu Tao
ab335eacb4 Run update_lints for Unicode lint 2019-08-23 09:49:49 +00:00
Simon Sapin
08d8ffc6a9 Import rustc_plugin from its new location
Depends on https://github.com/rust-lang/rust/pull/62727
2019-08-19 17:52:10 +02:00
Lzu Tao
7065239da5 Add option_and_then_some lint 2019-08-19 03:54:40 +00:00
bors
f01a0c0e08 Auto merge of #4403 - xd009642:type_repetition_improvements, r=phansch,flip1995
Improvements to `type_repetition_in_bounds`

Improvements to the `type_repetition_in_bounds` trait based on feedback from #4380 #4326 #4323

Currently just make it pedantic. Hopefully, more to come

changelog: move `type_repetition_in_bounds` to `pedantic`
2019-08-18 21:03:21 +00:00
xd009642
76598adafb Run update_lints 2019-08-18 16:59:31 +01:00
Jeremy Stucki
9c39c02b75
Change lint type to 'complexity' 2019-08-18 16:49:11 +02:00
Jeremy Stucki
5df84f2192
Merge branch 'origin/master' into suspicious_map 2019-08-18 16:37:31 +02:00
KRAAI, MATTHEW [VISUS]
a68abc03a2 Remove "a" from single_match_else description 2019-08-16 05:41:35 -07:00
Jeremy Stucki
f4f31a4ff4
Implement lint 'suspicious_map' 2019-08-15 22:58:32 +02:00
Philipp Hansch
42f03539ca
Deprecate unused_collect lint
I found this because we only had two test cases in total for this lint.
It turns out the functionality is fully covered by rustc these days.

[Playground Examples](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=eb8ee6db389c77180c9fb152d3c608f4)

changelog: Deprecate `unused_collect` lint. This is fully covered by
rustc's `#[must_use]` on `collect`

cc #2846
2019-08-14 21:47:11 +02:00
Jeremy Stucki
4275d7b6ac
Run 'update_lints' 2019-08-12 21:47:12 +02:00
Jeremy Stucki
b651f19eb8
Rename 'flat_map' → 'flat_map_identity' 2019-08-11 20:34:25 +02:00
Jeremy Stucki
f0ce04f814
Handle calls with 'std::convert::identity' 2019-08-11 19:51:43 +02:00
Jeremy Stucki
05d9f884e1
Merge branch 'origin/master' into flat-map 2019-08-11 19:22:40 +02:00
Ralf Jung
40fea7a9e0 update_lints 2019-08-11 11:02:25 +02:00
flip1995
a922f800af
Run update_lints and fmt 2019-08-05 13:24:31 +02:00
Vincent Dal Maso
77b21b644f
Move expression check to LateLintPass
Changes:
- Move from EarlyLintPass
- Fix entrypoint check with function path def_id.
2019-08-05 13:23:30 +02:00
flip1995
e6a836e2e8
Move UNNECESSARY_UNWRAP to complexity and PANICKING_UNWRAP to correctness 2019-08-01 15:14:06 +02:00
xd009642
925e8207fa Respond to review comments
Update README and CHANGELOG using the util scripts, refine the help message and fix the float_cmp error.
2019-07-27 21:58:29 +01:00
Matthias Krüger
a865fe607c rustup https://github.com/rust-lang/rust/pull/62679/ 2019-07-19 16:41:10 +02:00
Darth-Revan
b7145fbb66
Fix "unkown clippy lint" error in UI test. 2019-07-17 08:58:36 +02:00
Darth-Revan
0513202d25
Implement lint for inherent to_string() method. 2019-07-17 08:58:32 +02:00
bors
a73bb33399 Auto merge of #4273 - mikerite:deny-warnings, r=flip1995
Deny warnings in CI

changelog: none
2019-07-15 07:51:29 +00:00
Michael Wright
b523d35d41 Deny warnings in CI 2019-07-15 07:35:02 +02:00
flip1995
c100c70822
Build sys_root in driver with PathBuf instead of String 2019-07-13 12:48:42 +02:00
Jeremy Stucki
c7da4c26fb
Implement flat_map lint 2019-07-08 17:11:54 +02:00
Joe Frikker
1e6c6976dd PR comments 2019-06-23 18:02:13 -04:00
Joe Frikker
60a80849ce Adding try_err lint 2019-06-22 16:37:05 -04:00
David Tolnay
f88a387c3f
Downgrade integer_division to restriction 2019-06-15 00:17:04 -07:00
flip1995
0e480ca4bc
Use replace_region_in_file for creating the lint list 2019-06-14 13:07:33 +02:00
Jane Lusby
2719c1e6a3 minor fix 2019-06-12 12:29:37 -07:00
Jane Lusby
a2bf96f1c6 make it pass dogfood 2019-06-12 12:29:37 -07:00
Jane Lusby
113ae891d9 run rustfmt 2019-06-12 12:29:37 -07:00
Jane Lusby
73259d68db fix padding and put clippy someplaces 2019-06-12 12:29:37 -07:00
Jane Lusby
cfd7e0d5fd show default lint levels 2019-06-12 12:29:37 -07:00
Jane Lusby
07ccec86a5 group printing 2019-06-12 12:29:37 -07:00
Jane Lusby
296794dec5 prelim arg parse 2019-06-12 12:29:37 -07:00
Jane Lusby
5abcff2be5 move Lint static def into its own module 2019-06-12 12:29:37 -07:00
Jane Lusby
f6367c41dc switch to sorted usable lints 2019-06-12 12:29:37 -07:00
Jane Lusby
cf88c8487a initial commit for help improvements on clippy-driver 2019-06-12 12:29:37 -07:00
Matthias Krüger
6967cf59a4 clippy-driver: use rustc_tools_util to get version info.
This will add git hash information to `clippy-driver -V` output.
2019-05-01 10:43:16 +02:00
Matthias Krüger
414c34c300
rustup 41316f0449 2019-04-01 20:37:05 +02:00
Félix Fischer
491f72442e
Updated source to match with recent rustc master toolchain changes 2019-04-01 20:37:05 +02:00
Philipp Hansch
c730de955e
Remove some unused features and error-patterns 2019-03-12 08:15:50 +01:00
Alexander Regueiro
d43966a176 Various cosmetic improvements. 2019-03-10 18:06:28 +00:00
John Kåre Alsaker
1388f2488e rustfmt 2019-03-10 12:00:17 +01:00
John Kåre Alsaker
0d4a19c0d1 Use the new rustc interface 2019-03-10 11:10:05 +01:00
Michael Wright
c9d79c0c5e Remove #[feature(try_from)]
`try_from` is now stable.
2019-02-26 08:43:47 +02:00
Grzegorz
16881390e1 removing redundant closures in the whole project 2019-02-10 13:35:44 +01:00
Jeremy Fitzhardinge
993e8ace8e Drive-by cleanups to cargo-clippy. No functional change. 2019-02-02 11:43:21 -08:00
Jeremy Fitzhardinge
71d03ae29b clippy-driver: if --sysroot is specified on the command line, use that
If the user explicitly sets sysroot on the command line, then use that
value.

Issue #3663
2019-02-02 11:43:21 -08:00
Jeremy Fitzhardinge
b5fd0108b3 clippy-driver: more robust test to see if we're clippy-enabled
Rather than looking for a fixed --emit arg set, just check to see
if we're emitting metadata at all. This makes it more robust to
being invoked by tools other than cargo (or if cargo changes its
invocation).

Issue #3663
2019-02-02 11:43:20 -08:00
Araam Borhanian
1169066a0b Adding lint for too many lines. 2019-02-01 13:21:19 -05:00
Matthias Krüger
e9e0a7e3bd rustup https://github.com/rust-lang/rust/pull/57726 2019-01-27 01:42:34 +01:00
Michael Wright
94a6eb0695 Fix dogfood tests on Appveyor
This introduces a work-around for a bug in rustup.rs when excuting
cargo from a custom toolchain. Instead of trusting rustup to
invoke cargo from one of the release channels we just invoke
nightly cargo directly.
2019-01-26 11:10:13 +02:00
Philipp Hansch
38d4ac7cea
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2019-01-08 21:46:39 +01:00
Matthias Krüger
5f0617b92f update CARGO_CLIPPY_HELP string to suggest tool lints. 2018-12-25 17:11:57 +01:00
Alex Crichton
b5f6eb6e75 Link to rustc_driver crate in plugin
This is in anticipation for rust-lang/rust#56987 where the
`rustc_driver` crate being linked in will be required to link correctly
against the compiler. In the meantime it should be harmless otherwise!
2018-12-19 15:05:41 -08:00
bors
980bcd8c53 Auto merge of #3546 - matthiaskrgr:fix_install, r=oli-obk
Revert "Merge pull request #3257 from o01eg/remove-sysroot"

This reverts commit 041c49c1ed, reversing
changes made to 1df5766cbb.

The PR broke running a cargo-install'd clippy.
The installed clippy would not be able to find a crate for std.

Fixes #3523
Reopens #2874
2018-12-19 12:54:47 +00:00
flip1995
0516c2e04a
Move renaming to the right place 2018-12-17 13:58:41 +01:00
Matthias Krüger
a9509eb598 Revert "Merge pull request #3257 from o01eg/remove-sysroot"
This reverts commit 041c49c1ed, reversing
changes made to 1df5766cbb.
2018-12-14 21:42:01 +01:00
O01eg
69813d6faf
Don't try to determine sysroot. rustc_driver will use default value. 2018-12-06 12:23:39 +03:00
flip1995
d71c871568
Run rustfmt on src 2018-11-27 21:12:13 +01:00
Matthias Krüger
3a11cd4289 remove unused allow() attributes, NFC 2018-11-17 13:47:46 +01:00
Oliver Scherer
9d3373137b Remove now-useless allow(unknown_lints) 2018-10-11 12:18:27 +02:00
Oliver Scherer
b8654eaa6c Stabilize tool lints 2018-10-11 12:16:22 +02:00
Devon Hollowood
eef2e8948b Fix cast_possible_truncation warnings 2018-10-08 21:40:21 -07:00
Manish Goregaokar
e9c025ea70 Add license header to Rust files 2018-10-06 09:43:08 -07:00
O01eg
8695c2c34b
Allow to debug rustc_driver via logs. 2018-10-03 21:41:02 +03:00
Eduard-Mihai Burtescu
9219fc6c5c Reintroduce extern crate for non-Cargo dependencies. 2018-09-15 11:10:51 +03:00
flip1995
f49f133cba
Fix pedantic filter_map warnings 2018-09-14 12:56:25 +02:00
Matthias Krüger
fa11aad92a print git commit hash and commit date in version output
clippy 0.0.212 (964fcbe0 2018-09-06)
2018-09-06 14:45:12 +02:00
Michael Wright
4f7a260472 driver: Improve check for rustc arg
The rustc arg might not be exactly "rustc". It may be any path to a rustc
executable (especially if the RUSTC environment variable is set when
executing cargo). Rather check that it is a path with 'rustc' file stem.
2018-09-06 07:01:56 +02:00
flip1995
daa4f0ad34 Implement backwards compatibility changes introduced by rust-lang/rust#53762 2018-08-29 11:08:29 -07:00
flip1995
f3bb161f0e Adapt codebase to the tool_lints 2018-08-29 11:08:29 -07:00
Oliver Schneider
caa59e2e27 Use the compilers exit code computation instead of rolling our own 2018-08-26 15:57:17 +02:00
Matthias Krüger
8ab16b678c
remove macro_vis_matcher feature gate since it is stable now.
Warning was:
warning: the feature `macro_vis_matcher` has been stable since 1.29.0 and no longer requires an attribute to enable
 --> src/lib.rs:4:12
  |
4 | #![feature(macro_vis_matcher)]
  |            ^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(stable_features)] on by default
2018-08-23 15:40:51 +02:00
Manish Goregaokar
a7bea134d3 Remove implied rust_2018 feature
We are already on the edition and this feature is implied.
2018-08-19 19:14:47 -07:00
Michael Wright
bbd67c9b78 Fix #2927 2018-08-15 08:11:07 +02:00
Oliver Schneider
afd91248ed Rustup 2018-07-23 13:01:12 +02:00
Oliver Schneider
ff0e5f967f Rewrite the print/write macro checks as a PreExpansionPass 2018-07-23 00:19:07 +02:00
Mateusz Mikuła
a6601f2d02 Enable rust_2018_idioms warning 2018-06-25 20:56:25 +02:00
Fraser Hutchison
5be00bcd18 Ensure a non-zero value is returned by clippy if compilation fails 2018-06-21 05:20:14 +01:00
Mateusz Mikuła
b45fb35ec4 Cleanup of driver code 2018-06-07 22:13:24 +02:00
Mateusz Mikuła
52deb3b086 Prepare for upcoming breakage 2018-06-07 19:16:41 +02:00
Mateusz Mikuła
26f3feb980 Add rust_2018_preview feature and fix rustfmt annotation 2018-05-30 10:10:01 +02:00
Mateusz Mikuła
3c6503eb4b Format code 2018-05-22 10:21:42 +02:00
Oliver Schneider
b60ffa780d
Stop compilation after linting 2018-05-19 18:49:57 +02:00
utam0k
df1b7c5f19 Rename trans to codegen 2018-05-19 14:29:20 +09:00
Oliver Schneider
fd8a1d20cc
Remove all mention and testing of #[plugin(clippy)] and warn if used 2018-05-11 13:20:39 +02:00
Philipp Hansch
a854874e6a
Fix latest nightly breakage
I'm not sure if there are better ways to use the RwLock API, though. But
it seems to work.
2018-04-18 20:25:43 +02:00
Manish Goregaokar
399488079b argh 2018-04-04 19:15:22 -07:00
Manish Goregaokar
ab28118449 Fix driver dogfood bug 2018-04-04 18:56:21 -07:00
Michael Wright
a8bb8925cb Fix clippy warning 2018-04-04 07:08:35 +02:00
Michael Wright
add4434ee3 Support non-unicode paths for dogfood test 2018-04-02 09:28:08 +02:00
Michael Wright
609dd47410 Fix clippy warnings from last commit 2018-04-01 10:18:05 +02:00
Michael Wright
1ab96db791 Make dogfood test output to seperate directory
This commit makes `cargo clippy` output the build artifacts to a
separate directory if the `CLIPPY_DOGFOOD` env var is set. This should
prevent dogfood builds from interfering with regular builds.

This should help with issue #2595.
2018-04-01 09:44:30 +02:00
Benjamin Gill
8db845c189
Delete all code for handling manifest path
Now that we're using cargo check, we can stop needing to find out the
manifest path ourselves. Instead, we can delegate to cargo check, which
is perfectly capable of working out for itself what needs to be built.

This fixes #1707 and #2518.

Note that this PR will change the output. We will no longer output `bin:
foo` before each crate. This a bit unfortunate. However, given that
we're now going to be building in parallel (which is *much* faster), I
think this is acceptable - we'll be no worse than cargo itself.
2018-03-28 23:27:49 +01:00
Oliver Schneider
66a98d2658
Use cargo check instead of cargo rustc 2018-03-28 11:50:17 +02:00
Oliver Schneider
9b10c4be8c
Undo current_dir -> CARGO_MANIFEST_DIR move 2018-03-27 13:00:02 +02:00
Oliver Schneider
96d5af36f8
Version bump 2018-03-27 12:14:46 +02:00
Oliver Schneider
bef1afac5b
Undo a temporary fix for a cargo bug
Fixes #2566
2018-03-25 08:52:00 +02:00
Oliver Schneider
47a706682c
Version bump 2018-03-19 09:26:05 +01:00
Mateusz Mikuła
23bfa396a0 Format code
Signed-off-by: Mateusz Mikuła <mati865@gmail.com>
2018-03-16 10:54:49 +01:00
Oliver Schneider
21f387d278
Update dependencies 2018-03-13 16:54:13 +01:00
TomasKralCZ
42120141bd Suggestion fixed, simplified lint logic. 2018-02-12 11:26:00 +01:00
Seiichi Uchida
a2fec0e3e3 Rustup to rustc 1.25.0-nightly (97520ccb1 2018-01-21) 2018-01-22 13:23:57 +09:00
Oliver Schneider
26f83d6218 Readd the .exe extension on windows 2018-01-19 13:14:44 +01:00
Manish Goregaokar
3c4f5bfae2
Use rustc_driver::run (fixes #2303)
This internally uses monitor() which catches panics and stuff
2018-01-17 14:04:42 +01:00
Oliver Schneider
8ddcb81a15
Rustup and lazy_static version mismatch fix
fixes #2274
2017-12-15 10:05:32 +01:00
Oliver Schneider
127c41f700
Apply changes that were required for running in the rustc test suite 2017-11-14 14:56:00 +01:00
topecongiro
7a06d312fd Cargo fmt 2017-11-05 04:55:56 +09:00
Oliver Schneider
47be692723
Merge pull request #2194 from martinlindhe/master
fix some typos
2017-11-02 10:30:10 +01:00
topecongiro
6fc9fe2eba Fix a typo 2017-11-02 07:18:34 +09:00
topecongiro
49392fce53 Avoid panicking when no arg is given to clippy_driver 2017-11-02 07:13:14 +09:00
topecongiro
1326accdcf Use is_ok() 2017-11-02 07:09:46 +09:00
Martin Lindhe
7bce43b66b fix some typos 2017-10-31 08:34:27 +01:00
Manish Goregaokar
c526c51923 Update clippy for rustc 1.23.0-nightly (f0fe716db 2017-10-30) 2017-10-31 00:07:10 -07:00
Oliver Schneider
50ffaca4c9
Reduce the hackiness of cargo-clippy 2017-10-03 12:07:24 +02:00
Aaron Hill
4da0aeb40e
Set RUSTC_WRAPPER instead of RUSTC when invoking Cargo
Some build scripts rely on the RUSTC binary being the actual compiler
(e.g. parsing the output of 'RUSTC --version'). To prevent clippy from
breaking these build scripts, this commit sets RUSTC_WRAPPER instead.
This will cause Cargo to leave RUSTC unchanged, making the use of clippy
transparent to build scripts.
2017-09-28 13:59:51 -04:00
topecongiro
86e178e786 Add a missing argument 2017-09-14 13:18:08 +09:00
Oliver Schneider
e4524ac4de
Run nightly rustfmt 2017-09-05 12:39:27 +02:00
Oliver Schneider
992d88ab58 Merge pull request #1977 from rust-lang-nursery/panic
Fix a panic and a false positive
2017-08-22 10:20:02 +02:00
Oliver Schneider
56068b1b67
Fix ICE #1969 2017-08-21 12:57:33 +02:00
Benjamin Gill
6c665893d5 Add help text for --all 2017-08-20 05:10:13 +01:00
Benjamin Gill
5d72cc9b08 Run Rustfmt-nightly 2017-08-20 05:04:12 +01:00
Benjamin Gill
1265b46478 Basic implementation of cargo clippy --all
This implements workspace support for `cargo clippy` by running clippy
over all packages in the workspace (in serial).

This should probably be parallelised in future (as `cargo build --all`).
2017-08-20 05:00:49 +01:00
Oliver Schneider
0e4c49b145
Handfix dogfood issues with the rustfmt changes 2017-08-14 09:43:26 +02:00
Oliver Schneider
b25b6b3355
Rustfmt 2017-08-14 09:43:26 +02:00
Arnavion
d3bdec216b Canonicalize --manifest-path argument before comparing it to cargo metadata.
Before this change, a relative path like `--manifest-path=./Cargo.toml` would
fail to find a matching package in the cargo metadata. With this change,
both the argument and the cargo metadata path are canonicalized before
comparison.
2017-07-28 15:22:31 -07:00
Arnavion
db7a5c69f1 Fix logic that determines closest parent crate when invoked from a subdirectory.
The previous logic incorrectly matches the deepest child of the current
directory that is a crate.
2017-07-27 00:04:17 -07:00
Oliver Schneider
e88c29cf34 Merge pull request #1860 from Vurich/master
Allow cargo-clippy to work in subdirectories
2017-07-04 19:32:09 +02:00
Oliver Schneider
01bb0f9e51 ignore needless_lifetimes false positive 2017-07-04 16:07:33 +02:00
Oliver Schneider
b8ecdc1cef Merge pull request #1852 from Manishearth/notrans
Use `--emit=metadata` instead of `-Zno-trans`
2017-07-03 09:29:54 +02:00
messense
edadbff4ea
Fix compilation on rustc 1.20.0-nightly (067971139 2017-07-02) 2017-07-03 12:26:03 +08:00
Vurich
956a98c0c7 Allow cargo-clippy to work in subdirectories 2017-06-29 12:57:28 +02:00
Oliver Schneider
22dd3eef0b Use --emit=metadata instead of -Zno-trans
fixes #1500
2017-06-26 14:49:30 +02:00
Oliver Schneider
5842463562 Run rustfmt 2017-04-12 11:06:32 +02:00
Oliver Schneider
8f88ead7d6 Remove some legacy code 2017-03-27 14:51:37 +02:00
Techcable
9aebb59a68
Fix compilation on latest nightly
The ability for plugins to add MIR passes was removed as of 4ca9c97ac.
Luckily, we don't use this feature at all and can safely ignore it.

Fixes #1618
2017-03-12 20:13:20 -07:00
Oliver Schneider
a78ca9e955 Run rustfmt 2017-02-28 14:29:06 +01:00
Oliver Schneider
5c2549482a Get cargo clippy working on 64 bit windows again
fixes #1244
2017-02-28 12:47:48 +01:00
Ben Boeckel
1b0749a6d0 main: end error messages with a newline 2017-02-16 13:18:00 -05:00
Andre Bogus
ad01fa9b57 Remove stabilized feature flag 2017-02-11 01:42:14 +01:00
Oliver Schneider
4a70a46d2d
run rustfmt 2017-01-26 11:31:26 +01:00
Oliver Schneider
26e8558d8a
remove rustc-serialize dependency and factor util::cargo out into a crate 2017-01-26 11:31:26 +01:00
Andre Bogus
94c97d2ec9 formatting 2017-01-15 01:12:16 +01:00
Andre Bogus
dbde3b8e1c dogfood fallout 2017-01-15 00:33:29 +01:00
Oliver Schneider
0553de8573
run rustfmt on clippy, not only on clippy_lints 2016-12-21 12:36:25 +01:00
Oliver Schneider
ed9d71f2c9
remove nondeterminism by adjusting thresholds 2016-12-21 10:25:14 +01:00
Oliver Schneider
0a7ae5fec8
run rustfmt 2016-12-20 10:20:41 +01:00
mcarton
7dd3679ac3
Fix a couple warnings 2016-12-19 20:31:39 +01:00
Oliver Schneider
2cfe1e7b64 Merge pull request #1328 from Machtan/master
Add '--version' flag and allow version and help flags when called as 'cargo-clippy'
2016-11-09 10:49:16 +01:00
Jakob Lautrup Nysom
2d9386f86d Remove unnecessary #[allow] 2016-11-09 10:44:55 +01:00
debris
d16cc47ae8 fixed #1331 2016-11-08 21:50:35 +01:00
Machtan
e5a5a95a10 Add '--version' flag and use version and help flags when called as 'cargo-clippy' 2016-11-08 14:28:46 +01:00
Machtan
3800bff4de Add '--version' flag and allow version and help flags when called as 'cargo-clippy' 2016-11-08 13:54:08 +01:00
Oliver 'ker' Schneider
6a73c8f8e3 --sysroot isn't necessary anymore for the outer cargo clippy call 2016-11-08 11:35:26 +01:00
Epicat Supercell
e25b010847 fixed callback changes from rustc 1.14.0-nightly (7c69b0d5a 2016-11-01) 2016-11-02 21:27:42 +02:00
mcarton
ec893a198f
Fix small nits on the help message 2016-10-25 15:09:56 +02:00
mcarton
da943f5ec8
Allow --help to be any argument
Also dogfoog.
2016-10-24 16:29:36 +02:00
mcarton
409b8e7343
Revert "Revert "Automatically defines the clippy feature""
This reverts commit e4dceef7e7.
2016-10-24 16:04:00 +02:00
mcarton
4923415930
Be more helping with cargo clippy --help 2016-10-24 15:31:11 +02:00
Arnavion
604694bc0b Use .expect() for extracting the current_dir. 2016-10-23 12:29:33 -07:00
Arnavion
2315a817ce Changed signature of cargo::metadata according to review comment. 2016-10-23 12:24:16 -07:00
Arnavion
ebbd00b1ab Don't assume the first package in the result of cargo metadata is the current crate.
Instead find the one with the manifest path that matches the --manifest-path argument or the current directory.

Fixes #1247
2016-10-22 18:15:42 -07:00
mcarton
eec5425b34
Rustup to *rustc 1.14.0-nightly (289f3a4ca 2016-09-29)* 2016-09-30 22:03:21 +02:00
Oliver Schneider
c89c5d21c1
Merge remote-tracking branch 'origin/master' into examples 2016-09-19 15:38:38 +02:00
mcarton
c090c3df21
Rustup to *rustc 1.13.0-nightly (cbe4de78e 2016-09-05)* 2016-09-06 19:04:38 +02:00
mcarton
36d8ca04a1
Add a MISSING_DOCS_IN_PRIVATE_ITEMS lint 2016-08-23 18:28:39 +02:00
Oliver Schneider
7b717d3152
fallout 2016-08-17 18:35:25 +02:00
Oliver Schneider
59c31d319a
plugin mode still needs to work 2016-08-17 18:26:58 +02:00
Oliver Schneider
e3723cb938
running cargo clippy on a crate that has the clippy plugin enabled errors out due to duplicate lints 2016-08-17 18:09:35 +02:00
Oliver Schneider
0dab78b3e6
unify "test", "bench", "example" and "bin" into one branch 2016-08-17 18:09:35 +02:00
Oliver Schneider
32a0069f67
no println output 2016-08-17 18:09:35 +02:00
Oliver Schneider
6d7269a675
also run clippy on examples 2016-08-17 18:09:35 +02:00
Manish Goregaokar
f006805c4a
Bump to 0.0.82 2016-08-17 09:20:20 +05:30
Sascha Hanse
9aa7701262 make clippy compile again with the latest nightly after rust-lang/rust@65eb024542 2016-08-17 00:21:58 +02:00
Oliver Schneider
871f8dcab3
don't run clippy on dependencies when running cargo clippy 2016-07-04 13:33:48 +02:00
mcarton
3c4af49662
Rustup to ea0dc92972 2016-07-01 17:44:17 +02:00
mcarton
e4dceef7e7
Revert "Automatically defines the clippy feature"
This reverts commit d7ba66bf44.

It was causing problems with crates with:

```rust
#![cfg_attr(feature="clippy", plugin(clippy))]
```
2016-06-29 14:29:25 +02:00
Oliver Schneider
36c5026c48
fix cargo clippy when using with --manifest-path 2016-06-21 12:31:30 +02:00
Manish Goregaokar
5b1d849c7e Revert "fix cargo clippy when using with --manifest-path"
This reverts commit b31bebeea4.
2016-06-21 15:24:04 +05:30
Oliver Schneider
b31bebeea4
fix cargo clippy when using with --manifest-path 2016-06-21 11:35:34 +02:00
mcarton
489576437d
Cleanup dependencies and features 2016-06-10 00:09:17 +02:00
mcarton
11665a0d79
Dogfood 2016-06-10 00:08:14 +02:00
mcarton
90453fd893
Run rustfmt
Only partially apply suggestions.
2016-06-10 00:08:14 +02:00
mcarton
d7ba66bf44
Automatically defines the clippy feature 2016-06-08 21:53:58 +02:00
Oliver Schneider
8d5524f1da
clippy should work on all systems 2016-06-06 16:43:58 +02:00
Oliver Schneider
a81181b758
don't abort after successfully linting a target 2016-06-06 11:28:09 +02:00
Oliver Schneider
078cc68c52
no indexing 2016-06-02 17:39:28 +02:00
Oliver Schneider
7bb8ba4631
process more kinds of metadata 2016-06-02 17:29:25 +02:00
Oliver Schneider
80e81d351d
add version check to the unit tests 2016-05-30 12:47:04 +02:00
Oliver Schneider
e6a089efa9
dogfood 2016-05-30 11:32:02 +02:00
Oliver Schneider
0818e70497
don't require cargo clippy to pass a --lib or --bin x argument 2016-05-30 11:32:02 +02:00
Oliver Schneider
bf227f4729
split clippy into lints, plugin and cargo-clippy 2016-05-27 13:03:58 +02:00
Oliver Schneider
5eca09793e
needless_borrow reported on &&T when only &T implements Trait and &Trait is required 2016-05-27 12:12:38 +02:00
mcarton
8ac545d0fe Fix documentation 2016-05-26 00:08:31 +02:00
llogiq
4c347320be Merge pull request #955 from Manishearth/regexes
Regexes
2016-05-26 00:00:07 +02:00
mcarton
51d166f17a Support RegexBuilder 2016-05-25 21:36:51 +02:00
mcarton
4f11f84dee Lint binary regexes 2016-05-25 21:14:14 +02:00
Oliver Schneider
bb69e60b30
fix no_effect lint 2016-05-25 18:51:35 +02:00
Oliver Schneider
e90a0be923
simplify mut_mut lint 2016-05-25 10:40:25 +02:00
Andre Bogus
9cfc42275d Split new_without_default and new_without_default_derive.
This is still very slow, because we do a trait lookup for each field.
Perhaps storing the visited types in a set to reuse types would improve
performance somewhat. Also we may want to pre-decide some known types
(e.g. `Vec<T>`, `Option<T>`).
2016-05-24 18:22:18 +02:00
Benoît Zugmeyer
7a9dac4e1c Let cargo-clippy exit with a code > 0 if some error occured 2016-05-23 22:35:00 +02:00
mcarton
ac2e175c1b
Rustup to *1.10.0-nightly (476fe6eef 2016-05-21)* 2016-05-23 16:36:10 +02:00
mcarton
6dd608e53e
Rustup to *1.10.0-nightly (764ef92ae 2016-05-19)* 2016-05-23 16:11:28 +02:00
mcarton
2a5416d662
Rustup to *1.10.0-nightly (9c6904ca1 2016-05-18)* 2016-05-23 16:11:19 +02:00
Manish Goregaokar
973ae82d72 Merge branch 'pr-942' 2016-05-18 13:13:35 +05:30
mcarton
ca05e93c10 Rustup to *1.10.0-nightly (cd6a40017 2016-05-16)* 2016-05-17 23:25:20 +02:00
Manish Goregaokar
6a309af2f3 Don't panic if cargo rustc fails 2016-05-16 23:13:47 +05:30
Manish Goregaokar
f2f5fefd00
Allow invalid upcast comparisons 2016-05-16 22:52:22 +05:30
Martin Carton
4c4b1af03c Merge pull request #928 from oli-obk/unnecessary_operation
add a companion lint to `no_effect` with suggestions for partially (in-)effective statements
2016-05-13 17:45:58 +02:00
Oliver Schneider
1e897f1552 add a companion lint to no_effect with suggestions for partially effective statements 2016-05-13 16:43:47 +02:00
Martin Carton
e890bb5e4b Merge pull request #921 from afck/master
fix typos
2016-05-13 12:13:23 +02:00
Andreas Fackler
87df6ae8cb fix typos 2016-05-13 08:50:51 +03:00
mcarton
a9bea1f52b
Rustup to *1.10.0-nightly (22ac88f1a 2016-05-11)* 2016-05-12 21:22:38 +02:00
Oliver Schneider
610883b7aa
don't suggest closures over constants
fixes #917
2016-05-12 10:23:06 +02:00
llogiq
8fa68f1e08 Merge pull request #913 from oli-obk/assign_ops
suggest `a op= b` over `a = a op b`
2016-05-11 23:36:10 +02:00
llogiq
c170aa262a Merge pull request #915 from Manishearth/sysroot
Use rustc --print sysroot, bump to v66 r? @llogiq
2016-05-11 21:56:52 +02:00
llogiq
f966778770 Merge pull request #914 from oli-obk/non_expressive_names
similar_names fixes
2016-05-11 21:55:38 +02:00
Manish Goregaokar
03a309d182
Use rustc --print sysroot, bump to v66 2016-05-11 11:07:37 -07:00
Oliver Schneider
b0d008bc9d
add known problems 2016-05-11 17:04:27 +02:00
Oliver Schneider
f004120495
properly lint function argument patterns in similar_names 2016-05-11 16:45:06 +02:00
Oliver Schneider
49e2570b77
don't lint at the use-site of bad struct field bindings if they're shorthand
fixes #899
2016-05-11 16:44:43 +02:00
Oliver Schneider
c6b4b19a43
suggest a op= b over a = a op b 2016-05-11 15:32:20 +02:00
Josh Stone
11987f5b6f Support either rustup or multirust environment variables
Fixes #910
2016-05-10 13:45:37 -07:00
Manish Goregaokar
855b292cda Merge pull request #681 from oli-obk/split
cargo clippy
2016-05-10 00:41:34 -07:00
Seo Sanghyeon
f227225acd Remove unused imports 2016-05-10 00:35:51 +09:00
Oliver Schneider
654154d8e7
cargo clippy subcommand 2016-05-09 16:47:32 +02:00
Oliver Schneider
ba8653a8da
fallout 2016-05-09 13:08:00 +02:00
Oliver Schneider
6edc6a13d4
needless borrows found in clippy 2016-05-09 13:07:55 +02:00
Oliver Schneider
87faaec7a3
add needless_borrow lint 2016-05-09 13:07:43 +02:00
Manish Goregaokar
d70e7bb5fc Merge pull request #906 from Manishearth/birkenfeld-master
Rustup to *rustc 1.10.0-nightly (62e2b2fb7 2016-05-06)*
2016-05-07 21:31:21 -07:00
mcarton
aa10c93e8f
Fix tests 2016-05-08 01:13:05 +02:00
Oliver Schneider
0a3ab78bde
fix markdown generated from code 2016-05-06 16:09:05 +02:00
mcarton
3ce60e9731 Don’t warn in titles in DOC_MARKDOWN 2016-05-05 21:49:57 +02:00
mcarton
e14e1a7148 Fix issue with DOC_MARKDOWN and punctuation 2016-05-05 21:33:46 +02:00
Georg Brandl
ca743ecb77 rustup: fix breakage in diagnostics API
Also adds a function to add the clippy wiki note, which is used a few times.
2016-05-04 08:54:59 +02:00
Oliver Schneider
3a32c2c596 doc markdown lint shows the exact word location 2016-05-02 14:36:48 +02:00