Commit Graph

39 Commits

Author SHA1 Message Date
Philipp Hansch 745a619657
Fix dogfood 2018-11-05 07:18:47 +01:00
Philipp Krones 5b24f23020
Update println! formatting
Co-Authored-By: phansch <dev@phansch.net>
2018-11-05 07:18:47 +01:00
Philipp Hansch f6194f33d2
Fix false positive in check mode caused by `gen_deprecated`
`gen_deprecated` should never have created the string with linebreaks.

Using a single string broke the check because the changed lines were
different.
2018-11-05 07:18:47 +01:00
Philipp Hansch 90f31e21ab
RIIR update lints: Add check mode (update_lints.py rewrite complete)
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this

* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error

`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.

🏁
2018-11-05 07:18:47 +01:00
bors[bot] a07c271559 Merge #3399
3399: RIIR update lints: Generate modules section and lint group sections r=flip1995 a=phansch

This adds the last missing parts of the generating code.

cc #2882

Co-authored-by: Philipp Hansch <dev@phansch.net>
2018-11-03 19:11:35 +00:00
Philipp Hansch facfb5a7a9
Fix typo 2018-11-03 18:48:39 +01:00
Philipp Hansch cca50701d9
Improve clippy_dev help text 2018-11-03 13:43:35 +01:00
Philipp Hansch 4f38538d75
RIIR update lints: Generate lint group registrations 2018-11-03 13:43:35 +01:00
Philipp Hansch 6e3320c7ef
Test clippy_dev on CI and fix test 2018-11-03 10:58:45 +01:00
Philipp Hansch 5fc25d30e2
RIIR update lints: Generate modules section 2018-11-03 09:09:34 +01:00
Matthias Krüger df7cff31dc clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172
2018-11-02 12:16:43 +01:00
Philipp Hansch 7e027217f1
Fix dogfood and pedantic lints 2018-10-31 21:54:30 +01:00
Philipp Hansch 64bd658516
RIIR update lints: Generate deprecated lints
The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.
2018-10-31 08:03:50 +01:00
Philipp Hansch 9f3ac4e5a3
RIIR update_lints: Update changelog links
This now also updates the link list at the bottom of the changelog.
2018-10-17 08:18:05 +02:00
Philipp Hansch 05ffc2d057
Fix dogfood
`expect_fun_call` causes a false-positive, so I disabled it for now.
2018-10-16 20:58:00 +02:00
Philipp Hansch 956987f43e
RIIR update_lints: Replace lint count in README.md
This allows the usage of `util/dev update_lints` which will write the
new lint_count to the `README.md`.
2018-10-16 08:14:32 +02:00
Philipp Hansch af441b5b07
Rename `active_lints` to `usable_lints`
Because now `usable_lints` will also exclude internal lints.
2018-10-16 08:09:32 +02:00
Philipp Hansch b5dd8f17d1
Add comment on WalkDir vs. fs::read_dir 2018-10-15 21:10:22 +02:00
Philipp Hansch b61ca63c5e
sort_by -> sort_by_key 2018-10-15 21:02:38 +02:00
Philipp Hansch fb830c53db
Some more documentation for clippy_dev 2018-10-15 20:47:19 +02:00
Philipp Hansch 7da97a94df
Use `WalkDir` to also gather from subdirectories
`fs::read_dir` does not recurse into subdirectories.
2018-10-15 20:44:22 +02:00
Oliver Scherer b8654eaa6c Stabilize tool lints 2018-10-11 12:16:22 +02:00
Philipp Hansch 759ceb9840
Use `impl Iterator` in arg position in clippy_dev
Small refactoring pulled out of work on #3266.
This should make the methods a bit more flexible.
2018-10-11 08:34:51 +02:00
Manish Goregaokar e9c025ea70 Add license header to Rust files 2018-10-06 09:43:08 -07:00
Matthias Krüger 91f7e22edf remove cargo edition 2018 feature gate.
Rust and the cargo used to bootstrap was updated in https://github.com/rust-lang/rust/pull/54601 which now has the 2018 edition stabilized.
2018-09-30 11:12:24 +02:00
Philipp Krones 67d85bc47d
Merge pull request #3224 from matthiaskrgr/clippy_self__use_self
fix some clippy::pedantic warnings found in the codebase.
2018-09-28 15:26:50 +02:00
Matthias Krüger e7b820d626 consistently gitignore all Cargo.lock files 2018-09-27 12:34:16 +02:00
Matthias Krüger 2a31937cc9 fix all clippy::use_self pedantic warnings found in the codebase.
cc #3172
2018-09-26 22:24:18 +02:00
Matthias Krüger f2ecee3638 clippy_dev: port to edition 2018 2018-09-23 14:44:06 +02:00
flip1995 e28440d2e0
Change Hash{Map, Set} to FxHash{Map, Set} 2018-09-12 01:34:52 +02:00
Philipp Hansch 3bdc691a91
Pass by ref instead of value 2018-09-06 08:19:09 +02:00
Philipp Hansch de36d42e80
More refactoring 2018-09-06 07:15:31 +02:00
Philipp Hansch 20836d3003
Remove duplicated .gitignore 2018-09-05 13:35:57 +02:00
Philipp Hansch 79bec036f8
Return impl Iterator instead of Vec<Lint>
This makes the API of `lib.rs` a bit more flexible.
2018-09-05 13:34:28 +02:00
Philipp Hansch 586ef4ed72
Refactor to use into_group_map from Itertools 2018-09-03 22:18:53 +02:00
Philipp Hansch 78d358b861
s/direntry/dir_entry 2018-09-03 22:18:53 +02:00
Philipp Hansch 70312430dd
Use insignificant whitespace mode for nice regex 2018-09-03 22:18:53 +02:00
Philipp Hansch 502357df65
cargo update in clippy_dev 2018-09-03 22:18:53 +02:00
Philipp Hansch 35f100b4f9
update_lints rewrite: Add structure and --print-only 2018-09-03 22:18:51 +02:00