Commit graph

555 commits

Author SHA1 Message Date
Krishna Sai Veera Reddy
9e6a6069a7 Add lint to detect usage of invalid atomic ordering
Detect usage of invalid atomic ordering modes such as
`Ordering::{Release, AcqRel}` in atomic loads and
`Ordering::{Acquire, AcqRel}` in atomic stores.
2020-01-06 16:39:31 -08:00
Brad Sherman
ab5ff0352e Add lint for iter.nth(0)
- Encourage iter.next() rather than iter.nth(0), which is less readable
2020-01-04 11:20:11 -06:00
Krishna Veera Reddy
42e4595d3a Indicate anonymous lifetimes for types 2019-12-31 09:22:35 -08:00
mgr-inz-rafal
f191e916bd Add new lint (modulo_arithmetic) 2019-12-28 16:46:08 +01:00
Andre Bogus
40435acf3d new lint: mutable_key_type 2019-12-24 13:46:19 +01:00
Mikhail Babenko
a310cb2d0b implemented let_underscore lint
actually add files

update lints

change to pedantic
2019-12-22 22:10:25 +03:00
bors
19dbb22032 Auto merge of #4930 - flip1995:unused_label, r=phansch
Deprecate unused_label lint

This lint was uplifted/turned into warn-by-default in rustc

Fixes #4925

changelog: Deprecate [`unused_label`] lint
2019-12-22 09:39:32 +00:00
flip1995
710c749bb1
Deprecate unused_label lint
This lint was uplifted/turned into warn-by-default in rustc
2019-12-21 16:20:30 +01:00
Oliver Scherer @ Cosmian
a7e9aa367b
There are no per-file copyright headers anymore 2019-12-20 09:57:02 +01: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
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
Andre Bogus
c21b198576 New lint: zst_offset 2019-11-15 22:39:27 +01: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
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
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
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
bors
db233b0920 Auto merge of #4616 - mati865:license, r=Manishearth
Fix license in Cargo.toml files

Missed in https://github.com/rust-lang/rust-clippy/pull/3269

changelog: none

r? @Manishearth
2019-10-09 16:09:26 +00: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
Mateusz Mikuła
4f1d907462 Use new format of licenses
Co-Authored-By: lzutao <taolzu@gmail.com>
2019-10-04 17:40:32 +02: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
Andre Bogus
70a7dab773 New lint: Require # Safety section in pub unsafe fn docs 2019-09-19 09:19:55 +02:00
Michael Wright
4a3bc6b592 Add unneeded-wildcard-pattern lint 2019-09-12 08:25:05 +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
7065239da5 Add option_and_then_some lint 2019-08-19 03:54:40 +00: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
6ddf8c36d7
Run 'update_lints' 2019-08-12 07:53:22 +02:00
Ralf Jung
40fea7a9e0 update_lints 2019-08-11 11:02:25 +02:00
Alex Touchet
b1b2245e28
Fix HTTPS in links 2019-08-08 19:59:22 -07:00
Matthias Krüger
39cdea6df4
Update README.md (fix typo)
Co-Authored-By: Philipp Hansch <dev@phansch.net>
2019-08-07 21:07:35 +02:00
Matthias Krüger
8dde4e5806 README: mention that cargo fix has experimental support for applying some clippy lint suggestions via "cargo fix -Z unstable-options --clippy" 2019-08-07 16:27:08 +02:00
Alex Touchet
4b2825cd3f
Update Readme 2019-08-06 13:09:26 -07:00
flip1995
a922f800af
Run update_lints and fmt 2019-08-05 13:24:31 +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
Darth-Revan
0513202d25
Implement lint for inherent to_string() method. 2019-07-17 08:58:32 +02:00
Matthias Krüger
1bd081c600 readme: fix urls in the license 2019-07-02 20:06:18 +02:00