@@ -124,7 +124,7 @@ public struct Configuration {
124
124
125
125
/// Creates a `Configuration` by specifying its properties directly,
126
126
/// except that rules are still to be synthesized from rulesMode, ruleList & allRulesWrapped
127
- /// and a check against the pinnedVersion is performed if given.
127
+ /// and a check against the pinnedVersion/minimumVersion is performed if given.
128
128
///
129
129
/// - parameter rulesMode: The `RulesMode` for this configuration.
130
130
/// - parameter allRulesWrapped: The rules with their own configurations already applied.
@@ -140,6 +140,7 @@ public struct Configuration {
140
140
/// - parameter reporter: The identifier for the `Reporter` to use to report style violations.
141
141
/// - parameter cachePath: The location of the persisted cache to use whith this configuration.
142
142
/// - parameter pinnedVersion: The SwiftLint version defined in this configuration.
143
+ /// - parameter minimumVersion: The minimum SwiftLint version defined in this configuration.
143
144
/// - parameter allowZeroLintableFiles: Allow SwiftLint to exit successfully when passed ignored or unlintable
144
145
/// files.
145
146
/// - parameter strict: Treat warnings as errors.
@@ -158,6 +159,7 @@ public struct Configuration {
158
159
reporter: String ? = nil ,
159
160
cachePath: String ? = nil ,
160
161
pinnedVersion: String ? = nil ,
162
+ minimumVersion: String ? = nil ,
161
163
allowZeroLintableFiles: Bool = false ,
162
164
strict: Bool = false ,
163
165
baseline: String ? = nil ,
@@ -171,6 +173,14 @@ public struct Configuration {
171
173
)
172
174
exit ( 2 )
173
175
}
176
+
177
+ if let minimumVersion, minimumVersion. compare ( Version . current. value, options: . numeric) == . orderedDescending {
178
+ queuedPrintError (
179
+ " warning: Currently running SwiftLint \( Version . current. value) but " +
180
+ " configuration specified minimum version \( minimumVersion) . "
181
+ )
182
+ exit ( 2 )
183
+ }
174
184
175
185
self . init (
176
186
rulesWrapper: RulesWrapper (
0 commit comments