Commit graph

119 commits

Author SHA1 Message Date
llogiq
f9e851e212 pulled strings passes together, added more tests 2015-08-13 11:36:39 +02:00
llogiq
52c0cf5a9d fixed formatting 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
Manish Goregaokar
8dfa02938d Merge branch 'pr-149' 2015-08-13 13:00:29 +05:30
Manish Goregaokar
510ea0c5e5 Merge branch 'pr-140'
Conflicts:
	src/lib.rs
2015-08-13 12:52:14 +05:30
Georg Brandl
a67e55f3f0 lint messages: remove trailing period
Since lint messages often are suffixed by ", #[warn(xxx)] on by default"
this trailing period produces an ugly clash with the comma.
2015-08-13 08:15:42 +02:00
Georg Brandl
7aee04878f tests: use fragment of lint text for error checking
(Did not touch strings.rs, which is fixed by @llogiq's PR)
2015-08-13 08:12:07 +02:00
Georg Brandl
2f7693094f lifetimes lint: include support for lifetimes as generic params 2015-08-13 06:43:25 +02:00
Georg Brandl
6603299f3f lifetimes lint: straighten some code, add a few comments 2015-08-13 06:35:40 +02:00
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
4400aaed43 if_let_chain: allow mixing in normal ifs as well 2015-08-13 06:32:24 +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
Manish Goregaokar
ca3b4330f1 Use snippet, pprust methods expand AST 2015-08-12 15:19:57 +05:30
Manish Goregaokar
0481d04d6f Merge pull request #137 from birkenfeld/collapsible_if_fix
collapsible_if: do not show Debug display of expression
2015-08-12 15:06:24 +05:30
Georg Brandl
7b3299e009 collapsible_if: do not show Debug display of expression
Instead, pretty-print the inner block and use the same style as for
the "single match => if let" lint.
2015-08-12 11:00:08 +02:00
Georg Brandl
b831bd1d1d len_zero: display full suggested expr in message 2015-08-12 10:53:14 +02:00
Georg Brandl
bcd95aec1c all: make style of lint messages consistent
* start first sentence lowercased
* use backticks to delimit code snippets
* use "this is wrong. Consider doing X." consistently
2015-08-12 10:47:09 +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
f6dc48fe3a new lint for "let x = EXPR; x" at the end of functions (fixes #104) 2015-08-11 22:25: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
4350dab761 types: remove almost duplicate helper function
I guess "help" instead of "note" is fine as well, so we can
get rid of the extra function.
2015-08-11 21:25:51 +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
Georg Brandl
cf96042c65 move walk_ty() to utils module and rename to walk_ptrs_ty 2015-08-11 21:16:10 +02:00
Manish Goregaokar
6bc69fa342 Merge pull request #127 from birkenfeld/better-helptext-if-let
better help text for "match -> if let" lint
2015-08-12 00:44:51 +05:30
Georg Brandl
e318328d63 all: whitespace cleanup
* 4-space indentation
* no trailing whitespace
* no tabs
2015-08-11 20:22:50 +02:00
Manish Goregaokar
2cb26126d3 Merge branch 'pr-78'
Conflicts:
	src/lib.rs
2015-08-11 23:28:06 +05:30
Manish Goregaokar
efdbfe0d31 nit 2015-08-11 23:11:20 +05:30
Georg Brandl
cab9905705 better help text for "match -> if let" lint
Implements the suggestion from #87.

Changes span_help_and_lint(), which is only used for this lint,
to use fileline_help() instead of span_help() to avoid printing
the span twice.

Also adds complete suggested new code. I had to distinguish
between blocks, which need no additionals braces, and other exprs.
2015-08-11 19:26:51 +02:00
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
f0eb36c2af added parent method, also changed match-if-let note to help 2015-08-11 15:07:21 +02:00
Manish Goregaokar
228f06a960 Upgrade Rust to rustc 1.4.0-nightly (a5d33d891 2015-08-08) (fixes #123) 2015-08-09 22:16:39 +05:30
llogiq
27f8fa75e1 whitespace 2015-08-07 09:33:54 +02:00
llogiq
b393752814 New string_add_assign lint (first part of #121), also formatting & refactoring 2015-08-05 15:10:45 +02:00
Manish Goregaokar
6ebb9b1551 Fix crash with idents from different contexts 2015-08-02 20:59:12 +05:30
Manish Goregaokar
de5ccdfab6 Upgrade to rustc 1.3.0-nightly (4d52d7c85 2015-07-30) 2015-07-31 12:00:06 +05:30
Manish Goregaokar
0e8e8cfc9b Basic framework for structured logging 2015-07-27 00:39:09 +05:30
llogiq
251c5cfffd rustup, also first time clippy was used on itself, which led to a small refactoring 2015-07-16 08:53:02 +02:00
llogiq
a244750939 new 'snippet' utils method, used where applicable 2015-07-09 17:02:21 +02:00
Zachary Bush
038d540ab1 Fix build for rustc 1.3.0-nightly (bf3c979ec 2015-06-30) 2015-07-01 09:21:46 -07:00
Zachary Bush
0ffbdf2f8a Fix build with rustc 1.2.0-nightly (20d23d8e5 2015-06-18)
In https://github.com/rust-lang/rust/pull/26347, MacroFormat was
renamed to ExpnFormat. MacroFormat wasn't being used in
src/mut_mut.rs, so I removed it.
2015-06-18 15:30:51 -07:00
llogiq
9a3dcaabe8 fixed renaming of rustc::middle::ty enums 2015-06-15 13:27:24 +02:00
llogiq
0e5b62c8d8 also included String::from in cmp_owned and fixed deprecation in test 2015-06-11 16:53:23 +02:00
llogiq
23caf3cccc first unicode lint: zero_width_space 2015-06-11 11:35:00 +02:00
llogiq
19e718966d forgot to update utils, there are a few new s 2015-06-07 12:05:14 +02:00