From 6101f10382f567414c7134b6c2dc65a870c5f127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 24 Apr 2022 23:15:44 +0200 Subject: [PATCH 1/5] Update formula to version 0.9.0 --- Formula/anylint.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/anylint.rb b/Formula/anylint.rb index c0805b0..96f21a6 100644 --- a/Formula/anylint.rb +++ b/Formula/anylint.rb @@ -1,7 +1,7 @@ class Anylint < Formula desc "Lint anything by combining the power of Swift & regular expressions" homepage "https://github.com/FlineDev/AnyLint" - url "https://github.com/FlineDev/AnyLint.git", :tag => "0.8.5", :revision => "1078228fb2251d9efa369768530638790587d4eb" + url "https://github.com/FlineDev/AnyLint.git", :tag => "0.9.0", :revision => "789e7320c9c70a90cc4f99fb245160d9ec62da7b" head "https://github.com/FlineDev/AnyLint.git" depends_on :xcode => ["12.5", :build] From 77e24fdedb70413dd8f750799dedc4b309b7c8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 24 Apr 2022 23:39:25 +0200 Subject: [PATCH 2/5] Fix building issues with failed release 0.9.0 --- .../AnyLint/Checkers/FileContentsChecker.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Sources/AnyLint/Checkers/FileContentsChecker.swift b/Sources/AnyLint/Checkers/FileContentsChecker.swift index 558521e..e7a1878 100644 --- a/Sources/AnyLint/Checkers/FileContentsChecker.swift +++ b/Sources/AnyLint/Checkers/FileContentsChecker.swift @@ -41,16 +41,23 @@ extension FileContentsChecker: Checker { locationInfo = fileContents.locationInfo(of: match.range.lowerBound) case .upper: - locationInfo = fileContents.locationInfo(of: match.range.lowerBound) + locationInfo = fileContents.locationInfo(of: match.range.upperBound) } case .captureGroup(let index): + let capture = match.captures[index]! + let captureRange = NSRange(match.string.range(of: capture)!, in: match.string) + switch self.violationLocation.bound { case .lower: - locationInfo = fileContents.locationInfo(of: match.range.lowerBound) + locationInfo = fileContents.locationInfo( + of: fileContents.index(match.range.lowerBound, offsetBy: captureRange.location) + ) case .upper: - locationInfo = fileContents.locationInfo(of: match.range.lowerBound) + locationInfo = fileContents.locationInfo( + of: fileContents.index(match.range.lowerBound, offsetBy: captureRange.location + captureRange.length) + ) } } @@ -117,7 +124,7 @@ extension FileContentsChecker: Checker { let violationsOnRechecks = try FileContentsChecker( checkInfo: checkInfo, regex: regex, - violationLocation: self.violationLocation + violationLocation: self.violationLocation, filePathsToCheck: filePathsToReCheck, autoCorrectReplacement: autoCorrectReplacement, repeatIfAutoCorrected: repeatIfAutoCorrected From f14c86807106e9f1a2e62f76e2ef4bf40497156b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 24 Apr 2022 23:40:05 +0200 Subject: [PATCH 3/5] Point formula to correct tag commit hash --- Formula/anylint.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/anylint.rb b/Formula/anylint.rb index 96f21a6..9171057 100644 --- a/Formula/anylint.rb +++ b/Formula/anylint.rb @@ -1,7 +1,7 @@ class Anylint < Formula desc "Lint anything by combining the power of Swift & regular expressions" homepage "https://github.com/FlineDev/AnyLint" - url "https://github.com/FlineDev/AnyLint.git", :tag => "0.9.0", :revision => "789e7320c9c70a90cc4f99fb245160d9ec62da7b" + url "https://github.com/FlineDev/AnyLint.git", :tag => "0.9.0", :revision => "77e24fdedb70413dd8f750799dedc4b309b7c8eb" head "https://github.com/FlineDev/AnyLint.git" depends_on :xcode => ["12.5", :build] From 42b3231f383fb2ac9538832a4bf8cf32a2d1582b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Mon, 25 Apr 2022 17:55:23 +0200 Subject: [PATCH 4/5] Change default violation level from `error` to `warning` --- CHANGELOG.md | 3 ++- Sources/AnyLint/CheckInfo.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1acedf..57829ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,8 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se ### Added - None. ### Changed -- None. +- Default violation level was changed from `error` to `warning`. + Author: [Cihat Gündüz](https://github.com/Jeehut) | Issue: [#47](https://github.com/FlineDev/AnyLint/issues/47) ### Deprecated - None. ### Removed diff --git a/Sources/AnyLint/CheckInfo.swift b/Sources/AnyLint/CheckInfo.swift index 9cd3080..d1a705a 100644 --- a/Sources/AnyLint/CheckInfo.swift +++ b/Sources/AnyLint/CheckInfo.swift @@ -13,7 +13,7 @@ public struct CheckInfo { public let severity: Severity /// Initializes a new info object for the lint check. - public init(id: String, hint: String, severity: Severity = .error) { + public init(id: String, hint: String, severity: Severity = .warning) { self.id = id self.hint = hint self.severity = severity From 1073b8cffcaae54ecb3ac41e1be7137756e731b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Mon, 25 Apr 2022 17:56:54 +0200 Subject: [PATCH 5/5] Bump version num & finalize new changelog section --- CHANGELOG.md | 8 ++++++-- README.md | 4 ++-- Sources/Utility/Constants.swift | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57829ee..1edb153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se ### Added - None. ### Changed -- Default violation level was changed from `error` to `warning`. - Author: [Cihat Gündüz](https://github.com/Jeehut) | Issue: [#47](https://github.com/FlineDev/AnyLint/issues/47) +- None. ### Deprecated - None. ### Removed @@ -32,6 +31,11 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se ### Security - None. +## [0.9.1] - 2022-04-25 +### Changed +- Default violation level was changed from `error` to `warning`. + Author: [Cihat Gündüz](https://github.com/Jeehut) | Issue: [#47](https://github.com/FlineDev/AnyLint/issues/47) + ## [0.9.0] - 2022-04-24 ### Added - Added new option `violationLocation` parameter for `checkFileContents` for specifying position of violation marker using `.init(range:bound:)`, where `range` can be one of `.fullMatch` or `.captureGroup(index:)` and bound one of `.lower` or `.upper`. diff --git a/README.md b/README.md index 738a4aa..c399ced 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ alt="Coverage"/> - Version: 0.9.0 + Version: 0.9.1