Skip to content
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

Merged
merged 3 commits into from
Apr 9, 2018
Merged

Conversation

djbe
Copy link
Member

@djbe djbe commented Mar 27, 2018

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.

.swiftlint.yml Outdated
@@ -0,0 +1,43 @@
disabled_rules:
- type_name
Copy link
Contributor

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.

Copy link
Member Author

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? 😅

Copy link
Contributor

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"])!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djbe djbe force-pushed the feature/enable-extra-swiftlint-rules branch 2 times, most recently from 82fef7a to 9a8ffb6 Compare March 29, 2018 15:04
@djbe djbe force-pushed the feature/enable-extra-swiftlint-rules branch 2 times, most recently from 39eb35c to 6f701bf Compare April 9, 2018 14:48
@djbe djbe force-pushed the feature/enable-extra-swiftlint-rules branch from 6f701bf to e8b8f3c Compare April 9, 2018 14:56
@djbe djbe merged commit 819b01f into master Apr 9, 2018
@djbe djbe deleted the feature/enable-extra-swiftlint-rules branch April 9, 2018 15:40
@djbe djbe added this to the 2.5.0 milestone Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants