Add option to group @testable imports at the top or bottom - #323
Merged
nicklockwood merged 8 commits intoNov 20, 2018
Conversation
Owner
|
@fdiaz thanks, this looks great! The argument names are a bit verbose compared with the rest of the project, although I don't have suggestions for better ones right now. That is contributing to the test failure in the help-line-length test though. I'll do a more thorough review later when I get a chance. |
| } | ||
|
|
||
| /// Grouping for sorting imports | ||
| public enum ImportGrouping: String, Equatable { |
Owner
There was a problem hiding this comment.
Equatable is redundant here, I think, since String already conforms to Equatable.
Contributor
Author
|
How do you feel about |
Contributor
Author
|
I'm gonna go with |
Owner
|
Lgtm. Thanks! |
nicklockwood
pushed a commit
that referenced
this pull request
Nov 23, 2018
* Add testable import new section option * Add simple test case * Add typealias * Add simple test case * Add new sorting algorithm for testable import * Add enum to either group testable on top or bottom * Remove redundant Equatable conformance * alphabetically -> alphabetized
leogdion
pushed a commit
to brightdigit/SwiftFormatSlim
that referenced
this pull request
Nov 6, 2020
…ood#323) * Add testable import new section option * Add simple test case * Add typealias * Add simple test case * Add new sorting algorithm for testable import * Add enum to either group testable on top or bottom * Remove redundant Equatable conformance * alphabetically -> alphabetized
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a config option to group
@testable imports at the top or bottom when sorting them.This way instead of:
we could get:
or:
This is a style I've seen in some projects, putting the
@testableat the bottom so it's easier to know what module is being tested.This is my first PR to
SwiftFormatso I'm more than happy to revisit anything.