Skip to content

Commit

Permalink
Deprecate the wiki and remove the lint list from the README (fixes ru…
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Sep 1, 2017
1 parent 3fe6454 commit c64073b
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 571 deletions.
430 changes: 215 additions & 215 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ Steps to publish a new clippy version
- `git pull`.
- `git tag -s v0.0.X -m "v0.0.X"`.
- `git push --tags`.
- `git clone [email protected]:rust-lang-nursery/rust-clippy.wiki.git ../rust-clippy.wiki`
- `./util/update_wiki.py`
- `cd ../rust-clippy.wiki`
- `git add *`
- `git commit`
- `git push`
213 changes: 1 addition & 212 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl<'a> DiagnosticWrapper<'a> {
fn wiki_link(&mut self, lint: &'static Lint) {
if env::var("CLIPPY_DISABLE_WIKI_LINKS").is_err() {
self.0.help(&format!(
"for further information visit https://github.com/rust-lang-nursery/rust-clippy/wiki#{}",
"for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#{}",
lint.name_lower()
));
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
error: this pattern takes a reference on something that is being de-referenced
--> needless_borrowed_ref.rs:8:34
--> $DIR/needless_borrowed_ref.rs:8:34
|
8 | let _ = v.iter_mut().filter(|&ref a| a.is_empty());
| ^^^^^^ help: try removing the `&ref` part and just keep `a`
| ^^^^^^ help: try removing the `&ref` part and just keep: `a`
|
= note: `-D needless-borrowed-reference` implied by `-D warnings`
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrowed_reference

error: this pattern takes a reference on something that is being de-referenced
--> needless_borrowed_ref.rs:13:17
--> $DIR/needless_borrowed_ref.rs:13:17
|
13 | if let Some(&ref v) = thingy {
| ^^^^^^ help: try removing the `&ref` part and just keep `v`
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrowed_reference
| ^^^^^^ help: try removing the `&ref` part and just keep: `v`

error: this pattern takes a reference on something that is being de-referenced
--> needless_borrowed_ref.rs:42:27
--> $DIR/needless_borrowed_ref.rs:42:27
|
42 | (&Animal::Cat(v), &ref k) | (&ref k, &Animal::Cat(v)) => (), // lifetime mismatch error if there is no '&ref'
| ^^^^^^ help: try removing the `&ref` part and just keep `k`
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrowed_reference
| ^^^^^^ help: try removing the `&ref` part and just keep: `k`

error: this pattern takes a reference on something that is being de-referenced
--> needless_borrowed_ref.rs:42:38
--> $DIR/needless_borrowed_ref.rs:42:38
|
42 | (&Animal::Cat(v), &ref k) | (&ref k, &Animal::Cat(v)) => (), // lifetime mismatch error if there is no '&ref'
| ^^^^^^ help: try removing the `&ref` part and just keep `k`
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrowed_reference

error: aborting due to previous error(s)
| ^^^^^^ help: try removing the `&ref` part and just keep: `k`

error: Could not compile `clippy_tests`.
error: aborting due to 4 previous errors

To learn more, run the command again with --verbose.
25 changes: 2 additions & 23 deletions util/update_lints.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

nl_escape_re = re.compile(r'\\\n\s*')

wiki_link = 'https://github.com/rust-lang-nursery/rust-clippy/wiki'
wiki_link = 'https://rust-lang-nursery.github.io/rust-clippy/master/index.html'


def collect(lints, deprecated_lints, restriction_lints, fn):
Expand Down Expand Up @@ -63,22 +63,6 @@ def collect(lints, deprecated_lints, restriction_lints, fn):
desc.replace('\\"', '"')))


def gen_table(lints, link=None):
"""Write lint table in Markdown format."""
if link:
lints = [(p, '[%s](%s#%s)' % (l, link, l), lvl, d)
for (p, l, lvl, d) in lints]
# first and third column widths
w_name = max(len(l[1]) for l in lints)
w_desc = max(len(l[3]) for l in lints)
# header and underline
yield '%-*s | default | triggers on\n' % (w_name, 'name')
yield '%s-|-%s-|-%s\n' % ('-' * w_name, '-' * 7, '-' * w_desc)
# one table row per lint
for (_, name, default, meaning) in sorted(lints, key=lambda l: l[1]):
yield '%-*s | %-7s | %s\n' % (w_name, name, default, meaning)


def gen_group(lints, levels=None):
"""Write lint group (list of all lints in the form module::NAME)."""
if levels:
Expand Down Expand Up @@ -172,13 +156,8 @@ def main(print_only=False, check=False):
sys.stdout.writelines(gen_table(lints + restriction_lints))
return

# replace table in README.md
# update the lint counter in README.md
changed = replace_region(
'README.md', r'^name +\|', '^$',
lambda: gen_table(lints + restriction_lints, link=wiki_link),
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' %
Expand Down
95 changes: 0 additions & 95 deletions util/update_wiki.py

This file was deleted.

0 comments on commit c64073b

Please sign in to comment.