Mark

MARK comment should be in valid format. e.g. ‘// MARK: …’ or ‘// MARK: - …’

  • Identifier: mark
  • Enabled by default: Yes
  • Supports autocorrection: Yes
  • Kind: lint
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

// MARK: good
// MARK: - good
// MARK: -
// MARK: - 
// BOOKMARK
//BOOKMARK
// BOOKMARKS
// MARK: This is good.
// MARK: - This is good.
// MARK: --- This is good. ---
// MARK: – This is dash separator
// Mark text
//  MarkdownText.swift
// MARK: good
func foo() {
    let bar = 0
      // MARK: good
}
/*
func test1() {
}
//MARK: mark
func test2() {
}
*/

Triggering Examples

//MARK: bad
// MARK:bad
//MARK:bad
//  MARK: bad
// MARK:  bad
// MARK: -bad
// MARK:- bad
// MARK:-bad
//MARK: - bad
//MARK:- bad
//MARK: -bad
//MARK:-bad
//Mark: bad
// Mark: bad
// MARK bad
//MARK bad
// MARK - bad
//MARK : bad
// MARKL:
// MARKR 
// MARKK -
/// MARK:
/// MARK bad
// MARK: good
func foo() {
    let bar = 0
      //MARK: bad
}
//MARK:- Top-Level bad mark
//MARK:- Another bad mark
struct MarkTest {}
// MARK:- Bad mark
extension MarkTest {}