Skip to content

Commit bb4af19

Browse files
committed
Move empty_line_after_outer_attribute to nursery
From the clippy side it's difficult to detect empty lines between an attributes and the following item because empty lines and comments are not part of the AST. The parsing currently works for basic cases but is not perfect and can cause false positives. Maybe libsyntax 2.0 will fix some of the problems around attributes but comments will probably be never part of the AST so we would still have to do some manual parsing.
1 parent b7929ca commit bb4af19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clippy_lints/src/attrs.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ declare_clippy_lint! {
8585
/// If it was meant to be an outer attribute, then the following item
8686
/// should not be separated by empty lines.
8787
///
88-
/// **Known problems:** None
88+
/// **Known problems:** Can cause false positives.
89+
///
90+
/// From the clippy side it's difficult to detect empty lines between an attributes and the
91+
/// following item because empty lines and comments are not part of the AST. The parsing
92+
/// currently works for basic cases but is not perfect.
8993
///
9094
/// **Example:**
9195
/// ```rust
@@ -105,7 +109,7 @@ declare_clippy_lint! {
105109
/// ```
106110
declare_clippy_lint! {
107111
pub EMPTY_LINE_AFTER_OUTER_ATTR,
108-
style,
112+
nursery,
109113
"empty line after outer attribute"
110114
}
111115

0 commit comments

Comments
 (0)