Skip to content

fix: swift_format doesn't respect .swift-format file#283

Merged
stevearc merged 1 commit intostevearc:masterfrom
NSHaoSong:NSHaoSong/swift_format_fix
Jan 29, 2024
Merged

fix: swift_format doesn't respect .swift-format file#283
stevearc merged 1 commit intostevearc:masterfrom
NSHaoSong:NSHaoSong/swift_format_fix

Conversation

@NSHaoSong
Copy link
Copy Markdown
Contributor

swift-format won't pick up .swift-format config file in stdin mode. We need to set stdin = false and --in-place to make it work with conform.nvim.

apple/swift-format/README.md

  • -i/--in-place: Overwrites the input files when formatting instead of
    printing the results to standard output. No backup of the original file is
    made before it is overwritten.

Fix #211

`swift-format` won't pick up `.swift-format` config file in stdin mode. We need to set `stdin = false` and `--in-place` to make it work with `conform.nvim`.

[apple/swift-format/README.md](https://github.com/apple/swift-format/blob/e312ede68bd8549381f9e2edfef7e6c176e9a50e/README.md#L129-L131)

> *   `-i/--in-place`: Overwrites the input files when formatting instead of
    printing the results to standard output. _No backup of the original file is
    made before it is overwritten._

Fix stevearc#211
@stevearc
Copy link
Copy Markdown
Owner

LGTM

@stevearc stevearc merged commit 4588008 into stevearc:master Jan 29, 2024
@NSHaoSong NSHaoSong deleted the NSHaoSong/swift_format_fix branch January 29, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: swift_format doesn't respect .swift-format file

2 participants