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

Do not insert space after arity-0 infix operator, before parens #3607

Closed
georgms opened this issue Aug 11, 2023 · 1 comment · Fixed by #3612
Closed

Do not insert space after arity-0 infix operator, before parens #3607

georgms opened this issue Aug 11, 2023 · 1 comment · Fixed by #3612

Comments

@georgms
Copy link

georgms commented Aug 11, 2023

Configuration (required)

Please paste the contents of your .scalafmt.conf file here:

version = 3.7.12
runner.dialect = scala212
maxColumn = 120

Command-line parameters (required)

When I run scalafmt via CLI like this: coursier launch scalafmt

Steps

Given code like this:

val logger = mock[Logger]
logger.warn(any) shouldDoNothing()

Problem

Scalafmt formats code like this:

val logger = mock[Logger]
logger.warn(any) shouldDoNothing () // Note the extra space after `shouldDoNothing`

Expectation

I would like the formatted output to look like this:

val logger = mock[Logger]
logger.warn(any) shouldDoNothing()

Workaround

Notes

Note that shouldDoNothing is an arity-0 macro provided by Mockito Scala:

def shouldDoNothing(): Unit = macro DoSomethingMacro.doesNothing
@kitbellew
Copy link
Collaborator

  1. this was already discussed in feat: add more options for DSL #3385.
  2. why should arity-0 be treated differently from arity-2?

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 a pull request may close this issue.

2 participants