Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/dayamlchecker/accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def _check_multifield_no_label_usage(

findings: list[AccessibilityFinding] = []
for field in fields:
if "code" in field:
continue
field_line = (
document_start_line + field.get("__line__", doc.get("__line__", 1)) - 1
)
Expand Down
22 changes: 22 additions & 0 deletions tests/test_yaml_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,28 @@ def test_accessibility_no_label_false_does_not_count_as_label(self):
f"Expected missing-label accessibility error, got: {errs}",
)

def test_accessibility_dynamic_code_field_no_error_on_multi_field_screen(self):
yaml_content = """id: court county
question: |
Court
fields:
- code: |
dynamic_fields()
- What is the court county?: court_county
choices:
- Contra Costa
- Alameda
"""
errs = find_errors_from_string(
yaml_content,
input_file="<string_valid>",
lint_mode="accessibility",
)
self.assertFalse(
any("single-field screens" in e.err_str.lower() for e in errs),
f"Did not expect no-label accessibility error for dynamic code field, got: {errs}",
)

def test_accessibility_tagged_pdf_info_for_docx_without_setting(self):
yaml_content = """attachments:
- name: Letter
Expand Down
Loading