ެࣜΛݟΔͱɺʮ͍͔ͭ͘ʯͷઃఆํ๏ͱޮՌॻ͍ͯ·͢ɻ • http://scalameta.org/scalafmt/#Configuration • ͨͩɺͦͷઆ໌ͷதʹɺҎԼͷΑ͏ʹ͋Δɻ • To find all available configuration options, it's best to browse the source code of Scalafmt. A good place to start is ScalafmtConfig. Observe that this listing below is the top- level, there are more configuration options if you visited nested fields like spaces and newlines. • ιʔείʔυݟΖɻ • IntelliJͷPluginΛೖΕΔ͜ͱͰɺCtrl+Shift+l ͰscalafmtͰίʔυϑΥʔ Ϛοτ͔͚Ε·͢ɻ • build.sbtʹ scalafmtOnCompile := true Λॻ͘͜ͱͰɺίϯύΠϧ࣌ʹࣗ ಈతʹίʔυϑΥʔϚοτ͔͚Ε·͢ɻ
to newlines before a dot starting a select * chain of length one and argument list. The penalty matches the number * of arguments to the select chain application. * {{{ * // If true, favor * logger.elem(a, * b, * c) * // instead of * logger * .elem(a, b, c) * * // penalty is proportional to argument count, example: * logger.elem(a, b, c) // penalty 2 * logger.elem(a, b, c, d) // penalty 3, etc. * }}} * * If false, matches pre-v0.5 behavior. Note. this option may be * removed in a future release. 3 ެࣜαΠτʹ͕ͬͭΓͨ͠આ໌ͳ͠ɻ trueͷ߹ɺҾ͕ෳ͋Δͱ͖ʹվߦͯ͠ྻͤ͞Δ penalizeSingleSelectMultiArgList
22 => 222 } “some”ͷ߹(default): x match { case 2 => 22 case 22 => 222 } val x = 2 val xx = 22 case object B extends A case object BB extends A “more”ͷ߹: x match { case 1 => 1 -> 2 case 11 => 11 -> 22 } val x = 2 val xx = 22 case object B extends A case object BB extends A for { x <- List(1) yyy <- List(2) zzz <- new Integer { def value = 3 } } yield x * yyy “most”ͷ߹: x match { case 1 => 1 -> 2 case 11 => 11 -> 22 } val x = 2 val xx = 22 case object B extends A case object BB extends A for { x <- List(1) yyy <- List(2) zzz <- new Integer { def value = 3 } } yield x * yyy ΞϥΠϝϯτ(ྻ)ܥʹ͍ܾͭͯΊΔɻ 4