Skip to content

Files

Latest commit

 

History

History
62 lines (39 loc) · 949 Bytes

comment_spacing.md

File metadata and controls

62 lines (39 loc) · 949 Bytes

Pattern: Malformed comment spacing

Issue: -

Description

Prefer at least one space after slashes for comments.

Examples of correct code:

// This is a comment

/// Triple slash comment

// Multiline double-slash
// comment

/// Multiline triple-slash
/// comment

/// Multiline triple-slash
///   - This is indented

// - MARK: Mark comment

/* Asterisk comment */

/*
    Multiline asterisk comment
*/
   }
}

Examples of incorrect code:

//↓Something

//↓MARK

//↓👨‍👨‍👦‍👦Something

func a() {
    //↓This needs refactoring
    print("Something")
}
//↓We should improve above function

///↓This is a comment

/// Multiline triple-slash
///↓This line is incorrect, though

//↓- MARK: Mark comment

Further Reading