Skip to content

Commit

Permalink
fix Mark rule case // MARK: -
Browse files Browse the repository at this point in the history
  • Loading branch information
roddi committed Aug 30, 2016
1 parent 2eaac54 commit c9e09e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/SwiftLintFramework/Rules/MarkRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public struct MarkRule: ConfigurationProviderRule {
description: "MARK comment should be in valid format.",
nonTriggeringExamples: [
"// MARK: good\n",
"// MARK: - good\n"
"// MARK: - good\n",
"// MARK: -\n"
],
triggeringExamples: [
"//MARK: bad",
Expand All @@ -32,7 +33,7 @@ public struct MarkRule: ConfigurationProviderRule {
)

public func validateFile(file: File) -> [StyleViolation] {
let options = ["MARK:[^ ]", "[^ ]MARK: [^-]", "\\sMARK:[^ ]", "MARK:[ ][-][^ ]"]
let options = ["MARK:[^ ]", "[^ ]MARK: [^-]", "\\sMARK:[^ ]", "MARK:[ ][-][^\\s ]"]
let pattern = "(" + options.joinWithSeparator("|") + ")"

return file.matchPattern(pattern, withSyntaxKinds: [.Comment]).flatMap { range in
Expand Down

0 comments on commit c9e09e4

Please sign in to comment.