Skip to main content

CI-friendly linter for MESA semantic profiles: mesa_profile.json sidecars and mesa-core profile stores.

Project description

mesa-lint

Linter for MESA semantic profiles. Run it in CI against the mesa_profile.json sidecar your Home Assistant integration ships, or point it at a mesa-core profile store directory to sweep an entire deployment.

pip install mesa-lint

mesa-lint custom_components/my_integration/mesa_profile.json   # developer CI mode
mesa-lint /config/mesa/                                        # operator store mode

Exit code 0 means clean, 1 means findings failed the run, 2 means usage error. Warnings do not fail the run unless you pass --strict.

What it checks

Errors are profiles mesa-core itself would reject: invalid enums, malformed inferred profiles, bad predicate operators or temporal constraints, tag format violations, vendor tags squatting on canonical namespace roots, a non-boolean is_minor. The validator inside mesa-core stays the single source of truth; mesa-lint never redefines validity.

Warnings are valid but inadvisable: trust-laundering markers, confirm/prohibited without a control_reason, person entities missing their required privacy classification, triggers_automations: none on helper domains, semantic_meaning prose long enough to bloat agent context, absent metadata_origin.

Cross-checks (store directories only)

# Catch stale triggers_automations: none declarations against real automations
mesa-lint /config/mesa/ --automations automations.json

# Find profiles orphaned by entity renames
mesa-lint /config/mesa/ --entities entities.txt

--automations accepts JSON natively, or YAML with pip install 'mesa-lint[yaml]'. --entities takes one entity ID per line.

CI usage

- run: pip install mesa-lint
- run: mesa-lint custom_components/my_integration/mesa_profile.json --strict

--format json emits machine-readable findings for CI annotations.

Development

pip install -e ".[dev]"
pytest tests/ -v
ruff check . && mypy

mesa-lint depends only on mesa-core (plus optional pyyaml). Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mesa_lint-0.1.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mesa_lint-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file mesa_lint-0.1.0.tar.gz.

File metadata

  • Download URL: mesa_lint-0.1.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for mesa_lint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba5a2c3c49ed4634f43232edd5a35234b11b85c5a5e5d237e2898f15496b8345
MD5 c00e241ededdceb29328d60a2b0d5e19
BLAKE2b-256 bee0ce85a32af01b22c9c463693fa48a4d41b66166cd5565503ba78f606ed4b7

See more details on using hashes here.

File details

Details for the file mesa_lint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mesa_lint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for mesa_lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6c737189d1d6662c2477f69966a9bce8f3c1f051f22118fce6e99e2a73e6855
MD5 64a1fc6b25590d0ffc5aee5f80d9df71
BLAKE2b-256 e5e1132a0307857170c2460567d9e9b862051c044b65703dfac01df2f3bfb478

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page