Commit Graph

146 Commits

Author SHA1 Message Date
Manish Goregaokar
3124d2b8df Rustup to rustc 1.5.0-nightly (fc4d566b4 2015-09-16)
fixes #334
2015-09-17 05:32:29 +05:30
Nathan Weston
f87dd31f30 New lint: loop with explicit counter variable (fixes #159)
Avoiding false positives here turns out to be fairly complicated.
2015-09-15 09:41:25 -04:00
swgillespie
82c524b774 implement empty range lint as described in #330 2015-09-14 17:19:05 -07:00
llogiq
4835372df5 made shadow_unrelated allow, added previous binding span note, fixed #319 2015-09-08 11:50:04 +02:00
Manish Goregaokar
0e658afc1b Fix mut_mut false positive, make Allow (fixes #309) 2015-09-08 02:29:13 +05:30
llogiq
92b04cd75d split wrong_self_convention in pub/default visibility part 2015-09-07 09:17:45 +02:00
llogiq
cd91110ec0 new lint: min_max 2015-09-05 12:46:34 +02:00
llogiq
e11fd49b1c Unicode lints, second attempt: Lint whole strings, help with replacement 2015-09-04 16:18:46 +05:30
Manish Goregaokar
eca185438b Update rust to 0efb9dab8c7c07fa28e9df0eccc5c07ea3c17fbb (HIR+lints, Thu Sep 3 18:59:56 2015 +0530)
fixes #294
2015-09-03 23:12:19 +05:30
Georg Brandl
1007864198 new lint: self conventions for certain method names (fixes #267) 2015-09-01 18:52:48 +02:00
Georg Brandl
88dd38de87 lib: add clippy_pedantic group with all Allow by default lints (fixes #265) 2015-09-01 18:05:28 +02:00
Manish Goregaokar
d3da9f6c81 Merge branch 'pr-260'
Conflicts:
	src/lib.rs
2015-08-31 15:06:53 +05:30
Georg Brandl
03abe275b2 new lint: unnecessary patterns (x@_ -> x) 2015-08-30 19:02:30 +02:00
Tim Neumann
ef0c933550 add precedence_negative_literal lint 2015-08-30 17:34:48 +02:00
Georg Brandl
16df79a054 new lint: using collect() to just exhaust an iterator
Should use a for loop instead.
2015-08-30 13:10:59 +02:00
Georg Brandl
b72ef5a173 new lint: loop-match-break, which could be while-let (fixes #118) 2015-08-30 12:40:39 +02:00
Manish Goregaokar
193e71be61 Merge branch 'pr-228'
Conflicts:
	README.md
	src/methods.rs
2015-08-27 11:09:40 +05:30
llogiq
5225feceaa shadowing detection 2015-08-25 13:40:26 +02:00
Georg Brandl
56e8db476c new lint: inherent methods that should be trait impls (fixes #218) 2015-08-25 11:10:42 +02:00
llogiq
209e6981a3 shadowing detection 2015-08-24 16:59:02 +02:00
R.Chavignat
e80f2470b7 Merge branch 'master' into cast_iusize_improvements 2015-08-23 00:08:16 +02:00
R.Chavignat
79ef13592e Completed the implementation of *size handling.
Added some more cases to the test, and implemented a new lint,
cast_possible_wrap, triggered when casting from an unsigned type to a
signed type of the same size.
2015-08-22 23:49:03 +02:00
Georg Brandl
017dac2301 new lint: using &Ref patterns instead of matching on *expr (fixes #187) 2015-08-22 14:34:39 +02:00
Georg Brandl
5403e82681 matches: new module, move single_match lint there 2015-08-22 14:34:39 +02:00
Georg Brandl
630bb76f96 new lint: type complexity (fixes #93)
Still very naive, but it's a start.
2015-08-22 08:57:11 +02:00
R.Chavignat
ad0bc66402 Added support for isize/usize in the CastPass lint pass.
Extracted the match that determines an integer types's size in a
utility function and implemented support for usize/isize.
Added a needed feature to the crate root.
Added some tests to cover those cases, and a test I previously forgot.
Silenced two errors signaled by dogfood.sh in unicode.rs.
2015-08-21 03:03:37 +02:00
R.Chavignat
dbc9b7f46e Reworked the error messages for more heplfulness.
Renamed the cast_possible_overflow lint to cast_possible_truncation,
and updated the error message, readme and crate root accordingly.
Added some more information to the message for the cast_precision_loss
lint.
Updated the test case to reflect changes.
2015-08-20 22:44:40 +02:00
R.Chavignat
93d9249f76 Moved allow(unknown_lints) to crate level. 2015-08-20 14:25:08 +02:00
R.Chavignat
993239d33a Initial implementation of lossy cast lints.
Introduces 3 lints :
  cast_possible_overflow
  cast_precision_loss
  cast_sign_loss
Add a compile-test test case.
Fix errors spotted by dogfood script.
2015-08-20 01:04:06 +02:00
Georg Brandl
8f4499f3ae new lint: comparing unit types (fixes #201) 2015-08-19 08:11:00 +02:00
Manish Goregaokar
4f1fcd4d5b Merge pull request #184 from Manishearth/identity_op
Identity op now uses const folding, no longer follows const bindings
2015-08-17 14:35:45 +05:30
Georg Brandl
e9a41e2374 new lint: lint when iterating over any Iterator::next() result (fixes #182) 2015-08-17 07:28:40 +02:00
llogiq
c4b07ead17 Merge pull request #179 from nweston/step-by-zero
New lint: Range::step_by(0) (fixes #95)
2015-08-16 20:12:52 +02:00
Nathan Weston
23a38c4170 New lint: Range::step_by(0) (fixes #95)
Uses type information so it can detect non-literal ranges as well
(Range or RangeFrom -- the other range types don't have step_by).
2015-08-16 12:58:54 -04:00
Georg Brandl
64954283c1 add some imports to guard against crate moves 2015-08-16 09:03:06 +02:00
Georg Brandl
47b605304d all: organize imports
* remove unused imports
* separate external and internal imports
* consistent import of rustc::lint
* move #[allow(unused_imports)] to local impl
2015-08-16 08:55:34 +02:00
llogiq
f23af0cfd5 changed const to consts to avoid keyword, added test, fixed a lot of bugs 2015-08-14 17:14:54 +02:00
Manish Goregaokar
83487c060f Add trim_multiline utility (fixes #139) 2015-08-13 23:18:33 +05:30
Manish Goregaokar
5eab397e7c Some fixes from dogfooding clippy 2015-08-13 21:45:41 +05:30
Georg Brandl
9578403638 new lint: looping over x.iter() or x.iter_mut() (fixes #157) 2015-08-13 16:31:16 +02:00
Manish Goregaokar
1d64553bc6 Merge branch 'pr-152'
Conflicts:
	README.md
	src/lib.rs
	src/strings.rs
2015-08-13 18:38:08 +05:30
llogiq
9e786d3956 added string_add to clippy lint group 2015-08-13 11:36:39 +02:00
llogiq
f9e851e212 pulled strings passes together, added more tests 2015-08-13 11:36:39 +02:00
llogiq
0b08e9e83e added string_add lint and fixed string_add_assign + test 2015-08-13 11:36:39 +02:00
Georg Brandl
ea0cf2a296 update script: also generate lint list in lib.rs 2015-08-13 11:34:51 +02:00
Georg Brandl
2c2716f045 all: DRY for lint descriptions
* use the rustc style for lint descriptions
* add a script to parse all lint descriptions
  and put the generated table into README
2015-08-13 11:14:05 +02:00
Manish Goregaokar
510ea0c5e5 Merge branch 'pr-140'
Conflicts:
	src/lib.rs
2015-08-13 12:52:14 +05:30
Georg Brandl
b349f9e88d new lint for needless lifetimes (fixes #115) 2015-08-13 06:35:40 +02:00
Georg Brandl
f6090909d3 new lint: using for i in 0..x { .. vec[i] .. } instead of iterator (fixes #3) 2015-08-13 06:34:08 +02:00
Georg Brandl
3044d3d633 unicode: add lint against non-ascii chars in literals (Allow by default), #85 2015-08-12 20:36:35 +02:00
Manish Goregaokar
c58f803511 Merge branch 'pr-138'
Conflicts:
	src/lib.rs
2015-08-12 21:22:01 +05:30
Georg Brandl
4074c1f968 methods: lint against String.to_string (fixes #100) 2015-08-12 17:03:13 +02:00
Georg Brandl
225969e8a3 methods: move misc.StrToStringPass to MethodsPass 2015-08-12 13:58:55 +02:00
Georg Brandl
e8fed074cf new lint: warn if let-binding has unit value (fixes #74) 2015-08-12 13:21:07 +02:00
Georg Brandl
6d5f9478b2 utils: implement if_let_chain macro as suggested by isHavvy 2015-08-12 07:48:47 +02:00
Georg Brandl
02c0cafa14 move NeedlessReturn pass out to its own module and rename to ReturnPass 2015-08-11 22:06:59 +02:00
Georg Brandl
2bcc151888 new lint for Option.unwrap() and Result.unwrap()
The latter is set to Allow by default (fixes #24)
2015-08-11 21:19:11 +02:00
Manish Goregaokar
2cb26126d3 Merge branch 'pr-78'
Conflicts:
	src/lib.rs
2015-08-11 23:28:06 +05:30
Georg Brandl
0ff476b529 new lint for unneeded return stmts 2015-08-11 19:05:11 +02:00
Georg Brandl
7b074d3ac7 Remove tabs and trailing whitespace from lib and misc. 2015-08-11 17:02:04 +02:00
llogiq
b393752814 New string_add_assign lint (first part of #121), also formatting & refactoring 2015-08-05 15:10:45 +02:00
llogiq
23caf3cccc first unicode lint: zero_width_space 2015-06-11 11:35:00 +02:00
llogiq
e8ca19da24 fixed modules/visibility 2015-06-01 22:36:56 +02:00
llogiq
7f5891184d merged upstream master 2015-06-01 13:55:55 +02:00
llogiq
4c76465154 Merge pull request #68 from Manishearth/macro_expn
macro expn detection in mut_mut.rs
2015-06-01 07:44:27 +02:00
Matthew Hall
423a9666ca Implements #45 - any number mod 1 will be 0 2015-05-31 13:43:31 +01:00
llogiq
77838d6ba7 New lint for issue
#72
2015-05-30 15:10:19 +02:00
Matthew Hall
7e16822925 Add lint for ifs that could be collapsed
"Collapsible" ifs are ones which contain only a then block, and the then
block consists of an if that only has a then block.
2015-05-29 15:41:25 +01:00
llogiq
0d651c72ff made macro test even simpler, added a few tests 2015-05-26 01:45:15 +02:00
llogiq
4292dc77a7 new lint: cmp_owned 2015-05-21 14:51:43 +02:00
llogiq
e8ca3c6eae new lints len_zero and len_without_is_empty 2015-05-20 08:52:19 +02:00
llogiq
96bfade4f1 New lint: mut_mut (closes issue #9) 2015-05-18 09:02:24 +02:00
llogiq
edf747ab76 new lint: identity_op, refactored bit_masks a bit 2015-05-15 18:46:43 +02:00
llogiq
6bec4f35df Added 'ineffective bit mask' lint 2015-05-15 14:09:29 +02:00
Manish Goregaokar
2447e1d5be Add eta reduction (fixes #29) 2015-05-10 11:49:08 +05:30
llogiq
17bcf0e865 New lint: precedence, see issue #41 2015-05-06 12:59:08 +02:00
llogiq
ac151bb1f0 Added new 'float_cmp' lint (see issue #46) 2015-05-06 10:01:49 +02:00
llogiq
0936e0617a new lint to check for doomed comparisons to NAN 2015-05-04 14:11:15 +02:00
llogiq
2cb84b9d15 New lint: approx_const 2015-05-04 12:01:34 +02:00
llogiq
8d2328d9a5 Added &String matching and renamed to vec_ptr_arg to ptr_arg, also added README section 2015-05-04 08:15:24 +02:00
llogiq
07adeee6e9 Added check for zero bitmask and uncommon directions, wrong comment in needless_bool corrected, added new lint vec_ptr_arg + test 2015-05-04 07:20:34 +02:00
llogiq
53fa76dff9 new lint: needless_bool (TODO: The warnings could give more specific directions) 2015-05-02 00:35:49 +02:00
llogiq
441b55b328 Added eq_op and bad_bit_mask from the extra_lints project (mostly plain copy, need to refactor to integrate better) 2015-04-30 11:48:43 +02:00
Manish Goregaokar
2935c31692 rustup (rustc 1.0.0-nightly (00978a987 2015-04-18) (built 2015-04-19)) 2015-04-20 16:18:35 +05:30
Manish Goregaokar
426a3ee1e7 Rustup 2015-03-02 16:13:44 +05:30
Manish Goregaokar
67701e0062 -warnings 2015-02-19 05:03:27 +05:30
Manish Goregaokar
f428b18c47 rustup (fixes #28) 2015-01-10 11:56:58 +05:30
Manish Goregaokar
e57396bc52 Remove namespacing 2014-12-26 05:24:44 +05:30
Manish Goregaokar
ccf996c348 clippy lint group 2014-12-26 05:12:05 +05:30
Jonathan Castello
1431fc04af Implement a lint to check for args like fn foo(ref x: u8), as the ref is effectively ignored by rustc. 2014-12-24 15:20:30 -08:00
Manish Goregaokar
2703038f93 Add seanmonstar's StrToString lint 2014-12-16 00:46:39 +05:30
Manish Goregaokar
98d88e7eb4 rm if_let gate 2014-12-11 03:04:58 +05:30
Manish Goregaokar
ca7ad5fa80 Add DList lint (fixes #2) 2014-11-20 12:37:37 +05:30
Manish Goregaokar
542bfe3570 +match_if_let 2014-11-20 00:18:31 +05:30
Manish Goregaokar
92f13d8231 boxvec 2014-11-19 14:27:34 +05:30
Manish Goregaokar
37226273a7 init cargo 2014-11-19 13:23:40 +05:30