Skip to content

Commit 73806b7

Browse files
author
Florian Rohm
committed
register new lint "tabs in doc comments" and update readme
1 parent f8f7800 commit 73806b7

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ Released 2018-09-13
12011201
[`suspicious_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map
12021202
[`suspicious_op_assign_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_op_assign_impl
12031203
[`suspicious_unary_op_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_unary_op_formatting
1204+
[`tabs_in_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments
12041205
[`temporary_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_assignment
12051206
[`temporary_cstring_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#temporary_cstring_as_ptr
12061207
[`to_digit_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_digit_is_some

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
88

9-
[There are 333 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
9+
[There are 334 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1010

1111
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
1212

clippy_lints/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ pub mod slow_vector_initialization;
275275
pub mod strings;
276276
pub mod suspicious_trait_impl;
277277
pub mod swap;
278+
pub mod tabs_in_doc_comments;
278279
pub mod temporary_assignment;
279280
pub mod to_digit_is_some;
280281
pub mod trait_bounds;
@@ -717,6 +718,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
717718
&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
718719
&swap::ALMOST_SWAPPED,
719720
&swap::MANUAL_SWAP,
721+
&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS,
720722
&temporary_assignment::TEMPORARY_ASSIGNMENT,
721723
&to_digit_is_some::TO_DIGIT_IS_SOME,
722724
&trait_bounds::TYPE_REPETITION_IN_BOUNDS,
@@ -947,6 +949,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
947949
store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
948950
let enum_variant_name_threshold = conf.enum_variant_name_threshold;
949951
store.register_early_pass(move || box enum_variants::EnumVariantNames::new(enum_variant_name_threshold));
952+
store.register_early_pass(|| box tabs_in_doc_comments::TabsInDocComments);
950953
store.register_late_pass(|| box unused_self::UnusedSelf);
951954
store.register_late_pass(|| box mutable_debug_assertion::DebugAssertWithMutCall);
952955
store.register_late_pass(|| box exit::Exit);
@@ -1244,6 +1247,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
12441247
LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
12451248
LintId::of(&swap::ALMOST_SWAPPED),
12461249
LintId::of(&swap::MANUAL_SWAP),
1250+
LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
12471251
LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
12481252
LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
12491253
LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),
@@ -1371,6 +1375,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
13711375
LintId::of(&returns::NEEDLESS_RETURN),
13721376
LintId::of(&returns::UNUSED_UNIT),
13731377
LintId::of(&strings::STRING_LIT_AS_BYTES),
1378+
LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
13741379
LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
13751380
LintId::of(&try_err::TRY_ERR),
13761381
LintId::of(&types::FN_TO_NUMERIC_CAST),

src/lintlist/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub use lint::Lint;
66
pub use lint::LINT_LEVELS;
77

88
// begin lint list, do not remove this comment, it’s used in `update_lints`
9-
pub const ALL_LINTS: [Lint; 333] = [
9+
pub const ALL_LINTS: [Lint; 334] = [
1010
Lint {
1111
name: "absurd_extreme_comparisons",
1212
group: "correctness",
@@ -1862,6 +1862,13 @@ pub const ALL_LINTS: [Lint; 333] = [
18621862
deprecation: None,
18631863
module: "formatting",
18641864
},
1865+
Lint {
1866+
name: "tabs_in_doc_comments",
1867+
group: "style",
1868+
desc: "using tabs in doc comments is not recommended",
1869+
deprecation: None,
1870+
module: "tabs_in_doc_comments",
1871+
},
18651872
Lint {
18661873
name: "temporary_assignment",
18671874
group: "complexity",

0 commit comments

Comments
 (0)