-
Notifications
You must be signed in to change notification settings - Fork 433
Fix (some) SwiftLint violations #492
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
Fix (some) SwiftLint violations #492
Conversation
Mostly trailing whitespace issues, 'tis true. Also disable the opening_brace rule, as it doesn't play well with arrays of closures.
|
It doesn’t need to be in changelog, since it is not relevant to the public API. |
… there?)" This reverts commit 2de82a3.
|
I suspected as much. Fixed! |
Sources/EventLogger.swift
Outdated
|
|
||
| public static let allEvents: Set<Signal> = [ | ||
| .value, .completed, .failed, .terminated, .disposed, .interrupted, | ||
| .value, .completed, .failed, .terminated, .disposed, .interrupted |
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.
Can we change this rule? By default SwiftLint enforces no trailing comma. I think we should enforce the trailing comma. This tends to make diffs more readable and merges easier since adding a line doesn't alter the previously last item in the array.
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.
Makes sense. I added the exception and reinserted the commas.
It makes diffs more readable, merges easier. Also, it makes it easier to rearrange stuff.
.swiftlint.yml
Outdated
| @@ -0,0 +1,8 @@ | |||
| disabled_rules: | |||
| - opening_brace | |||
| - trailing_comma | |||
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.
Instead of disabling it, you can actually require the comma by adding this at the top level:
trailing_comma:
mandatory_comma: true
Would you mind doing that instead? Sorry that wasn't clear before. 😅
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-ha! Done and done.
|
Not quite sure why the Linux build fails – it seems But I'm not sure how this PR could affect that. Are the tests sometimes unstable, by any chance? |
|
I think that particular test is unstable. I've rerun those tests—hopefully they'll pass this time. |
Checklist
This PR adds the
.swiftlint.ymlconfig file, and runsswiftlint autocorrectto fix some issues. Mind, there are still 740 violations left (of which 601 are classified as "serious").I disabled the
opening_bracesrule because it didn't like arrays of closures, like this:Maybe some other rules need to be disabled as well, such as the tuple size and identifier name length rules.