Open Lakr233 opened 2 years ago
@Lakr233 this is actually harder than it ought to be. You could put a .swiftformat
file in your home directory with:
--rules void
--disable void
This enables only the void rule, then disables that too, so that all rules are disabled. Then you can re-enable the rules you want in another .swiftformat
file in your project.
@Lakr233 oh wait, there is a slightly easier way: You can put this in the file instead:
--exclude *
--unexclude path/to/project
Note that the --unexclude
must go in the same .swiftformat
file as the --exclude *
otherwise nothing in any child of that directory will be formatted, even if you format it directly (this is arguably a bad design).
@Lakr233 I've slightly improved this in 0.49.5. You can now use
--disable all
Instead of
--rules void
--disable void
which is a bit less awkward.
I always mis-execute this command at ~ that will then f*** me up.
1 Is it possible to disable swiftformat at a dir completely? 2 Is is possible to put a check(y/n) before executing the command line when detecting ~?