Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/readme #14

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
[![Action Tests](https://github.com/alhankeser/looker-janitor/actions/workflows/action_tests.yml/badge.svg)](https://github.com/alhankeser/looker-janitor/actions/workflows/action_tests.yml)

[![Python Tests](https://github.com/alhankeser/looker-janitor/actions/workflows/tests.yml/badge.svg)](https://github.com/alhankeser/looker-janitor/actions/workflows/tests.yml)
[![Action Tests](https://github.com/alhankeser/looker-janitor/actions/workflows/action_tests.yml/badge.svg)](https://github.com/alhankeser/looker-janitor/actions/workflows/action_tests.yml) [![Python Tests](https://github.com/alhankeser/looker-janitor/actions/workflows/tests.yml/badge.svg)](https://github.com/alhankeser/looker-janitor/actions/workflows/tests.yml)

## Looker Janitor
Clean your Looker LookML view files:
- Order field types (e.g. filters, dimensions, measures)
- Order fields (including by label and localized labels if need be)
- Order field parameters (e.g. type, label, description, sql...)
- Move primary key to top of dimensions list
- And more!
- Check for missing field parameters and report in `%f:%l: %m` format

## Getting Started

Expand Down Expand Up @@ -71,6 +69,23 @@ Override the default and don't put primary key first in list of dimensions:
python main.py --files samples/example_input.view.lkml --primary_key_first false
```

Check for required parameters and specify what parameters are required for measures:
```shell
python main.py --files samples/example_input.view.lkml \
--check_required_params true \
--required_dimension type label \
--required_measure value_format_name
```
The following will get printed out:
```
samples/example_input.view.lkml:29: dimension 'customer_id' missing label
samples/example_input.view.lkml:34: dimension 'order_date' missing label
samples/example_input.view.lkml:39: dimension 'order_status' missing label
samples/example_input.view.lkml:52: measure 'average_order_value' missing value_format_name
samples/example_input.view.lkml:59: measure 'count' missing value_format_name
samples/example_input.view.lkml:65: measure 'total_sales' missing value_format_name
```

## Default settings

Below are the default settings for each parameter:
Expand Down Expand Up @@ -113,3 +128,6 @@ Below are the default settings for each parameter:

**order_field_parameters**:
- true

**check_required_params**:
- false
Loading