One subject that I don't see covered in the doc is spacing. There are
several places where whitespace is optional, and it would be good to have a
consistent opinion on it.

* Between label selectors {foo="foo",bar="bar"} vs {foo="foo", bar="bar"}
* Between params: histogram_quantile(0.9, rate(...))
* Between aggregation operator modifiers: sum without(label)(metric_name)
vs sum without(label) (metric_name) vs sum without (label) (metric_name)

My personal prefernce is
* No whitespace between label selectors.
* A single whitespace between params.
* Whitespace on both sides of operator modifiers. IE sum without (label)
(metric_name)

On Sat, Jun 20, 2020 at 1:22 PM Tobias Schmidt <tob...@gmail.com> wrote:

> Thanks a lot for your great work! Expression formatting will likely
> require dozens of detailed rules in order to get things consistent, and
> style discussions are the perfect case for bikeshedding. I really
> appreciate your efforts and can't wait for a `promtool fmt` on-save editor
> integration. The proverb of Go has arguably held true: Gofmt's style is
> no one's favorite, yet gofmt is everyone's favorite
> <https://www.youtube.com/watch?v=PAAkCSZUG1c&t=8m43s>.
>
> I hope we can get it right without having to make (large) changes in later
> releases. The most annoying thing with auto-formatters is changing rules
> with every release creating constant diff noise (looking at you rubocop).
>
> <https://www.youtube.com/watch?v=PAAkCSZUG1c&t=8m43s>
>
> On Fri, Jun 19, 2020 at 3:19 PM Harkishen Singh <
> harkishensingh...@gmail.com> wrote:
>
>> Hello everyone!
>>
>> As part of the GSoC 2020, I am working on designing a Promql expression
>> formatting/prettifying tool whose support will be as an extension in the
>> current promtool. A design document related to the same has been made and
>> it would be great for some comments/views/suggestions, etc.
>>
>> Here is the link to the document: PromQL prettier
>> <https://docs.google.com/document/d/1nOBjpuCk4CsrOSm2ZjfVz2EL6gmA_CFGSbHCdY0Royg/edit?usp=sharing>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prometheus Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to prometheus-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-developers/0e1b1867-b818-4afe-a970-1bbc21046844o%40googlegroups.com
>> <https://groups.google.com/d/msgid/prometheus-developers/0e1b1867-b818-4afe-a970-1bbc21046844o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/CAChBsdDHBjphxKUc_%3D7bcKuPoorGPxiy5duYqzvXM%2B3jNoNC%3Dw%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CAChBsdDHBjphxKUc_%3D7bcKuPoorGPxiy5duYqzvXM%2B3jNoNC%3Dw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/CABbyFmocCQV0z9DiQ%2BDODmp0tC-ZNBGWgcf8GzsqaXJdGzc0Zg%40mail.gmail.com.

Reply via email to