From b4eb2df5671f4ff872534a7e5eda2d7b4bba4d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Wed, 22 Jan 2025 21:47:11 +0100 Subject: [PATCH] Allow severity of `duplicate_imports` rule to be configurable (#5979) --- CHANGELOG.md | 4 ++++ .../Rules/Idiomatic/DuplicateImportsRule.swift | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c01a45ecb..e950356916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ * Fix issue referencing the Tests package from another Bazel workspace. [jszumski](https://github.com/jszumski) +* Allow severity of `duplicate_imports` rule to be configurable. + [SimplyDanny](https://github.com/SimplyDanny) + [#5978](https://github.com/realm/SwiftLint/issues/5978) + ## 0.58.2: New Year’s Fresh Fold ### Breaking diff --git a/Source/SwiftLintBuiltInRules/Rules/Idiomatic/DuplicateImportsRule.swift b/Source/SwiftLintBuiltInRules/Rules/Idiomatic/DuplicateImportsRule.swift index 69514185f5..b9b1bf33c7 100644 --- a/Source/SwiftLintBuiltInRules/Rules/Idiomatic/DuplicateImportsRule.swift +++ b/Source/SwiftLintBuiltInRules/Rules/Idiomatic/DuplicateImportsRule.swift @@ -26,6 +26,7 @@ struct DuplicateImportsRule: SwiftSyntaxCorrectableRule { file.duplicateImportsViolationPositions().map { position in StyleViolation( ruleDescription: Self.description, + severity: configuration.severity, location: Location(file: file, position: position) ) }