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

Feature Request: Remove space between Annotation and Constructor Parameters #3260

Closed
Rocketeer007 opened this issue Jun 7, 2022 · 4 comments

Comments

@Rocketeer007
Copy link

Configuration (required)

version = 3.5.8
runner.dialect = scala213

#preset = IntelliJ

maxColumn = 150
docstrings.style = keep
#docstrings.style = SpaceAsterisk
docstrings.wrap = no
docstrings.blankFirstLine = yes
docstrings.forceBlankLineBefore = false

importSelectors = singleLine

optIn.configStyleArguments = true

align.openParenDefnSite = true
align.closeParenSite = true

newlines.source = keep
newlines.beforeMultiline = keep
newlines.topLevelStatementBlankLines = [
  {
    blanks { before = 0 }
  }
]

rewrite.rules = [AvoidInfix]
rewrite.neverInfix.excludeFilters."+" = [ "map", "forward", "publish" ]

align.preset = none

Steps

Given code like this:

class MyClass @Inject()(parameter1: String, parameter2: String)

Problem

Scalafmt formats code like this:

class MyClass @Inject() (parameter1: String, parameter2: String)

Expectation

I would like the formatted output to look like this:

class MyClass @Inject()(parameter1: String, parameter2: String)

Notes

This appears to be a deliberate decision from the project maintainers (see #1516, and the discussion on #618), however, this goes against the current rules of my project, and I would very much like to apply Scalafmt without having to change this particular convention.

If the project maintainers would be amenable, I'll create a PR to add a configuration setting for this particular feature.

@kitbellew
Copy link
Collaborator

please ask on discord whether the community is ok with adding a parameter for this.

@Rocketeer007
Copy link
Author

I've tried to ask on Discord, but I think I'm being kicked from the server about 10 minutes after I join.

I'm no Discord expert - is there some verification step I've missed?

@kitbellew
Copy link
Collaborator

i am sorry, i don't know.

Rocketeer007 added a commit to Rocketeer007/scalafmt that referenced this issue Jun 7, 2022
@kitbellew
Copy link
Collaborator

please see comments to #3261. the proposal makes some cases unreadable.

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