Lint your LookML with lookmlint!


(Ryan Tuck) #1


I just open-sourced lookmlint, a linter I built for LookML.

lookmlint is a configurable CLI that runs various checks on your LookML repo to catch style issues, unused views, semicolons in derived table SQL, raw SQL references in joins, and more.

We use it internally here at Warby Parker as part of our CI process, ensuring all lint checks have passed before merging in PRs.

It’s written in python and is available via pip:

$ pip install lookmlint

Under the hood, this tool leverages (and was inspired by) the excellent lookml-parser CLI, written by @fabio - thanks!


Specify checks to run against your lookml repo:

$ lookmlint lint ~/src/lookmlint/examples/sample_repo/ --checks label-issues,views-missing-primary-keys

  View: order_items
    - Qty: ['Qty']
    - Unit Cost Usd: ['USD']

- order_items

Output as JSON:

$ lookmlint lint ~/src/lookmlint/examples/sample_repo/ --checks label-issues --json
    "label-issues": {
        "fields": {
            "order_items": {
                "Qty": [
                "Unit Cost Usd": [

Or run all checks:

$ lookmlint lint ~/src/lookmlint/examples/sample_repo/

Model: test
  Explore: inventory_transfers
    Inventory Locations: 2

  View: order_items
    - Qty: ['Qty']
    - Unit Cost Usd: ['USD']

Please feel free to give it a whirl, and bubble up any feedback here or over on github. Happy linting!

(fabio) #2

Thanks for the shoutout and for building something awesome! A colleague and I are actually working on a linter of our own as well :slight_smile: We’re just a week or two away from sharing it.

(Ryan Tuck) #3

of course - looking forward to checking it out!

(Izzy) #4

This is super cool! Thanks for making it open source for everyone to use :slight_smile:

(longfei) #5

Great! Fabio, any news on the linter of your own?

(fabio) #6

We’re still working on the documentation around how to deploy it with Github & CI (Jenkins), but the linter itself is ready if you want to preview it: . Be warned though, our ruleset is quite opinionated!

(longfei) #7

Thanks Fabio, very exciting. Looking forward when it’s all ready to go!

(Mateus Lopes) #8

@Ryan_Tuck @fabio Oh My God! Here in Youse we’re working on in a similar feature to improve the code quality. I’m very excited with the good news and let me know if you need any support/help

(fabio) #9

Glad to hear it. At this point, the biggest help would be feedback - so let me know what about the linter works or doesn’t work for you!

(fabio) #10

Our linter is now officially launched too!