From 380e41a914133f8e1c527e1f18db835dc4feb3f1 Mon Sep 17 00:00:00 2001 From: llogiq Date: Mon, 24 Aug 2015 16:23:05 +0200 Subject: [PATCH] improved README, added lint counter --- README.md | 13 +++---------- util/update_lints.py | 5 +++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 66881b52290..be7154c8c62 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A collection of lints that give helpful tips to newbies and catch oversights. ##Lints -Lints included in this crate: +There are 45 lints included in this crate: name | default | meaning -------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -54,13 +54,6 @@ type_complexity | warn | usage of very complex types; recommends fac unit_cmp | warn | comparing unit values (which is always `true` or `false`, respectively) zero_width_space | deny | using a zero-width space in a string literal, which is confusing -To use, add the following lines to your Cargo.toml: - -``` -[dependencies] -clippy = "*" -``` - More to come, please [file an issue](https://github.com/Manishearth/rust-clippy/issues) if you have ideas! ##Usage @@ -69,8 +62,8 @@ Compiler plugins are highly unstable and will only work with a nightly Rust for Add in your `Cargo.toml`: ```toml -[dependencies.clippy] -git = "https://github.com/Manishearth/rust-clippy" +[dependencies] +clippy = "*" ``` Sample `main.rs`: diff --git a/util/update_lints.py b/util/update_lints.py index ed26637059f..940899d4ebb 100755 --- a/util/update_lints.py +++ b/util/update_lints.py @@ -113,6 +113,11 @@ def main(print_only=False, check=False): lambda: gen_table(lints), write_back=not check) + changed |= replace_region('README.md', + r'^There are \d+ lints included in this crate:', "", + lambda: ['There are %d lints included in this crate:\n' % len(lints)], + write_back=not check) + # same for "clippy" lint collection changed |= replace_region('src/lib.rs', r'reg.register_lint_group\("clippy"', r'\]\);', lambda: gen_group(lints), replace_start=False,