Skip to main content

An LSP for Docassemble YAML interviews

Project description

DAYamlChecker

An LSP for Docassemble YAML Interviews

How to run

pip install .
python3 -m dayamlchecker `find . -name "*.yml" -path "*/questions/*" snot -path "*/.venv/*" -not -path "*/build/*"` # i.e. a space separated list of files

WCAG checks

The checker includes WCAG-style checks for clear static accessibility failures in interview source. These checks run by default; use --no-wcag to disable them.

python3 -m dayamlchecker path/to/interview.yml          # WCAG checks on (default)
python3 -m dayamlchecker --no-wcag path/to/interview.yml  # WCAG checks off
python3 -m dayamlchecker --accessibility-error-on-widget combobox path/to/interview.yml  # opt into combobox failures

Some accessibility checks are behind runtime options while the rules are still being evaluated. Right now combobox failures are default-off and can be enabled with --accessibility-error-on-widget combobox.

Style checks

Assembly Line style checks are opt-in. Enable them with --style to run deterministic style and translatability findings ported from ALLinter without duplicating the checker’s existing YAML, accessibility, or URL coverage.

Translatability findings have their own translatability finding class and use WT warning codes. They include translated choice labels that lack invariant stored values, user-facing strings embedded in code, and conditional expressions or Mako blocks that change only part of a sentence.

python3 -m dayamlchecker --style --no-url-check path/to/interview.yml
python3 -m dayamlchecker --style-llm --openai-api-key "$OPENAI_API_KEY" path/to/interview.yml
OPENAI_BASE_URL=https://api.openai.com/v1 OPENAI_API_KEY=... python3 -m dayamlchecker --style-llm path/to/interview.yml

--style-llm also enables --style. It reads OPENAI_BASE_URL, OPENAI_API_KEY, and OPENAI_MODEL from the environment when flags are not provided. The checker only emits sanitized configuration/request errors for LLM-backed style rules and does not print the credential values.

For Python callers, use the module helper instead of shelling out:

from dayamlchecker import RuntimeOptions, find_style_findings_from_string

findings = find_style_findings_from_string(
    interview_yaml,
    input_file="interview.yml",
    runtime_options=RuntimeOptions(style_include_llm=True),
)

URL checks

The main dayamlchecker CLI also runs the URL checker by default. Broken URLs in question files fail the command; broken URLs in related data/templates files are warnings by default. Use --no-url-check to skip it, or tune it with flags such as --url-check-timeout, --url-check-ignore-urls, --url-check-skip-templates, --template-url-severity, and --unreachable-url-severity.

Current accessibility checks focus on objective failures only:

  • Missing alt text in markdown images
  • Missing alt text in Docassemble [FILE ...] image tags
  • Missing alt text in HTML <img> tags
  • Skipped markdown heading levels such as ## to ####
  • Skipped HTML heading levels such as <h2> to <h4>
  • Empty link text
  • Non-descriptive link text such as click here, here, read more, and Spanish equivalents like haga clic aquí
  • no label and empty/missing labels on multi-field screens (allowed on single-field screens)
  • Low contrast in custom Bootstrap theme CSS loaded by features: bootstrap theme; inspects actual CSS values for body text, navbar, dropdown menu, and buttons (minimum ratio 4.5:1)

Optional runtime-gated accessibility checks:

  • combobox usage, including datatype: combobox when --accessibility-error-on-widget combobox is enabled

Accessibility informational notes are also emitted for likely PDF accessibility issues:

  • DOCX attachments missing tagged pdf: True (set this in features or on the attachment)

WCAG checks still report YAML parse errors, so CI/CD can surface broken YAML and accessibility failures in one run.

This mode is source-based static analysis. It does not audit rendered pages for runtime behavior or JavaScript-created accessibility issues.

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

dayamlchecker-1.4.0.tar.gz (98.4 kB view details)

Uploaded Source

Built Distribution

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

dayamlchecker-1.4.0-py3-none-any.whl (79.0 kB view details)

Uploaded Python 3

File details

Details for the file dayamlchecker-1.4.0.tar.gz.

File metadata

  • Download URL: dayamlchecker-1.4.0.tar.gz
  • Upload date:
  • Size: 98.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dayamlchecker-1.4.0.tar.gz
Algorithm Hash digest
SHA256 ff7fc897d91e85ad97c8c419bf9c3aa0ed70782760163d50b31013969ef72b03
MD5 203d1be820a74c211757fd8f11daa573
BLAKE2b-256 593b8df137f408572d3a03d21cc658c9f8d33e87b6059e89eb33ab7bddc9987f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dayamlchecker-1.4.0.tar.gz:

Publisher: publish.yml on SuffolkLITLab/DAYamlChecker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dayamlchecker-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: dayamlchecker-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 79.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dayamlchecker-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87392c87fc414e26856e7d981101ccde99b2609259ac1440e5429e8a6ed1e3b5
MD5 3b84df9588436122320dc76cd1ae1ca9
BLAKE2b-256 b002049cb1df006b99f6ce5178be4605a40a37f08a8330f77e7bac0a2f36daa2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dayamlchecker-1.4.0-py3-none-any.whl:

Publisher: publish.yml on SuffolkLITLab/DAYamlChecker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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