opalj / opal

https://www.opal-project.de
Other
51 stars 27 forks source link

Scalafmt introduction post work #187

Closed errt closed 9 months ago

errt commented 10 months ago

Some more changes in the wake of removing Scalariform in favor of Scalafmt

maximilianruesch commented 10 months ago

We can probably address some concerns from https://github.com/opalj/opal/pull/182#pullrequestreview-1828147803 using the indentOperator.excludeRegex from https://scalameta.org/scalafmt/docs/configuration.html#indentoperator with an impossible regex like (?!x)x which would effectively evaluate indentOperator.exemptScope to None.

errt commented 10 months ago

Not sure from reading the documentation, but isn't exemptScope stronger than excludeRegex? We can still try, it should maybe indent some boolean expressions better, as the default for excludeRegex is && and ||.

maximilianruesch commented 10 months ago

Imo they can be made the same strength:

When "continuation indentation" and "it will be indented" mean the same, setting an impossible regex should just emulate exemptScope=None.

Regardless of how strong it is, imo worth a try.

errt commented 10 months ago

Works, but I put it in another PR: #188