@@ -2,65 +2,66 @@ import Foundation
22
33public extension DangerSwiftCommitLint {
44 /// All commit checkers provided by `DangerSwiftCommitLint`
5- enum CommitCheckerType : CaseIterable , Hashable {
6- /// Commit subject and body are separated by an empty line (`CommitChecker /BodyEmptyLineCheck`)
5+ enum CommitLintType : CaseIterable , Hashable {
6+ /// Commit subject and body are separated by an empty line (`CommitLint /BodyEmptyLineCheck`)
77 case bodyEmptyLine
8- /// Commit subject begins with a capital letter (`CommitChecker /SubjectCapCheck`)
8+ /// Commit subject begins with a capital letter (`CommitLint /SubjectCapCheck`)
99 case subjectCapitalLetter
10- /// Commit subject is no longer than 50 characters (`CommitChecker /SubjectLengthCheck`)
10+ /// Commit subject is no longer than 50 characters (`CommitLint /SubjectLengthCheck`)
1111 case subjectLength
12- /// Commit subject does not end in a period (`CommitChecker /SubjectPeriodCheck`)
12+ /// Commit subject does not end in a period (`CommitLint /SubjectPeriodCheck`)
1313 case subjectPeriod
14- /// Commit subject is more than one word (`CommitChecker /SubjectWordCheck`)
14+ /// Commit subject is more than one word (`CommitLint /SubjectWordCheck`)
1515 case subjectWord
1616 }
1717
1818 /// Checker selection
19- enum CommitCheckerSelection {
19+ enum CommitLintSelection {
2020 /// Select all checkers
2121 case all
2222 /// Select a set of checkers
23- case selected( Set < CommitCheckerType > )
23+ case selected( Set < CommitLintType > )
2424 }
2525
26+ /// Configuration for `DangerSwiftCommitLint`
2627 struct Configuration {
2728 let limit : Int
2829
29- private let disabled : CommitCheckerSelection
30- private let warn : CommitCheckerSelection
31- private let fail : CommitCheckerSelection
32- private let customCheckers : [ CommitLint . Type ]
30+ private let disabled : CommitLintSelection
31+ private let warn : CommitLintSelection
32+ private let fail : CommitLintSelection
33+ private let custom : [ CommitLint . Type ]
3334
3435 /// Initialize the configuration.
3536 /// - Parameters:
36- /// - disabled: The selected checks to skip.
37- /// - warn: The selected checks to warn on.
38- /// - fail: The selected checks to fail on.
37+ /// - disabled: The selected commit lint to skip.
38+ /// - warn: The selected commit lint to warn on.
39+ /// - fail: The selected commit lint to fail on.
3940 /// - limit: The number of commits to check.
40- /// - customCheckers: An array of custom checkers.
41+ /// - customCheckers: An array of custom checkers. This array will be added to all checkers.
4142 public init (
42- disabled: CommitCheckerSelection = . selected( [ ] ) ,
43- warn: CommitCheckerSelection = . selected( [ ] ) ,
44- fail: CommitCheckerSelection = . all,
43+ disabled: CommitLintSelection = . selected( [ ] ) ,
44+ warn: CommitLintSelection = . selected( [ ] ) ,
45+ fail: CommitLintSelection = . all,
4546 limit: Int = 0 ,
46- customCheckers : [ CommitLint . Type ] = [ ]
47+ custom : [ CommitLint . Type ] = [ ]
4748 ) {
4849 self . disabled = disabled
4950 self . warn = warn
5051 self . fail = fail
5152 self . limit = limit
52- self . customCheckers = customCheckers
53+ self . custom = custom
5354 }
5455 }
5556}
5657
5758extension DangerSwiftCommitLint . Configuration {
5859 static var defaultCheckers : [ CommitLint . Type ] {
59- DangerSwiftCommitLint . CommitCheckerType . allCases. map ( \. type)
60+ DangerSwiftCommitLint . CommitLintType . allCases. map ( \. type)
6061 }
6162
6263 var allCheckers : [ CommitLint . Type ] {
63- Self . defaultCheckers + customCheckers
64+ Self . defaultCheckers + custom
6465 }
6566
6667 var disabledCheckers : [ CommitLint . Type ] {
@@ -96,7 +97,7 @@ extension DangerSwiftCommitLint.Configuration {
9697 }
9798}
9899
99- private extension DangerSwiftCommitLint . CommitCheckerType {
100+ private extension DangerSwiftCommitLint . CommitLintType {
100101 var type : CommitLint . Type {
101102 switch self {
102103 case . bodyEmptyLine: return BodyEmptyLine . self
0 commit comments