Skip to contentSlop Block

require-blank-line-between-top-level-declarations

Warning

Separate multi-line top-level declarations with a blank line. Single-line declarations and imports can stay grouped.

impl AuthenticationQuery {Leave a blank line after this multi-line declaration	fn run() {}}#[derive(Default)]pub struct AuthenticationMutation;
fn first() {Leave a blank line after this multi-line declaration	run();}fn second() {}
// ast-grep-ignore: require-blank-line-between-top-level-declarations-rust

How to fix

Separate a multi-line top-level declaration from the next one with a blank line. Groups of single-line declarations and imports can stay together.

The check reads the file's text because the syntax tree omits blank lines. If the file is missing more than one blank line, the report can land on a neighboring declaration.