Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

organizationmode type and visibility rules are broken #1881

Open
shipsywor opened this issue Sep 14, 2024 · 3 comments
Open

organizationmode type and visibility rules are broken #1881

shipsywor opened this issue Sep 14, 2024 · 3 comments

Comments

@shipsywor
Copy link

organizationmode rules are meant to organize as show in below image, however they do not have any effect. Other rules in .swiftformat config file works fine though like indent.

# format options
--indent 2

# file options
--exclude Pods

# rules
--disable elseOnSameLine,semicolons

# organization
--organizationmode type

Expectation:

CleanShot 2024-09-14 at 22 09 42@2x

Docs: https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#organizedeclarations

@nicklockwood
Copy link
Owner

You need to use --enable organizeDeclarations as well, as the rule is disabled by default

@nicklockwood
Copy link
Owner

@calda this is a pretty common source of confusion. Do you think it would make sense to show a warning when you specify an option when the associated rule is disabled?

The reason I've not done it before is that it might be annoying if people are using a shared config for multiple rulesets or whatever, but perhaps that's the lesser evil?

@calda
Copy link
Collaborator

calda commented Sep 15, 2024

I think it definitely makes sense to print a warning in situations like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants