You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clippy_lints/src/tests_outside_test_module.rs
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,11 @@ use rustc_span::{def_id::LocalDefId, Span};
6
6
7
7
declare_clippy_lint!{
8
8
/// ### What it does
9
-
///
10
-
/// Triggers when a testing function (marked with the `#[test]` attribute) isn't inside a testing module (marked with `#[cfg(test)]`).
11
-
///
9
+
/// Triggers when a testing function (marked with the `#[test]` attribute) isn't inside a testing module
10
+
/// (marked with `#[cfg(test)]`).
12
11
/// ### Why is this bad?
13
-
///
14
-
/// The idiomatic (and more performant) way of writing tests is inside a testing module (flagged with `#[cfg(test)]`), having test functions outside of this module is confusing and may lead to them being "hidden".
15
-
///
12
+
/// The idiomatic (and more performant) way of writing tests is inside a testing module (flagged with `#[cfg(test)]`),
13
+
/// having test functions outside of this module is confusing and may lead to them being "hidden".
16
14
/// ### Example
17
15
/// ```rust
18
16
/// #[test]
@@ -39,7 +37,7 @@ declare_clippy_lint! {
39
37
#[clippy::version = "1.70.0"]
40
38
pubTESTS_OUTSIDE_TEST_MODULE,
41
39
restriction,
42
-
"The test function `my_cool_test` is outside the testing module `tests`."
0 commit comments