I get the following error after updating to 0.45.2 (coming from 0.45.1):
Unexpected class/static func on line xxx
This small example reproduces the error:
protocol Test where Self: UIViewController {
static func abc() -> Self
}
Thanks for reporting, I'll get it fixed. In the meantime, disabling the redundantSelf rule should solve it.
@fgroeger I'm not seeing the error when running swiftformat 0.45.2 directly on that sample. Do you perhaps have a custom .swiftformat configuration?
Oh yeah sorry, completely forgotten about that:
--allman false
--binarygrouping none
--closingparen balanced
--commas always
--conflictmarkers reject
--decimalgrouping none
--elseposition same-line
--voidtype void
--exponentcase uppercase
--exponentgrouping disabled
--fractiongrouping disabled
--fragment false
--header ignore
--hexgrouping none
--hexliteralcase uppercase
--ifdef indent
--importgrouping testable-bottom
--indent 4
--indentcase true
--linebreaks lf
--maxwidth none
--nospaceoperators
--octalgrouping none
--operatorfunc spaced
--patternlet hoist
--ranges no-space
--self init-only
--selfrequired
--semicolons never
--stripunusedargs closure-only
--tabwidth unspecified
--trailingclosures
--trimwhitespace nonblank-lines
--wraparguments before-first
--wrapcollections before-first
--wrapparameters before-first
--xcodeindentation disabled
--guardelse same-line
--disable andOperator,strongOutlets,wrapMultilineStatementBraces
--modifierorder convenience,override
OK, I'm seeing it now (looks like the --self init-only option was the culprit).
@fgroeger fixed in 0.52.3.
Thanks!