Skip to main content

Pytest-friendly Vale harness and assertions for rule authors

Project description

valedate

Reusable Vale testing harness and pytest assertions for rule authors. The package bundles the Valedate sandbox first introduced in concordat-vale so you can lint fixtures against isolated, temporary styles trees without touching your global Vale configuration.

Requirements

  • Python 3.10+
  • A vale binary available on PATH (no mocks or stubs are provided)

Quick start

from valedate import Valedate, assert_has_diagnostic

ini = {
    "__root__": {"MinAlertLevel": "suggestion"},
    "[*.md]": {"BasedOnStyles": "Test"},
}

styles = {
    "Test/NoFoo.yml": """
        extends: existence
        message: "Avoid 'foo'."
        level: warning
        tokens:
          - foo
    """,
}

with Valedate(ini, styles=styles) as env:
    diags = env.lint("foo is discouraged")
    assert_has_diagnostic(diags, check="Test.NoFoo")

Run the test suite with make test to validate that your rules behave as Vale reports them.

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

valedate-0.1.0b1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

valedate-0.1.0b1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file valedate-0.1.0b1.tar.gz.

File metadata

  • Download URL: valedate-0.1.0b1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for valedate-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 a00a67a4f6529222106b5a39a773efbc2a1c0abbf43744e662798644cd250226
MD5 fca0c74415ecd48a17cebaa945dc482e
BLAKE2b-256 edccd224db07b9ece20660eebe82931f70ce8e4bdf39acf1cd6e6261cf19e1f1

See more details on using hashes here.

File details

Details for the file valedate-0.1.0b1-py3-none-any.whl.

File metadata

  • Download URL: valedate-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for valedate-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 7929857e78fbf6997d0d970a234255d9a60840a7435f16879ad71190473b8a43
MD5 a9ffbe284abec1cac3412cb325a3a6bc
BLAKE2b-256 ef55f035766f327836f6a7d3e2ccf052c86377fa1fba309b38703dff4224cb71

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