Skip to content

Commit

Permalink
Move empty_line_after_outer_attribute to nursery
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phansch committed Mar 30, 2018
1 parent b7929ca commit bb4af19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ declare_clippy_lint! {
/// If it was meant to be an outer attribute, then the following item
/// should not be separated by empty lines.
///
/// **Known problems:** None
/// **Known problems:** Can cause false positives.
///
/// 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.
///
/// **Example:**
/// ```rust
Expand All @@ -105,7 +109,7 @@ declare_clippy_lint! {
/// ```
declare_clippy_lint! {
pub EMPTY_LINE_AFTER_OUTER_ATTR,
style,
nursery,
"empty line after outer attribute"
}

Expand Down

0 comments on commit bb4af19

Please sign in to comment.