From bf97e08fa7a41f8cb6698be7aa512fb280ea9c22 Mon Sep 17 00:00:00 2001 From: Kim de Vos Date: Thu, 29 Nov 2018 21:40:29 +0100 Subject: [PATCH] Exit immediately when linting with a version other than swift_version if defined (#2491) --- CHANGELOG.md | 5 +++++ Source/SwiftLintFramework/Models/Configuration.swift | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4439048b..02a4e7445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,11 @@ [Timofey Solonin](https://github.com/biboran) [#2435](https://github.com/realm/SwiftLint/issues/2435) +* The `lint` command now exits with a code of 2 when not using pinned + version defined as `swiftlint_version` in the configuration file. + [Timofey Solonin](https://github.com/kimdv) + [#2074](https://github.com/realm/SwiftLint/issues/2074) + #### Bug Fixes * Fix false positive in `nimble_operator` rule. diff --git a/Source/SwiftLintFramework/Models/Configuration.swift b/Source/SwiftLintFramework/Models/Configuration.swift index a01f493db..0f7cb8a1e 100644 --- a/Source/SwiftLintFramework/Models/Configuration.swift +++ b/Source/SwiftLintFramework/Models/Configuration.swift @@ -58,6 +58,7 @@ public struct Configuration: Hashable { if let pinnedVersion = swiftlintVersion, pinnedVersion != Version.current.value { queuedPrintError("Currently running SwiftLint \(Version.current.value) but " + "configuration specified version \(pinnedVersion).") + exit(2) } let configuredRules = configuredRules