Skip to content

blockStateCommaSpacing

SPGoding edited this page Apr 26, 2020 · 1 revision

Rule Details

🎨 Stylistic: this is a stylistic rule used by the formatting feature.

Enforce spacing around commas in block states. No matter what the settings are, spaces after trailing commas are always removed.

  • (object) Root.
    • before: (number) the number of spaces before the comma.
    • after: (number) the number of spaces after the comma.

Examples

Default

{
    "blockStateCommaSpacing": { "before": 0, "after": 1 }
}

👍 Good

setblock ~ ~ ~ minecraft:stone_button[face=ceiling, powered=true]

👎 Bad

setblock ~ ~ ~ minecraft:stone_button[face=ceiling,powered=true]
setblock ~ ~ ~ minecraft:stone_button[face=ceiling ,powered=true]
setblock ~ ~ ~ minecraft:stone_button[face=ceiling , powered=true]

Dense

{
    "blockStateCommaSpacing": { "before": 0, "after": 0 }
}

👍 Good

setblock ~ ~ ~ minecraft:stone_button[face=ceiling,powered=true]

👎 Bad

setblock ~ ~ ~ minecraft:stone_button[face=ceiling, powered=true]
setblock ~ ~ ~ minecraft:stone_button[face=ceiling ,powered=true]
setblock ~ ~ ~ minecraft:stone_button[face=ceiling , powered=true]

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally