Integrate style rules from ALLinter into YAML checker#44
Merged
Conversation
…un from commandline; also allows calling from within ci/cd
There was a problem hiding this comment.
Pull request overview
This PR integrates Assembly Line interview “style” lint rules into dayamlchecker, making them runnable from the CLI and enabling CI/CD style checks (including optional LLM-backed rules), while also expanding accessibility parity coverage.
Changes:
- Add opt-in deterministic style linting plus optional LLM-backed style findings (CLI flags + Python helper).
- Add interview-level parity checks (missing question
id, multiplemandatoryblocks, missing common metadata fields). - Expand accessibility lint rules/messages and add parity tests; package YAML data files needed for style rules.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_yaml_structure.py | Adds parity tests for new interview-level + accessibility rules; updates “valid question” fixture. |
| tests/test_style.py | New test suite covering opt-in style checks, severities, LLM configuration behavior, and CLI integration. |
| src/dayamlchecker/yaml_structure.py | Wires style/interview-level linting into the main parser flow; adds CLI flags and a style-only helper. |
| src/dayamlchecker/style.py | New style lint engine (deterministic + optional LLM rules) and prompt/data loading. |
| src/dayamlchecker/messages.py | Adds new FindingClass.STYLE, new message IDs, and message definitions for accessibility/style/interview-level findings. |
| src/dayamlchecker/accessibility.py | Adds multiple new accessibility checks (labels, choices, validation guidance, HTML rules, etc.). |
| src/dayamlchecker/data/plain_language_replacements.yml | Adds plain-language replacement dictionary used by style linting. |
| src/dayamlchecker/data/interview_linter_prompts.yml | Adds LLM prompt templates/rules for style linting. |
| src/dayamlchecker/init.py | Exposes a small public API surface for Python consumers (including style helper). |
| README.md | Documents style linting usage via CLI and Python helper. |
| pyproject.toml | Ensures new YAML data files are included in the package distribution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- contractions in user-facing text, excluding common “I don’t know” - slash-separated alternatives, with exceptions for pronoun sets, N/A, and URL path fragments - field labels starting with enter, write, or list - title-case field labels as INFO, narrowed after sample validation to avoid page-title noise - Other appearing before the end of any choice list - language fields using dropdowns or non-ISO choice values - “preferred pronouns”, required pronoun fields, gender Other, and binary-only gender choices
Member
Author
|
This is mostly a straight lift of the existing linter, but it's large enough I won't expect a code review. Any suggestions welcome; this is totally opt-in at the moment, and has been validated manually against a sample of ~ 70 of our repos. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copied over all of the pure style rules, but also there was some mismatch in accessibility checks which were duplicated between the two repos.
Style checks are only run when explicitly requested with the --style flag. Using --style-llm also runs LLM-powered checks for readability that deterministic rules aren't flexible enough for. When using --style-llm, developer can either use environment variables for OPENAI_BASE_URL, _MODEL, and _API_KEY, or pass as flags.
This is designed to be an importable feature for the existing Dashboard linter, rather than a duplicate copy of those rules.