Motoko indendation: 2 spaces or 4 spaces?

Hi devs, I have a question about Motoko indentation.

“dfx new” cmd generates the default greet Motoko codes with 4 spaces indentation.
But, the Motoko style guideline recommends 2 spaces.

What do you think about this diff?

I agree with the rationale written in the Motoko style guideline because nested switch-case expression is often used in Motoko codes.

“Rationale: There may be a lot of nesting. Using only 2 spaces avoids wasting screen estate.”

So IMO, “dfx new” should also generate the default codes with 2 spaces indentation to avoid confusion.



Tracked here Motoko template project should follow motoko style guidlines. · Issue #1986 · dfinity/sdk · GitHub

1 Like