Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalafmt introduction post work #187

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Conversation

errt
Copy link
Collaborator

@errt errt commented Jan 22, 2024

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

@errt errt requested review from TorunR and roterEmil January 22, 2024 16:38
@maximilianruesch
Copy link
Collaborator

We can probably address some concerns from #182 (review) 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
Copy link
Collaborator Author

errt commented Jan 22, 2024

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
Copy link
Collaborator

Imo they can be made the same strength:

  • exemptScope: "This parameter determines when an infix operator can be exempted from applying continuation indentation."
  • excludeRegex "Defines a regular expression for excluded infix operators. If an eligible operator matches, it will not be indented."

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
Copy link
Collaborator Author

errt commented Jan 23, 2024

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

@errt errt force-pushed the feature/scalariformRemovalPreparation branch 3 times, most recently from 94dd1d6 to 7f21e49 Compare January 26, 2024 16:41
@errt errt added this pull request to the merge queue Feb 13, 2024
Merged via the queue into develop with commit 896bae7 Feb 13, 2024
2 checks passed
@errt errt deleted the feature/scalariformRemovalPreparation branch February 13, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants