lookmlint
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
usage
Specify checks to run against your lookml repo:
$ lookmlint lint ~/src/lookmlint/examples/sample_repo/ --checks label-issues,views-missing-primary-keys
Error:
label-issues
------------
Fields:
View: order_items
- Qty: ['Qty']
- Unit Cost Usd: ['USD']
views-missing-primary-keys
--------------------------
- order_items
Output as JSON:
$ lookmlint lint ~/src/lookmlint/examples/sample_repo/ --checks label-issues --json
{
"label-issues": {
"fields": {
"order_items": {
"Qty": [
"Qty"
],
"Unit Cost Usd": [
"USD"
]
}
}
}
}
Or run all checks:
$ lookmlint lint ~/src/lookmlint/examples/sample_repo/
Error:
duplicate-view-labels
---------------------
Model: test
Explore: inventory_transfers
Inventory Locations: 2
label-issues
------------
Fields:
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!