grafana / lezer-logql

LogQL lezer grammar
Apache License 2.0
3 stars 4 forks source link

Add LogQL formatter #29

Closed gwdawson closed 1 year ago

gwdawson commented 1 year ago

how to test this pr:

in grafana/lezer-logql:

  1. checkout to this branch
  2. build lezer from this branch

in grafana/grafana

  1. checkout to the branch gareth/prettify-query
  2. make sure you have enabled the feature flag lokiFormatQuery
  3. add the following to package.json
    "resolutions": {
    "@grafana/lezer-logql": "portal:/path/to/your/repo/lezer-logql/dist"
    }

! grafana should now be using this build of lezer, try formatting some queries.

matyax commented 1 year ago

Before merging this I would:

gwdawson commented 1 year ago

@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 🙂