3.1.3 • Published 28 days ago

@looker/look-at-me-sideways v3.1.3

Weekly downloads
566
License
UNLICENSED
Repository
github
Last release
28 days ago

Look At Me Sideways (LAMS)

>_>

LAMS is a style guide and linter for Looker's LookML data modeling language. It is designed to help a team of developers to produce more maintainable LookML projects.

  • The style guide alone can help your project, even without enforcement by the linter.
  • The linter can be configured to enforce rules from the style guide for all commits to your master branch.
  • The linter also allows you to conveniently specify custom rules to enforce.
  • In addition to enforcing rules, the linter also produces markdown files to help developers navigate the project.

Interested? See a video of LAMS in action!

LAMS video

Contents

Functionality & Features

Predefined Linter Rules

The linter currently enforces rules K1-4, F1-4, E1-2, and T1-10 from the style guide.

It currently does not resolve extends references, so if you are complying with a rule via extension, use a rule exemption as noted below.

Rule Exemptions

You can opt-out of rules either globally or granularly using rule_exemptions.

The rule exemption syntax encourages developers to document the reason for each such exemption:

view: rollup {
  sql_table_name: my_table ;;

  # LAMS
  # rule_exemptions: {
  #  K3: "2018-11-12 - Dimensions are out of order for reason X and Bob said it's ok"
  # }
  dimension: info {...}
  ...

Note: For large projects with many exemptions, we suggest starting the reasons with the Y-M-D formatted date on which they were added, for easier review in your issue report.

If you want to entirely opt-out of checking a particular rule, you can specify the exemptions in your project's manifest.lkml file. See customizing LAMS for additional details.

Custom Rules

In addition to linting against its style guide, LAMS also lets you specify your own rules. See Customizing LAMS.

Output

Once LAMS has evaluated your project against the necessary rules, the resulting list of messages are communicated back to you through one of several output modes.

The default mode is a human-readable tabble logged to the command line / stdout, where each line represents a distinct message:

"Lines" output example

Another available output mode is formatting the messages into a markdown file in your project, so that they can be viewed in Looker's IDE. Here is an example of a resulting markdown file as displayed in Looker:

"Markdown" output example

Deployment Examples

Although LAMS can be deployed in many ways to fit your specific CI flow, we have put together a few examples and resources to get you up and running quicker. (If you'd like to contribute your configuration, get in touch!)

Regardless of which example you follow, we recommend pinning your LAMS version to a particular major version.

  • Local Interactive Usage - To use LAMS with the least overhead for simple interactive local use and testing:
npm install -g @looker/look-at-me-sideways@2
cd <your-lookml-project>
lams
  • Github Action - This option is very quick to get started if you're using Github, and offers a compromise between convenience of setup and per-commit run performance.

The following examples were prepared for v1 of LAMS, though updating them for v2 should be straightforward. Please review v2 release notes for details. In particular, look for error messages on the console's standard output rather than a file output to be committed back to the repo.

  • GitLab CI - A community-contributed configuration for GitLab, which offers similarly low overhead as our dockerized Jenkins configuration
  • Dockerized Jenkins Server - We have provided a Docker image with an end-to-end configuration including a Jenkins server, LAMS, and Github protected branches & status checks configuration.
  • CircleCI - A community-contributed configuration for CircleCI (external link)

Configuration

Command-line arguments

  • reporting - Required. One of yes, no, save-yes, or save-no. See PRIVACY.md for details.
  • report-user - An email address to use in reporting. See PRIVACY.md for details.
  • report-license-key - A Looker license key to use in reporting. See PRIVACY.md for details.
  • output - A comma-separated string of output modes from among: lines (default), markdown, markdown-developer, jenkins, legacy-cli
  • source - A glob specifying which files to read. Defaults to **/{*.model,*.explore,*.view,manifest}.lkml.
  • cwd - A path for LAMS to use as its current working directory. Useful if you are not invoking lams from your LookML repo directory.
  • project-name - An optional name for the project, used to generate links back to the project in mardown output. Specifying this in manifest.lkml is preferred.
  • manifest - A JSON-encoded object to override any properties that are normally set via the manifest.lkml file.
  • on-parser-error - Set to "info" to indicate that LookML parsing errors should not fail the linter, but yield an info level message instead (not all output modes display info level messages)
  • verbose - Set to also output verbose level messages, for output modes that support it (lines)
  • date-output - Set to "none" to skip printing the date at the top of the issues.md file.
  • allow-custom-rules - Experimental and not recommended. Used to approve the running of Javascript-based custom rules. DO NOT USE TO RUN UNTRUSTED CODE. See custom rules for details.

Manifest.lkml arguments

If your LookML project doesn't have a manifest.lkml file, you may want to consider adding one! LAMS uses the following information from your project's mainfest.lkml file:

  • name - Recommended. A name for the project, used to generate links back to the project in mardown output. If the native LookML validator complains about an unnecessary project name, you can use a conditional #LAMS comment to specify it.
  • rule_exemptions - Optional. Used to entirely opt out of rules. See customizing LAMS
  • rule: rule_name - Optional. Used to specify custom rules. See customizing LAMS

About

Release Notes

Privacy Policy

LAMS respects user privacy. See PRIVACY.md for details.

License

LAMS is Copyright (c) 2018 Looker Data Sciences, Inc. and is licensed under the MIT License. See LICENSE.txt for license details.

Support

LAMS is NOT officially supported by Looker. Please do not contact Looker support for issues with LAMS. Issues may be reported via the Issues tracker, but no SLA or warranty exists that they will be resolved.

Authors

LAMS has primarily been developed by Joseph Axisa and Fabio Beltramini. See all contributors

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/looker-open-source/look-at-me-sideways.

Trying to install LAMS for development?

git clone git@github.com:looker-open-source/look-at-me-sideways.git
cd look-at-me-sideways
mv npm-shrinkwrap.dev.json npm-shrinkwrap.json 
npm install

Publishing an update? The following hooks will run:

npm version {minor|major|patch}
> Pre-verion: npm run lint-fix
> Pre-verion: npm run test

npm publish
> Pre-publish: npm shrinkwrap
> Pre-publish: mv npm-shrinkwrap.json npm-shrinkwrap.dev.json
> Pre-publish: npm prune --prod
> Pre-publish: npm shrinkwrap

Code of Conduct

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributer Covenant Code of Conduct. Concerns or incidents may be reported confidentially to fabio@looker.com.

Other LookML Linting Projects

Like LAMS but looking to shop around a bit? The community has come up with a few othre LookML linting options:

Or if you want to write your own, you may want to start with one of these LookML parsers:

>_>

2.1.8

28 days ago

3.1.3

28 days ago

3.1.2

7 months ago

3.1.1

9 months ago

3.1.0

9 months ago

3.0.0-beta.1

12 months ago

3.0.0

11 months ago

3.0.0-beta.0

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.5.3

2 years ago

1.6.1

2 years ago

1.5.2

2 years ago

1.6.0

2 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.9.0

5 years ago