mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Merge pull request #1467 from ultimatedbz/jc/report-violations-consistently
Improve user experience in reporting violations
This commit is contained in:
+4
-4
@@ -18,6 +18,10 @@
|
||||
* Add lowercase and missing colon checks to the `mark` rule.
|
||||
[Jason Moore](https://github.com/xinsight)
|
||||
|
||||
* Improve violation reason wording in `function_body_length`,
|
||||
`large_type`, and `type_body_length` rules.
|
||||
[ultimatedbz](https://github.com/ultimatedbz)
|
||||
|
||||
##### Bug Fixes
|
||||
|
||||
* `emoji` and `checkstyle` reporter output report sorted by file name.
|
||||
@@ -27,10 +31,6 @@
|
||||
* Fix typo in `DiscardedNotificationCenterObserverRule`.
|
||||
[Spencer Kaiser](https://github.com/spencerkaiser)
|
||||
|
||||
* Fix inaccurate violation report in `file_length` and
|
||||
`function_parameter_count` rules.
|
||||
[ultimatedbz](https://github.com/ultimatedbz)
|
||||
|
||||
## 0.18.1: Misaligned Drum
|
||||
|
||||
##### Breaking
|
||||
|
||||
@@ -31,7 +31,7 @@ public struct FileLengthRule: ConfigurationProviderRule, SourceKitFreeRule {
|
||||
return [StyleViolation(ruleDescription: type(of: self).description,
|
||||
severity: parameter.severity,
|
||||
location: Location(file: file.path, line: lineCount),
|
||||
reason: "File should contain \(parameter.value) lines or less: " +
|
||||
reason: "File should contain \(configuration.warning) lines or less: " +
|
||||
"currently contains \(lineCount)")]
|
||||
}
|
||||
return []
|
||||
|
||||
@@ -39,7 +39,7 @@ public struct FunctionBodyLengthRule: ASTRule, ConfigurationProviderRule {
|
||||
return [StyleViolation(ruleDescription: type(of: self).description,
|
||||
severity: parameter.severity,
|
||||
location: Location(file: file, byteOffset: offset),
|
||||
reason: "Function body should span \(parameter.value) lines or less " +
|
||||
reason: "Function body should span \(configuration.warning) lines or less " +
|
||||
"excluding comments and whitespace: currently spans \(lineCount) " +
|
||||
"lines")]
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public struct FunctionParameterCountRule: ASTRule, ConfigurationProviderRule {
|
||||
return [StyleViolation(ruleDescription: type(of: self).description,
|
||||
severity: parameter.severity,
|
||||
location: Location(file: file, byteOffset: offset),
|
||||
reason: "Function should have \(parameter.value) parameters or less: " +
|
||||
reason: "Function should have \(configuration.warning) parameters or less: " +
|
||||
"it currently has \(parameterCount)")]
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public struct LargeTupleRule: ASTRule, ConfigurationProviderRule {
|
||||
|
||||
return offsets.flatMap { location, size in
|
||||
for parameter in configuration.params where size > parameter.value {
|
||||
let reason = "Tuples should have at most \(parameter.value) members."
|
||||
let reason = "Tuples should have at most \(configuration.warning) members."
|
||||
return StyleViolation(ruleDescription: type(of: self).description,
|
||||
severity: parameter.severity,
|
||||
location: Location(file: file, byteOffset: location),
|
||||
|
||||
@@ -59,7 +59,7 @@ public struct TypeBodyLengthRule: ASTRule, ConfigurationProviderRule {
|
||||
return [StyleViolation(ruleDescription: type(of: self).description,
|
||||
severity: parameter.severity,
|
||||
location: Location(file: file, byteOffset: offset),
|
||||
reason: "Type body should span \(parameter.value) lines or less " +
|
||||
reason: "Type body should span \(configuration.warning) lines or less " +
|
||||
"excluding comments and whitespace: currently spans \(lineCount) " +
|
||||
"lines")]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user