This directory contains Python scripts used to support this repository's test suite and development workflow.
verify_markdownlint_fixtures.py- Verifies markdownlint test fixtures in
md_test_files/against expectations inmd_test_files/expected_errors.yml. - Positive fixtures (
positive_*.md) must pass with zero errors; negative fixtures (negative_*.md) must fail with the errors listed inexpected_errors.yml. - Used by
make test-markdownlintand themarkdownlint-testsGitHub Actions workflow.
- Verifies markdownlint test fixtures in
test_verify_markdownlint_fixtures.py- Unit tests for the fixture verifier (parsing, expectations, etc.).
Run via
make test-python.
- Unit tests for the fixture verifier (parsing, expectations, etc.).
Run via
- Functional tests (exercise markdownlint rules; require Node.js and markdownlint-cli2):
- Rule-options tests -
test_markdownlint_options.pyuses the config helper to run markdownlint with temp configs and assert rule behavior. Run viamake test-markdownlint-options. - Fix tests - one script per custom rule with
fixInfo; each runs markdownlint then--fixand asserts file content. Run viamake test-markdownlint-fix.test_fix_ascii_only.py- ascii-onlytest_fix_heading_numbering.py- heading-numberingtest_fix_heading_title_case.py- heading-title-case (including link text title case)test_fix_no_heading_like_lines.py- no-heading-like-linestest_fix_no_tables.py- no-tables (when convert-to is list)test_fix_one_sentence_per_line.py- one-sentence-per-line
- Rule-options tests -
markdownlint_config_helper.py- Shared helper for functional tests: creates an alternate markdownlint config (in a temp dir), runs markdownlint with that config, then cleans up.
Use
temp_markdownlint_config(overrides)orrun_markdownlint_with_config(overrides, paths, fix=...)to exercise rule options without modifying the repo config.
- Shared helper for functional tests: creates an alternate markdownlint config (in a temp dir), runs markdownlint with that config, then cleans up.
Use
- Python 3
Node.jsand npm (the verifier runsmarkdownlint-cli2via the repo'snode_modulesornpx)
-
Run the markdownlint fixture suite:
make test-markdownlintUse
VERBOSE=1to print each fixture as it is verified:make test-markdownlint VERBOSE=1. -
Run Python unit tests (verifier logic only; test_verify_*.py):
make test-python -
Run functional tests that exercise markdownlint rules (require Node.js):
- Rule-options:
make test-markdownlint-options - Fix tests:
make test-markdownlint-fix
- Rule-options:
-
Run Python linting for these scripts:
make lint-python
Python lint tooling is listed in test-scripts/requirements-lint.txt.
You can install it into a local venv with:
make venv