Closed meherkasam closed 9 months ago
The --rules
option is exclusive, meaning only those rules that are listed in the file will be enabled.
What you probably want to do is use --enable
in the child directory .swiftformat
files instead, so that rules specified higher up are inherited.
That's exactly what I needed. Thank you so much!
Apologies if this has already been answered somewhere in the documentation. I read through the README and searched through issues but couldn't quite find what I was looking for.
I have the following directory structure:
Contents of
example/.swiftformat
:Contents of
example/inner/.swiftformat
:Contents of
example/inner/test.swift
:Command run from
example/
:Expected contents of
example/inner/test.swift
:Actual contents of
example/inner/test.swift
:It appears that the rules set in the parent directory level are not being applied to a sub-directory if it contains its own
.swiftformat
file. The goal here is to achieve a structure where the root level would contain a few baseline rules and some subfolders deep down the hierarchy might want to conform to all of the baseline rules, but have their own stricter rules on top of the baseline rules. Is this achievable without having to maintain manual copies of the same rules in multiple places?Thank you for your help and appreciate any insight you can provide here.