mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
wiki -> docs
This commit is contained in:
parent
c64073b2f5
commit
ff91c6359a
@ -308,7 +308,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## 0.0.74 — 2016-06-07
|
||||
* Fix bug with `cargo-clippy` JSON parsing
|
||||
* Add the `CLIPPY_DISABLE_WIKI_LINKS` environment variable to deactivate the
|
||||
* Add the `CLIPPY_DISABLE_DOCS_LINKS` environment variable to deactivate the
|
||||
“for further information visit *wiki-link*” message.
|
||||
|
||||
## 0.0.73 — 2016-06-05
|
||||
|
@ -152,7 +152,7 @@ You can also specify the path to the configuration file with:
|
||||
```
|
||||
|
||||
To deactivate the “for further information visit *wiki-link*” message you can
|
||||
define the `CLIPPY_DISABLE_WIKI_LINKS` environment variable.
|
||||
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
|
||||
|
||||
### Allowing/denying lints
|
||||
|
||||
|
@ -563,8 +563,8 @@ impl<'a> Drop for DiagnosticWrapper<'a> {
|
||||
}
|
||||
|
||||
impl<'a> DiagnosticWrapper<'a> {
|
||||
fn wiki_link(&mut self, lint: &'static Lint) {
|
||||
if env::var("CLIPPY_DISABLE_WIKI_LINKS").is_err() {
|
||||
fn docs_link(&mut self, lint: &'static Lint) {
|
||||
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
|
||||
self.0.help(&format!(
|
||||
"for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#{}",
|
||||
lint.name_lower()
|
||||
@ -574,7 +574,7 @@ impl<'a> DiagnosticWrapper<'a> {
|
||||
}
|
||||
|
||||
pub fn span_lint<'a, T: LintContext<'a>>(cx: &T, lint: &'static Lint, sp: Span, msg: &str) {
|
||||
DiagnosticWrapper(cx.struct_span_lint(lint, sp, msg)).wiki_link(lint);
|
||||
DiagnosticWrapper(cx.struct_span_lint(lint, sp, msg)).docs_link(lint);
|
||||
}
|
||||
|
||||
pub fn span_help_and_lint<'a, 'tcx: 'a, T: LintContext<'tcx>>(
|
||||
@ -586,7 +586,7 @@ pub fn span_help_and_lint<'a, 'tcx: 'a, T: LintContext<'tcx>>(
|
||||
) {
|
||||
let mut db = DiagnosticWrapper(cx.struct_span_lint(lint, span, msg));
|
||||
db.0.help(help);
|
||||
db.wiki_link(lint);
|
||||
db.docs_link(lint);
|
||||
}
|
||||
|
||||
pub fn span_note_and_lint<'a, 'tcx: 'a, T: LintContext<'tcx>>(
|
||||
@ -603,7 +603,7 @@ pub fn span_note_and_lint<'a, 'tcx: 'a, T: LintContext<'tcx>>(
|
||||
} else {
|
||||
db.0.span_note(note_span, note);
|
||||
}
|
||||
db.wiki_link(lint);
|
||||
db.docs_link(lint);
|
||||
}
|
||||
|
||||
pub fn span_lint_and_then<'a, 'tcx: 'a, T: LintContext<'tcx>, F>(
|
||||
@ -617,7 +617,7 @@ pub fn span_lint_and_then<'a, 'tcx: 'a, T: LintContext<'tcx>, F>(
|
||||
{
|
||||
let mut db = DiagnosticWrapper(cx.struct_span_lint(lint, sp, msg));
|
||||
f(&mut db.0);
|
||||
db.wiki_link(lint);
|
||||
db.docs_link(lint);
|
||||
}
|
||||
|
||||
pub fn span_lint_and_sugg<'a, 'tcx: 'a, T: LintContext<'tcx>>(
|
||||
|
@ -21,7 +21,7 @@ fn run_mode(dir: &'static str, mode: &'static str) {
|
||||
}
|
||||
|
||||
fn prepare_env() {
|
||||
set_var("CLIPPY_DISABLE_WIKI_LINKS", "true");
|
||||
set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
4
util/update_lints.py
Executable file → Normal file
4
util/update_lints.py
Executable file → Normal file
@ -29,7 +29,7 @@ declare_restriction_lint_re = re.compile(r'''
|
||||
|
||||
nl_escape_re = re.compile(r'\\\n\s*')
|
||||
|
||||
wiki_link = 'https://rust-lang-nursery.github.io/rust-clippy/master/index.html'
|
||||
docs_link = 'https://rust-lang-nursery.github.io/rust-clippy/master/index.html'
|
||||
|
||||
|
||||
def collect(lints, deprecated_lints, restriction_lints, fn):
|
||||
@ -169,7 +169,7 @@ def main(print_only=False, check=False):
|
||||
'CHANGELOG.md',
|
||||
"<!-- begin autogenerated links to wiki -->",
|
||||
"<!-- end autogenerated links to wiki -->",
|
||||
lambda: ["[`{0}`]: {1}#{0}\n".format(l[1], wiki_link) for l in
|
||||
lambda: ["[`{0}`]: {1}#{0}\n".format(l[1], docs_link) for l in
|
||||
sorted(lints + restriction_lints + deprecated_lints,
|
||||
key=lambda l: l[1])],
|
||||
replace_start=False, write_back=not check)
|
||||
|
Loading…
Reference in New Issue
Block a user