swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.43k stars 221 forks source link

Lots of undocumented configuration options #455

Open dabrahams opened 1 year ago

dabrahams commented 1 year ago

The very first one in the dump-configuration output, fileScopedDeclarationPrivacy, doesn't appear in the configuration documentation, and it has what looks like a pretty drastic effect, and doesn't accept what I'm guessing is the most obvious setting internal. /cc @allevato

allevato commented 1 year ago

That option controls which visibility modifier to use (private or fileprivate) for declarations already using one of those at file-scope. That is, private and/or fileprivate declarations will be forced to be one or the other. This is to force consistency where—with the exception of extension decls, which are excluded from this—the two have the same effective visibility.

internal isn't supported since that would change the effective visibility of file-scoped decls.

allevato commented 1 year ago

Re: the larger documentation issue, we should just adopt DocC like I want to do for the rules so that the source code is the source of truth and we generate everything from that.

ahoppen commented 4 months ago

Tracked in Apple’s issue tracker as rdar://126948300