-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LogQL formatter #29
Conversation
Before merging this I would:
|
expect(formatLokiQuery(`{label=""} | label=10s`)).toBe(`{label=""}\n | label=10s`); | ||
expect(formatLokiQuery(`{label=""} | label=1GB`)).toBe(`{label=""}\n | label=1GB`); | ||
expect(formatLokiQuery(`{label=""} | label=42`)).toBe(`{label=""}\n | label=42`); | ||
// expect(formatLokiQuery(`{label=""} | labelA="A" and labelB="B"`)).toBe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are commented out because they are failing.
these fixes are on my todo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! The implementation looks really really clean! 👏 👏 👏 👏
Is there anything pending?
@matyax besides the few bugs that are on the radar i believe this is ready so we can get an experimental version running in grafana 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's gooooo! 🚀 ☄️
how to test this pr:
in grafana/lezer-logql:
in grafana/grafana
gareth/prettify-query
lokiFormatQuery
! grafana should now be using this build of lezer, try formatting some queries.