-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SwiftLint via CocoaPods #78
Changes from 6 commits
b7c3eeb
ebed898
a570445
afbc20b
375a52e
8e69206
2a6edfa
86ef8e2
831d1a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
disabled_rules: | ||
- type_name | ||
|
||
opt_in_rules: | ||
- force_unwrapping | ||
|
||
# Rules customization | ||
line_length: | ||
warning: 120 | ||
error: 200 | ||
|
||
nesting: | ||
type_level: | ||
warning: 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ use_frameworks! | |
|
||
target 'Tests' do | ||
pod 'StencilSwiftKit', path: '.' | ||
pod 'SwiftLint', '~> 0.25' | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,20 @@ import XCTest | |
@testable import StencilSwiftKit | ||
|
||
class ParseBoolTests: XCTestCase { | ||
|
||
func testParseBool_TrueWithString() throws { | ||
// swiftlint:disable force_unwrapping | ||
XCTAssertTrue(try Filters.parseBool(from: ["true"])!) | ||
XCTAssertTrue(try Filters.parseBool(from: ["yes"])!) | ||
XCTAssertTrue(try Filters.parseBool(from: ["1"])!) | ||
// swiftlint:enable force_unwrapping | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should instead use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'd have to be careful then to provide the "inverse" value as a fallback for each test. Here it's true, for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's why I'd prefer to use the more readable |
||
} | ||
|
||
func testParseBool_FalseWithString() throws { | ||
// swiftlint:disable force_unwrapping | ||
XCTAssertFalse(try Filters.parseBool(from: ["false"])!) | ||
XCTAssertFalse(try Filters.parseBool(from: ["no"])!) | ||
XCTAssertFalse(try Filters.parseBool(from: ["0"])!) | ||
// swiftlint:enable force_unwrapping | ||
} | ||
|
||
func testParseBool_WithOptionalInt() throws { | ||
|
@@ -57,7 +60,9 @@ class ParseBoolTests: XCTestCase { | |
} | ||
|
||
func testParseBool_WithNonZeroIndex() throws { | ||
// swiftlint:disable force_unwrapping | ||
XCTAssertTrue(try Filters.parseBool(from: ["test", "true"], at: 1)!) | ||
XCTAssertFalse(try Filters.parseBool(from: ["test", "false"], at: 1)!) | ||
// swiftlint:enable force_unwrapping | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ machine: | |
|
||
dependencies: | ||
post: | ||
- bundle exec rake lint:install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same questions as in SwiftGen/SwiftGen#401 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same answer |
||
- curl -sS https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash | ||
|
||
test: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍, + 💯