Closed mnazirov closed 8 months ago
@mnazirov
1) is caused by the wrapArguments
rule in combination with the --wrapparameters before-first
option. Use --disable wrapArguments
to prevent it, or set --wrapparameters preserve
2) is because there is no dedicated rule for wrapping protocols at the moment, so the line is just wrapped at the first element that exceeds the --maxwidth 160
characters that you've set
3, 4) same as 2. In all three cases the wrap
rule is being invoked, and wrapping at the last point it can to stay within the line width of 160 characters.
@nicklockwood Thank you so much for point-by-point. Can you please tell me why there is formatting going on here? How can I remove it? Somehow disabling the rule affects it - wrapMultilineStatementBraces
Before the library was run
public protocol NotificationsFactoryProtocol:
AnalyticsProtocol,
DemoHelperProtocol,
CurrentProviderProtocol
{
...
}
After the library was run.
public protocol NotificationsFactoryProtocol:
AnalyticsProtocol,
DemoHelperProtocol,
CurrentProviderProtocol {
...
}
@mnazirov this is probably because of the --disable wrapMultilineStatementBraces
in your config. That counteracts the effect of the braces
rule, so you either need to disable both or neither.
@nicklockwood What other rules should I disable?)
@mnazirov I can't really answer that for you. Maybe --disable all
and then just enable the ones you want?
Hi! I noticed wrap lines I didn't expect. Can you please tell me how to avoid it?
I have these rules.
1) There has been wrap of one parameter. Although it's not a long line. It was expected that there would be no wrap to the new line.
Before the library was run
After the library was run
2) Wrap of only one protocol
Before the library was run
After the library was run
3) Non-obvious wrap line of only one condition
Before the library was run
After the library was run.
4) It's not clear why this piece is being moved. Before the library was run
After the library was run.