mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
fcf848608e
* Add Example wrapper in order to display test failures inline when running in Xcode. * Stop using Swift 5.1-only features so we can compile on Xcode 10.2. * Wrap strings in Example. * Add Changelog entry. * Wrap all examples in Example struct. * Better and more complete capturing of line numbers. * Fix broken test. * Better test traceability. * Address or disable linting warnings. * Add documentation comments. * Disable linter for a few cases. * Limit mutability and add copy-and-mutate utility functions. * Limit scope of mutability.
64 lines
1.5 KiB
Swift
64 lines
1.5 KiB
Swift
internal struct MultilineArgumentsRuleExamples {
|
|
static let nonTriggeringExamples = [
|
|
Example("foo()"),
|
|
Example("foo(\n" +
|
|
")"),
|
|
Example("foo { }"),
|
|
Example("foo {\n" +
|
|
" \n" +
|
|
"}"),
|
|
Example("foo(0)"),
|
|
Example("foo(0, 1)"),
|
|
Example("foo(0, 1) { }"),
|
|
Example("foo(0, param1: 1)"),
|
|
Example("foo(0, param1: 1) { }"),
|
|
Example("foo(param1: 1)"),
|
|
Example("foo(param1: 1) { }"),
|
|
Example("foo(param1: 1, param2: true) { }"),
|
|
Example("foo(param1: 1, param2: true, param3: [3]) { }"),
|
|
Example("""
|
|
foo(param1: 1, param2: true, param3: [3]) {
|
|
bar()
|
|
}
|
|
"""),
|
|
Example("""
|
|
foo(param1: 1,
|
|
param2: true,
|
|
param3: [3])
|
|
"""),
|
|
Example("""
|
|
foo(
|
|
param1: 1, param2: true, param3: [3]
|
|
)
|
|
"""),
|
|
Example("""
|
|
foo(
|
|
param1: 1,
|
|
param2: true,
|
|
param3: [3]
|
|
)
|
|
""")
|
|
]
|
|
|
|
static let triggeringExamples = [
|
|
Example("""
|
|
foo(0,
|
|
param1: 1, ↓param2: true, ↓param3: [3])
|
|
"""),
|
|
Example("""
|
|
foo(0, ↓param1: 1,
|
|
param2: true, ↓param3: [3])
|
|
"""),
|
|
Example("""
|
|
foo(0, ↓param1: 1, ↓param2: true,
|
|
param3: [3])
|
|
"""),
|
|
Example("""
|
|
foo(
|
|
0, ↓param1: 1,
|
|
param2: true, ↓param3: [3]
|
|
)
|
|
""")
|
|
]
|
|
}
|