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

AlignArguments when first argument is a literal number #282

Open
udalrich opened this issue Jun 5, 2019 · 0 comments
Open

AlignArguments when first argument is a literal number #282

udalrich opened this issue Jun 5, 2019 · 0 comments

Comments

@udalrich
Copy link

udalrich commented Jun 5, 2019

With alignParameters as false, my code formats as

            Importance(10000,
            goal,
                strategy1, strategy2, strategy3, strategy4,
                decCommodityInd, decMoodInd,
                decCurLeaderOpinionInd, incAltLeaderOpinionInd)

With alignParameters as true, it formats as

            Importance(10000,
            goal,
            strategy1, strategy2, strategy3, strategy4,
            decCommodityInd, decMoodInd,
            decCurLeaderOpinionInd, incAltLeaderOpinionInd)

If I replace the constant with a variable, it behaves reasonably.

           // true
            val numIter = 10000
            Importance(numIter,
                       goal,
                       strategy1, strategy2, strategy3, strategy4,
                       decCommodityInd, decMoodInd,
                       decCurLeaderOpinionInd, incAltLeaderOpinionInd)
           // false
            val numIter = 10000
            Importance(numIter,
                goal,
                strategy1, strategy2, strategy3, strategy4,
                decCommodityInd, decMoodInd,
                decCurLeaderOpinionInd, incAltLeaderOpinionInd)

My configuration (through sbt) is

import scalariform.formatter.preferences._

ThisBuild / scalariformPreferences := scalariformPreferences.value.
    setPreference(AlignArguments, true).
    setPreference(AlignParameters, true).
    setPreference(DoubleIndentConstructorArguments, true).
    setPreference(DoubleIndentMethodDeclaration, true).
    setPreference(FirstArgumentOnNewline, Prevent).
    setPreference(IndentLocalDefs, true).
    setPreference(IndentSpaces, 4)
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

No branches or pull requests

1 participant