Skip to content

Commit 4c70238

Browse files
committed
style: fixed Swiftlint setup
1 parent 5110c9d commit 4c70238

6 files changed

Lines changed: 33 additions & 56 deletions

File tree

.swiftlint.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,23 @@
11
---
22
disabled_rules:
3-
- large_tuple
4-
- todo
53
excluded:
64
- Carthage
75
- Pods
8-
opt_in_rules:
9-
- array_init
10-
- closure_body_length
11-
- closure_spacing
12-
- collection_alignment
13-
- convenience_type
14-
- empty_count
15-
- empty_string
16-
- explicit_acl
17-
- explicit_self
18-
- file_header
19-
- first_where
20-
- last_where
21-
- implicit_return
22-
- joined_default_parameter
23-
- let_var_whitespace
24-
- lower_acl_than_parent
25-
- mark
26-
- missing_docs
27-
- modifier_order
28-
- multiline_function_chains
29-
- redundant_nil_coalescing
30-
- static_operator
31-
file_length:
32-
error: 1200
33-
warning: 500
34-
force_cast: warning
6+
force_cast: warning
357
force_try:
36-
severity: warning
8+
severity: warning
379
identifier_name:
3810
excluded:
3911
- id
4012
- x
4113
- y
4214
- i
4315
min_length:
44-
error: 2
45-
warning: 2
16+
error: 2
17+
warning: 2
4618
included:
47-
- ../Sources
48-
line_length: 150
49-
reporter: xcode
50-
type_body_length:
51-
- 300
52-
- 400
53-
type_name:
54-
max_length:
55-
error: 60
56-
warning: 50
57-
min_length: 2
19+
- Sources
20+
- Shared
21+
- Shared iOS
22+
- Tests
23+
reporter: xcode

Shared iOS/UI/ViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ class ViewController: UIViewController {
1919
formatter.numberStyle = .percent
2020
return formatter
2121
}()
22-
22+
2323
@IBOutlet weak var progressContainer: UIStackView!
2424
@IBOutlet weak var progressBar: UIProgressView!
2525
@IBOutlet weak var progressLabel: UILabel!
2626

2727
var progressObserver: NSObjectProtocol!
2828

2929
var pdfView: PDFView {
30+
// swiftlint:disable:next force_cast
3031
self.view as! PDFView
3132
}
3233
var workCancellable: AnyCancellable?
@@ -53,7 +54,7 @@ class ViewController: UIViewController {
5354
self.progressLabel.text = percentage
5455
}
5556
}
56-
57+
5758
// Running task asynchronously
5859
self.workCancellable = generator.generateDataAsyncTask()
5960
.receive(on: DispatchQueue.main)

Shared/ExampleDocument.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ class ExampleDocument {
1818
return document
1919
}
2020
}
21-

Sources/TPPDFAsync/PDFAsyncGenerator+Combine.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ public extension PDFAsyncGenerator {
66

77
// MARK: - Combine Tasks
88

9-
func generateAsyncTask(to url: URL, info: PDFInfo? = nil, workQueue: DispatchQueue = .global(qos: .background)) -> Future<Void, Error> {
9+
func generateAsyncTask(
10+
to url: URL,
11+
info: PDFInfo? = nil,
12+
workQueue: DispatchQueue = .global(qos: .background)
13+
) -> Future<Void, Error> {
1014
Future<Void, Error> { [weak self] promise in
1115
workQueue.async {
1216
guard let strongSelf = self else {
@@ -22,7 +26,10 @@ public extension PDFAsyncGenerator {
2226
}
2327
}
2428

25-
func generateDataAsyncTask(info: PDFInfo? = nil, workQueue: DispatchQueue = .global(qos: .background)) -> Future<Data, Error> {
29+
func generateDataAsyncTask(
30+
info: PDFInfo? = nil,
31+
workQueue: DispatchQueue = .global(qos: .background)
32+
) -> Future<Data, Error> {
2633
Future<Data, Error> { [weak self] promise in
2734
workQueue.async {
2835
guard let strongSelf = self else {
@@ -38,7 +45,11 @@ public extension PDFAsyncGenerator {
3845
}
3946
}
4047

41-
func generateURLAsyncTask(filename: String, info: PDFInfo? = nil, workQueue: DispatchQueue = .global(qos: .background)) -> Future<URL, Error> {
48+
func generateURLAsyncTask(
49+
filename: String,
50+
info: PDFInfo? = nil,
51+
workQueue: DispatchQueue = .global(qos: .background)
52+
) -> Future<URL, Error> {
4253
Future<URL, Error> { [weak self] promise in
4354
workQueue.async {
4455
guard let strongSelf = self else {

Sources/TPPDFAsync/PDFAsyncGenerator.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ public class PDFAsyncGenerator {
99
public init(document: PDFDocument) {
1010
self.generator = PDFGenerator(document: document)
1111
}
12-
12+
1313
public var debug: Bool {
14-
set {
15-
generator.debug = newValue
16-
}
1714
get {
1815
generator.debug
1916
}
17+
set {
18+
generator.debug = newValue
19+
}
2020
}
2121

2222
public var progress: Progress {

Sources/TPPDFAsync/PDFAsyncMultiDocumentGenerator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public class PDFAsyncMultiDocumentGenerator {
1111
}
1212

1313
public var debug: Bool {
14-
set {
15-
generator.debug = newValue
16-
}
1714
get {
1815
generator.debug
1916
}
17+
set {
18+
generator.debug = newValue
19+
}
2020
}
2121

2222
public var progress: Progress {

0 commit comments

Comments
 (0)