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
valebinary available onPATH(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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a00a67a4f6529222106b5a39a773efbc2a1c0abbf43744e662798644cd250226
|
|
| MD5 |
fca0c74415ecd48a17cebaa945dc482e
|
|
| BLAKE2b-256 |
edccd224db07b9ece20660eebe82931f70ce8e4bdf39acf1cd6e6261cf19e1f1
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7929857e78fbf6997d0d970a234255d9a60840a7435f16879ad71190473b8a43
|
|
| MD5 |
a9ffbe284abec1cac3412cb325a3a6bc
|
|
| BLAKE2b-256 |
ef55f035766f327836f6a7d3e2ccf052c86377fa1fba309b38703dff4224cb71
|