Introducing LAMS, a LookML style guide and linter

The Problem

A frequently asked question by those that develop in Looker is around how to write code that is reusable, self-explanatory and reliable. This is often because they have been working on the same model for a significant period of time, very often with multiple contributors, and it has become bloated and very hard to maintain and build upon.

The Why

Look At Me Sideways (LAMS) seeks to address this problem by:

  1. Helping developer teams adhere to best practices
  2. Aiding anyone interested in cleaning and refactoring their LookML model
  3. Ensuring consistency and a certain level of code quality
  4. Automating the pull request review process for those that enforce them
  5. Maintaining a clean master branch at all times

The How

LAMS is a linter and a style guide that picks up and flags anti-patterns or anything that deviates from recommended LookML constructs. It also explains exactly what’s wrong as well as provides common best-practice solutions and/or alternatives. The style guide itself is intended to evolve over time as new conventions are identified, suggested and/or potentially contributed by the community it supports.

In order to get the most of out it, it is recommended to run it in your CI environment. When set up like this, the workflow involves four steps. It all starts when a developer commits new code from the Looker IDE (Step 1). GitHub then sends off a webhook to the server hosting LAMS asking it to check the new code (Step 2). Once LAMS does this, it adds the result files to the trigger branch (Step 3) and the user will be prompted to pull the files from his remote branch (Step 4). The entire process takes a few seconds at most and is entirely seamless, providing everything that the developer needs from within the platform.

WUzCNYc2_0_pxwdw2lsSw8WJ621U4UEQNYaCPBzimUGypQs0db4YR1e_fbxJYeDeIhzST0gETkUkeyQqxGBucnZRo4qS6l-u2vKPAwie5mSzHbaMGHHxadTalotfiYeZdaOj7CE4


See a video of LAMS in action:

LAMS video

https://vimeo.com/313492643/30c4e0175c

The Setup

LAMS can be installed either as a standalone npm package using these instructions or deployed in your CI environment. The latter is highly recommended but since it can be quite an involved process, we are also shipping it with a dockerized version that contains a fully functional Jenkins server with a pre-configured job. This will allow you to get setup in just a few minutes and hit the ground running. If you want to contribute to the project, check it out on github.

LAMS is developed and maintained by Fabio Beltramini (aka @fabio1) and Joseph Axisa (aka @jax1)

14 14 6,063