Linting rules for dashboard YAML configurations
Project description
kb-dashboard-lint
Linting rules for Kibana dashboard YAML configurations.
Overview
This package provides a configurable linting system that flags potentially problematic
dashboard configurations based on best practices and style guidelines. It works with
validated Pydantic models from kb-dashboard-core.
Installation
pip install kb-dashboard-lint
Or with uv:
uv add kb-dashboard-lint
Usage
CLI
# Check dashboards in a directory
kb-dashboard-lint check --input-dir ./inputs
# Check a single file
kb-dashboard-lint check --input-file dashboard.yaml
# Use custom configuration
kb-dashboard-lint check --config .dashboard-lint.yaml
# Only fail on errors (not warnings)
kb-dashboard-lint check --severity-threshold error
Programmatic API
from kb_dashboard_lint import check_dashboards
from kb_dashboard_core import load
# Load dashboards
dashboards = load('inputs/')
# Run linting
violations = check_dashboards(dashboards)
for violation in violations:
print(f"{violation.severity}: {violation.rule_id} - {violation.message}")
Built-in Rules
| Rule ID | Description | Default |
|---|---|---|
dashboard-dataset-filter |
Dashboard should have a data_stream.dataset filter |
warning |
datatable-row-density |
Large datatables should consider compact density | info |
dimension-missing-label |
Dimensions should have explicit labels | info |
esql-where-clause |
ES|QL queries should include a WHERE clause | info |
gauge-goal-without-max |
Gauges with goals should define maximum values | warning |
markdown-header-height |
Markdown panels with headers must have height >= 3 | warning |
metric-multiple-metrics-width |
Multi-metric panels need adequate width | warning |
metric-redundant-label |
Metric primary label matching title should use hide_title: true |
warning |
panel-description-recommended |
Panels should have descriptions for accessibility | info |
panel-height-for-content |
Chart types have appropriate minimum heights | warning |
panel-min-width |
Panels should have minimum width for readability | warning |
pie-chart-dimension-count |
Multi-level pie charts may be hard to read | info |
Configuration
Create a .dashboard-lint.yaml file:
extends: default
rules:
markdown-header-height:
severity: error
esql-where-clause:
enabled: false
Development
# Install dependencies
make install
# Run CI checks
make ci
# Run tests
make test
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kb_dashboard_lint-0.2.4.tar.gz.
File metadata
- Download URL: kb_dashboard_lint-0.2.4.tar.gz
- Upload date:
- Size: 33.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2948995f8ed35add41097e16f1c41a527e625af4513eb0e67c965a7071766529
|
|
| MD5 |
77368e5395fca8d4e4b0e97f3cf4c7ee
|
|
| BLAKE2b-256 |
2b5155065f7e7e6c3214bc7e87492c447689ca5dfa3a5ad1dc34ad8fd6b534f9
|
File details
Details for the file kb_dashboard_lint-0.2.4-py3-none-any.whl.
File metadata
- Download URL: kb_dashboard_lint-0.2.4-py3-none-any.whl
- Upload date:
- Size: 62.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e672e0b82b05fb651bd655c78a79d497ae0c2377160d6f50d59e6ba6151e722f
|
|
| MD5 |
3a67dc402d015295f53afc632f76d718
|
|
| BLAKE2b-256 |
5bd73eee8da01daa9a5b0b0e76de7f00fb1b366878eda68ef67e965035bdc174
|