You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-format swift-5.2-branch
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
Votes
0
Component/s
swift-format
Labels
Bug
Assignee
None
Priority
Medium
md5: 22c9b59e707798dd0bc5db47b2cb6554
Issue Description:
I've noticed that the only way I can get swift-format to use a custom config is to set the '--configuration' flag explicitly.
My understanding from the docs is that if a file named '.swiftformat' exists within the same directory as the file – or any of its parent directories – swift-format should use that configuration instead.
Example: working In a dir named TestFormat are two files: Test.swift and '.swiftformat'. The '.swiftformat' file has its indentation set to four spaces.
Expected:
When you call `swift-format -r -i .`, Test.swift is formatted with indentation of four spaces.
Actual:
When you call `swift-format -r -i .`, Test.swift is formatted with the default configs indentation of two spaces.
Attachment: Download
Environment
swift-format swift-5.2-branch
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
md5: 22c9b59e707798dd0bc5db47b2cb6554
Issue Description:
I've noticed that the only way I can get swift-format to use a custom config is to set the '--configuration' flag explicitly.
My understanding from the docs is that if a file named '.swiftformat' exists within the same directory as the file – or any of its parent directories – swift-format should use that configuration instead.
Example: working In a dir named TestFormat are two files: Test.swift and '.swiftformat'. The '.swiftformat' file has its indentation set to four spaces.
Expected:
When you call `swift-format -r -i .`, Test.swift is formatted with indentation of four spaces.
Actual:
When you call `swift-format -r -i .`, Test.swift is formatted with the default configs indentation of two spaces.
Workaround:
Call `swift-format -r -i --configuration .swiftformat .` specifying the config explicitly instead.
The text was updated successfully, but these errors were encountered: