Commit Graph

497 Commits

Author SHA1 Message Date
Philipp Krones
a7bfac7353 Update README.md
Co-Authored-By: sunjay <sunjay@users.noreply.github.com>
2019-04-10 22:17:17 -04:00
Sunjay Varma
5fab7ec002
Mention that -D warnings will deny ALL warnings, not just clippy warnings 2019-04-08 13:51:54 -04:00
Félix Fischer
069957a8ad Add TransmutingNull Lint
* Late Lint pass, catches:
  * One liner: 0 -> null -> transmute
  * One liner: std:null() -> transmute
  * Const (which resolves to null) -> transmute
* UI Test case for Lint
* Updated test for issue 3849, because now the lint that code generated is in Clippy.
* Expanded `const.rs` miri-based Constant Folding code, to cover
  raw pointers
2019-04-02 11:39:43 -03:00
bors
920112d723 Auto merge of #3824 - phansch:adding_lints, r=phansch
Add lint writing documentation

[Rendered](https://github.com/phansch/rust-clippy/blob/adding_lints/doc/adding_lints.md)

This adds a new documentation page that explains how to write Clippy
lints. It guides the reader through creating a `foo` function lint.

I plan to iterate a bit more on the prose of some sections, but I think the
general structure is fine now, so I'm looking forward to feedback =)

One thing I'm not sure about: I felt like this is too big for CONTRIBUTING.md
so I put it into a new `doc/` directory. I can imagine having more
documentation in the future, so we might even want to create a book using
mdbook instead? Or should everything go into CONTRIBUTING.md?

Further things left to do:

- [x] Link from CONTRIBUTING.md
- [x] Remove things covered in this guide from CONTRIBUTING.md
- [x] Section about `clippy::author` attribute
- [x] Run `remark-lint` on CI over the `doc` directory and fix things
2019-03-09 15:05:38 +00:00
Félix Fischer
ddc718087f Renamed: Cyclomatic Complexity -> Cognitive Complexity
* Ran automatic naming update

* Formalized rename of `cyclomatic_complexity` to `cognitive_complexity`
** Added the rename to `lib.rs`
** Added rename test

* Added warning for deprecated key `cyclomatic_complexity_threshold` and tests for it

* Added deprecation status for Clippy's builtin attribute

* Updated tests for new builtin attribute renaming
2019-03-06 10:07:38 -03:00
Philipp Hansch
0da3521eb6
Reword 'Setup' a bit 2019-03-03 15:03:25 +01:00
Wilfred Hughes
4f8c1d100d
Fix broken markdown in README.md 2019-02-23 00:20:57 +00:00
Manish Goregaokar
50f1dd6af8 Clarify lint groups in readme 2019-02-22 13:29:33 +05:30
Michael Howell
cb1c0b6849 Update README and CHANGELOG 2019-02-17 22:53:08 -07:00
rhysd
83d620b824 run util/dev update_lints and cargo fmt --all 2019-02-03 21:56:24 +09:00
rhysd
9d130a546f add dbg_macro rule to CHANGELOG.md and update count in README 2019-02-01 11:32:22 +09:00
Alex Hamilton
7fa50fb3fe wildcard_match_arm: Update lint count. 2019-01-29 15:33:16 -06:00
Philipp Hansch
c3980bf0bc
Add initial version of const_fn lint 2019-01-29 08:19:05 +01:00
A.A.Abroskin
f11d993c0f Merge branch 'master' into add-lints-aseert-checks
* master: (58 commits)
  Rustfmt all the things
  Don't make decisions on values that don't represent the decision
  Improving comments.
  Rustup
  Added rustfix to the test.
  Improve span shortening.
  Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
  Actually check for constants.
  Fixed potential mistakes with nesting. Added tests.
  formatting fix
  Update clippy_lints/src/needless_bool.rs
  formatting fix
  Fixing typo in CONTRIBUTING.md
  Fix breakage due to rust-lang/rust#57651
  needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
  Fix automatic suggestion on `use_self`.
  Remove negative integer literal checks.
  Fix `implicit_return` false positives.
  Run rustfmt
  Fixed breakage due to rust-lang/rust#57489
  ...
2019-01-23 11:36:12 +03:00
Manas Karekar
a8157d2de7
Update Readme
Move instruction to the correct step for installing Clippy.
2019-01-12 20:24:52 -05:00
Manas Karekar
09323d7426
Update Readme for (arguably) better readability
Move final instruction to run clippy into a third step in the Readme so it's easier to spot at a quick glance.
2019-01-12 19:42:36 -05:00
bors
91ef4e3ae7 Auto merge of #3646 - matthiaskrgr:travis, r=phansch
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
2019-01-11 01:11:34 +00:00
A.A.Abroskin
58abdb5918 run ./util/dev update_lints 2019-01-09 21:31:29 +03:00
Matthias Krüger
144f01f381 readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com 2019-01-09 00:50:32 +01: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
Konrad Borowski
34daf09aa4 cast_ref_to_mut lint 2019-01-07 14:37:28 +01:00
Matthias Krüger
3389a68834 Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch"
This reverts commit 0a6593cd1b, reversing
changes made to 5277a1fb6c.

This hopefully fixes #3628
2019-01-05 10:19:04 +01:00
bors
0a6593cd1b Auto merge of #3603 - xfix:random-state-lint, r=phansch
random_state lint
2019-01-03 02:00:46 +00:00
bors
61bfb39e3f Auto merge of #3593 - mikerite:readme-syspath-2, r=phansch
Update README local run command to remove syspath

Since #3257 was reverted, including the sysroot in RUSTFLAGS gives the
error `Option 'sysroot' given more than once`
2018-12-30 11:45:38 +00:00
Konrad Borowski
a6c4eaa93c random_state lint 2018-12-30 02:45:34 +01:00
Michael Wright
f4cf82ce7d Update README local run command to remove syspath
Since #3257 was reverted, including the sysroot in RUSTFLAGS gives the
error `Option 'sysroot' given more than once`
2018-12-29 07:59:33 +02:00
Russell Greene
d127aed737 Merge new_without_default_derive into new_without_default 2018-12-28 10:57:58 -07:00
bors
d3c747c752 Auto merge of #3569 - phansch:update_contributing, r=flip1995
Change contrib.md hierarchy, link to it from readme

'How Clippy works' and 'How to fix nightly failures' are not exactly part
of 'Writing code'.
2018-12-22 09:18:39 +00:00
Philipp Hansch
cef8f57082
Remove header link 2018-12-22 10:16:52 +01:00
Philipp Hansch
ff634e2350
Change contrib.md hierarchy, link to it from readme
'How Clippy works' and 'How to fix nightly failures' are not exactly part
of 'Writing code'.
2018-12-21 08:11:06 +01:00
Michael Wright
987f260543 Update README local run command to specify syspath 2018-12-19 06:13:43 +02:00
Kampfkarren
e5ea5395b9 Update lint definitions 2018-12-13 09:14:01 -08:00
Philipp Hansch
0c93e4cdb2
s/clippy/Clippy in readme 2018-12-10 22:30:16 +01:00
Philipp Hansch
d4da776ea7
Also add note about using -W clippy::lint_group 2018-12-10 22:22:57 +01:00
Philipp Hansch
04e251f623
readme: tool lints are stable now 2018-12-10 22:04:27 +01:00
Nick Cameron
7220185560
Remove -preview suffix from README 2018-12-06 11:11:50 -05:00
daxpedda
d5d6692288 Added FORCED_RETURN lint. 2018-12-05 01:59:09 +01:00
David Tolnay
e632a1946e
Remove unsafe_vector_initialization lint 2018-12-03 02:48:37 -08:00
Philipp Hansch
93e8c9efc9
Update docs in regards to the merged RFC 2018-11-28 08:11:28 +01:00
Matthias Krüger
2a1c8b1db6 readme: tell how to install clippy on travis from git if it is not shipped with a nightly. 2018-11-26 14:07:21 +01:00
Guillem Nieto
dc35841be4 Update lints 2018-11-25 14:36:04 -08:00
Matthias Krüger
0b8d323304 missed another one in the README 2018-11-22 04:50:00 +01:00
Matthias Krüger
f5929e0797 rust-lang-nursery/rust-clippy => rust-lang/rust-clippy 2018-11-22 04:40:09 +01:00
Yusuf Simonson
866caabb7a Check for common metadata 2018-11-13 08:43:30 -05:00
flip1995
bb4083c412
Run update_lints.py script 2018-11-02 19:50:23 +01:00
kennytm
2d1c9313b0
Added lints into_iter_on_ref and into_iter_on_array. Fix #1565. 2018-11-02 22:53:56 +08:00
flip1995
6819127f1e
run update_lints script 2018-11-02 13:49:10 +01:00
Shotaro Yamada
5285372f68 Run update_lints 2018-10-26 01:16:14 +09:00
HMPerson1
aabf8083bd
Add lint for calling mem::discriminant on a non-enum type 2018-10-24 23:39:54 -04:00
Hidehito Yabuuchi
d334fab4d0 Run util/update_lints.py 2018-10-24 15:00:28 +09:00