#Configuring zig fmt

1 messages · Page 1 of 1 (latest)

foggy thicket
#

Any ideas on how zig fmt may be configured? For example, specifying white space and line limit configurations?

ocean field
#

zig fmt has no configuration options, by design.
However, if you have a complex piece of code that is very hard to read after formatting, like large multidemensional arrays, you can use the comments // zig fmt: off and // zig fmt: on around the block. I'd use it sparingly of course

foggy thicket
ocean field
#

Not to my knowledge, and I certainly wouldn't recommend it anyway. Many of Zig's choices are guided by prioritizing the reading of code, and universally-consistent formatting rules are in support of that value