-
Notifications
You must be signed in to change notification settings - Fork 623
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
EditorConfig support #107
Comments
Looks like it would be doable, but the editorconfig spec only supports a fairly small subset of the styling properties that SwiftFormat supports. I could add proprietary extensions for SwiftFormat, but the editorconfig naming convention doesn't match mine, so then I'd need two sets of documentation - one for the command-line properties, and one for the custom editorconfig properties, which would be hard for me to maintain and confusing for users. Unless you have a better suggestion? |
It's not super pretty, but what I had in mind was that configuration would be able to be done in 3 ways following this priority:
So command line options (if present) override any config file. A SwiftFormat config file (if present) overrides an editor config file. Editor config is only used when the other two aren't present. The trickiest bit would be defining and supporting a SwiftFormat config. Once there was support for loading a configuration from a file, the editor config support could be viewed as a mapping of the editor config options to the superset of SwiftFormat options. I probably wouldn't suggest extending the editor config options set, opting instead to disable the features that aren't in the editor config spec. I think that would provide the most consistent experience for cross-language use. |
@scottrhoyt that makes sense. I was hoping to use an existing standard for the SwiftFormat config file though. Ah well... |
Hi, This was done? Thanks. |
@paulo-coutinho SwiftFormat now has a config file, but not editorconfig compatible |
I'm using swift-format as the default style for swift language as this looks to be the default that apple recommends, for example 2 space indent instead of 4. Am I correct in thinking this is the default recommended style I couldn't find any apple style guide with the recommended indentation. I'm not using Xcode and other editors don't have the style set to be the same as swift-format, it would be great if we could have editor config so that I could easily set the style to match swift-format. |
My thoughts would be that EditorConfig and the SwiftFormat config file wouldn't be mutually exclusive: They'd be merged with The only thing that would completely override the files are options passed via command line Precedence:
|
It would be awesome to see support for http:https://editorconfig.org for cross-language formatting consistency! 馃憤
The text was updated successfully, but these errors were encountered: