-
The clarity formatter has been released in beta and we're looking for feedback. We're open to your ideas and bug reports. The LSP integration is coming next, but for now you can use the cli with |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 17 replies
-
This is great! I'm loving it, but just have a few issues I've noticed so far.
(define-constant WAITING_PERIOD u144) ;; 24 hours in blocks
|
Beta Was this translation helpful? Give feedback.
-
After running
|
Beta Was this translation helpful? Give feedback.
-
In general, I am for much less new lines. The below means so much scrolling..
And we save 1 char for each line. |
Beta Was this translation helpful? Give feedback.
-
I'd like to hear people opinion regarding one-lining or not function arguments and let bindings when there is only one argument or binding. Arguments(define-public (add
(n uint)
)
(ok (var-set count (+ (var-get count) n)))
) vs (define-public (add (n uint))
(ok (var-set count (+ (var-get count) n)))
) Let(define-public (decrement)
(let (
(current-count (var-get count))
)
(asserts! (> current-count u0) ERR_COUNT_MUST_BE_POSITIVE)
(ok (var-set count (- current-count u1)))
)
) vs (define-public (decrement)
(let ((current-count (var-get count)))
(asserts! (> current-count u0) ERR_COUNT_MUST_BE_POSITIVE)
(ok (var-set count (- current-count u1)))
)
) Note: If there are multiple arguments or let bindings, they should always be on new lines imo |
Beta Was this translation helpful? Give feedback.
This is great! I'm loving it, but just have a few issues I've noticed so far.
If I use the
;;;
style for documentation comments, the formatter changes it to;; ;
I'm not sure I fully understand how it is deciding if two or more closing
)
s should be on the same line, or separate lines. This definitely seems like a personal preference thing, so I think I'd be okay with either option, but it seems inconsistent currently.