-
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
Enable extra SwiftLint rules #79
Conversation
.swiftlint.yml
Outdated
@@ -0,0 +1,43 @@ | |||
disabled_rules: | |||
- type_name |
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.
Why disable this rule?
Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length.
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.
That's from the swiftgen repo, just using the same config. I assume it was disabled at some point for some reason? 😅
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.
Ah! Let's re-enable it and see what violations it reports then 😛
func testParseBool_TrueWithString() throws { | ||
// swiftlint:disable force_unwrapping | ||
XCTAssertTrue(try Filters.parseBool(from: ["true"])!) |
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.
ditto #78 (comment)
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.
Same as in SwiftGen/SwiftGen#402: these changes will disappear once #78 is merged. Also applies to the comments below
circle.yml
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
ditto #78 (comment)
rakelib/lint.rake
Outdated
task :code do |task| | ||
Utils.print_header 'Linting the code' | ||
config = Pathname.getwd + '.swiftlint.yml' | ||
Utils.run(%(#{SWIFTLINT} lint --strict --path Sources --config "#{config}"), task) |
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.
ditto #78 (comment)
82fef7a
to
9a8ffb6
Compare
39eb35c
to
6f701bf
Compare
6f701bf
to
e8b8f3c
Compare
This enables a bunch of optional SwiftLint rules that ensures the codebase is a bit more consistent.
Same as SwiftGen/SwiftGen#402
Note: built on top of #78, wait until that is merged.