#Is their a `zigfmt` like `rustfmt`?

1 messages · Page 1 of 1 (latest)

fathom yew
#

The title pretty much sums it up.

unkempt bough
#

zig fmt
fmt Reformat Zig source into canonical form

fathom yew
#

Nice, also worth asking, if their a equivalent to clippy?

unkempt bough
#

not that I know of

fathom yew
#

Another tooling question, how do I generate documentation from the doc comments? (something like cargo rustdoc)

unkempt bough
#

ah

#

i know there used to be a cmd line switch

#

but i think now it's a target option, ie exe.emit_docs = .emit

ebon skiff
#

I think as a command line swith it's -femit-docs=path/to/docs or just -femit-docs for a default location. It currently needs to happen alongside a build, but you can use -fno-emit-bin to cancel the build part.

languid imp
#

speaking about fmt, is there a way to configure it to change some behavior?

frail bone
#

nope, by design

languid imp
#

yep, that's what I was afraid of 🙂 . I cannot use it then, but understandable.

orchid trench
#

is there one particular thing on which it's not right for you?

languid imp
#

it's purely cosmetic, but I like

const var1         = 12;
const var_longname = 14;```
and fmt is breaking that. (for 2 variables it's ok, but when you have 10 or more it becomes a lot easier to read)
brazen basin
languid imp
#

fantastic ! I didn't know will try that. thanks

stuck helm
#

zig fmt is nice until it isn't I find. There are times when you want to have multiple while or for that are essentially just unwrapping values but don't want to see them as "nested" - this is when zig fmt becomes a bit annoying for me

#

There are also other things like value alignment

ebon skiff