Enable SwiftLint rule 'multiline_function_chains' and fix all violations
This commit is contained in:
parent
c87f4e9792
commit
776c813f94
3 changed files with 27 additions and 26 deletions
|
|
@ -98,7 +98,7 @@ whitelist_rules:
|
|||
- modifier_order
|
||||
- multiline_arguments
|
||||
- multiline_arguments_brackets
|
||||
# - multiline_function_chains
|
||||
- multiline_function_chains
|
||||
# - multiline_literal_brackets
|
||||
# - multiline_parameters
|
||||
# - multiline_parameters_brackets
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ class UICodeHighlightingLabel: UILocalizedLabel {
|
|||
return NSAttributedString(string: line, attributes: UICodeHighlightingLabel.CODE_ATTRIBUTES)
|
||||
}
|
||||
return NSAttributedString(string: line)
|
||||
}.reduce(into: NSMutableAttributedString(string: "")) {
|
||||
}
|
||||
.reduce(into: NSMutableAttributedString(string: "")) {
|
||||
$0.append($1)
|
||||
$0.append(UICodeHighlightingLabel.ATTRIBUTED_NEWLINE)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,19 +262,19 @@ public class PasswordStore {
|
|||
private func updatePasswordEntityCoreData() {
|
||||
deleteCoreData(entityName: "PasswordEntity")
|
||||
do {
|
||||
var q = try fm.contentsOfDirectory(atPath: storeURL.path).filter {
|
||||
!$0.hasPrefix(".")
|
||||
}.map { (filename) -> PasswordEntity in
|
||||
let passwordEntity = NSEntityDescription.insertNewObject(forEntityName: "PasswordEntity", into: context) as! PasswordEntity
|
||||
if filename.hasSuffix(".gpg") {
|
||||
passwordEntity.name = String(filename.prefix(upTo: filename.index(filename.endIndex, offsetBy: -4)))
|
||||
} else {
|
||||
passwordEntity.name = filename
|
||||
var q = try fm.contentsOfDirectory(atPath: storeURL.path)
|
||||
.filter { !$0.hasPrefix(".") }
|
||||
.map { (filename) -> PasswordEntity in
|
||||
let passwordEntity = NSEntityDescription.insertNewObject(forEntityName: "PasswordEntity", into: context) as! PasswordEntity
|
||||
if filename.hasSuffix(".gpg") {
|
||||
passwordEntity.name = String(filename.prefix(upTo: filename.index(filename.endIndex, offsetBy: -4)))
|
||||
} else {
|
||||
passwordEntity.name = filename
|
||||
}
|
||||
passwordEntity.path = filename
|
||||
passwordEntity.parent = nil
|
||||
return passwordEntity
|
||||
}
|
||||
passwordEntity.path = filename
|
||||
passwordEntity.parent = nil
|
||||
return passwordEntity
|
||||
}
|
||||
while !q.isEmpty {
|
||||
let e = q.first!
|
||||
q.remove(at: 0)
|
||||
|
|
@ -286,19 +286,19 @@ public class PasswordStore {
|
|||
if fm.fileExists(atPath: filePath, isDirectory: &isDirectory) {
|
||||
if isDirectory.boolValue {
|
||||
e.isDir = true
|
||||
let files = try fm.contentsOfDirectory(atPath: filePath).filter {
|
||||
!$0.hasPrefix(".")
|
||||
}.map { (filename) -> PasswordEntity in
|
||||
let passwordEntity = NSEntityDescription.insertNewObject(forEntityName: "PasswordEntity", into: context) as! PasswordEntity
|
||||
if filename.hasSuffix(".gpg") {
|
||||
passwordEntity.name = String(filename.prefix(upTo: filename.index(filename.endIndex, offsetBy: -4)))
|
||||
} else {
|
||||
passwordEntity.name = filename
|
||||
let files = try fm.contentsOfDirectory(atPath: filePath)
|
||||
.filter { !$0.hasPrefix(".") }
|
||||
.map { (filename) -> PasswordEntity in
|
||||
let passwordEntity = NSEntityDescription.insertNewObject(forEntityName: "PasswordEntity", into: context) as! PasswordEntity
|
||||
if filename.hasSuffix(".gpg") {
|
||||
passwordEntity.name = String(filename.prefix(upTo: filename.index(filename.endIndex, offsetBy: -4)))
|
||||
} else {
|
||||
passwordEntity.name = filename
|
||||
}
|
||||
passwordEntity.path = "\(e.path!)/\(filename)"
|
||||
passwordEntity.parent = e
|
||||
return passwordEntity
|
||||
}
|
||||
passwordEntity.path = "\(e.path!)/\(filename)"
|
||||
passwordEntity.parent = e
|
||||
return passwordEntity
|
||||
}
|
||||
q += files
|
||||
} else {
|
||||
e.isDir = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue