improved README, added lint counter
This commit is contained in:
parent
45533bb03e
commit
380e41a914
13
README.md
13
README.md
@ -4,7 +4,7 @@
|
|||||||
A collection of lints that give helpful tips to newbies and catch oversights.
|
A collection of lints that give helpful tips to newbies and catch oversights.
|
||||||
|
|
||||||
##Lints
|
##Lints
|
||||||
Lints included in this crate:
|
There are 45 lints included in this crate:
|
||||||
|
|
||||||
name | default | meaning
|
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)
|
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
|
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!
|
More to come, please [file an issue](https://github.com/Manishearth/rust-clippy/issues) if you have ideas!
|
||||||
|
|
||||||
##Usage
|
##Usage
|
||||||
@ -69,8 +62,8 @@ Compiler plugins are highly unstable and will only work with a nightly Rust for
|
|||||||
|
|
||||||
Add in your `Cargo.toml`:
|
Add in your `Cargo.toml`:
|
||||||
```toml
|
```toml
|
||||||
[dependencies.clippy]
|
[dependencies]
|
||||||
git = "https://github.com/Manishearth/rust-clippy"
|
clippy = "*"
|
||||||
```
|
```
|
||||||
|
|
||||||
Sample `main.rs`:
|
Sample `main.rs`:
|
||||||
|
@ -113,6 +113,11 @@ def main(print_only=False, check=False):
|
|||||||
lambda: gen_table(lints),
|
lambda: gen_table(lints),
|
||||||
write_back=not check)
|
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
|
# same for "clippy" lint collection
|
||||||
changed |= replace_region('src/lib.rs', r'reg.register_lint_group\("clippy"', r'\]\);',
|
changed |= replace_region('src/lib.rs', r'reg.register_lint_group\("clippy"', r'\]\);',
|
||||||
lambda: gen_group(lints), replace_start=False,
|
lambda: gen_group(lints), replace_start=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user