Test parameter description punctuation, fix 178 violations (#340)#1664
Open
vahid-ahmadi wants to merge 1 commit intomainfrom
Open
Test parameter description punctuation, fix 178 violations (#340)#1664vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi wants to merge 1 commit intomainfrom
Conversation
Adds `policyengine_uk/tests/test_parameter_descriptions.py` which asserts every parameter `description` ends with a period — and brings the existing 178 parameter files into compliance. Multi-line descriptions are handled by appending the period to the last continuation line so the sentence ends correctly when YAML joins them. Per #339, these descriptions surface in the UI and were inconsistent; locking the convention in CI prevents drift going forward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes #340 (and substantially addresses #339).
policyengine_uk/tests/test_parameter_descriptions.pyasserts every parameter `description` field ends with a period.Implementation notes
Multi-line descriptions are handled correctly. YAML folded scalars like
```yaml
description: Percentage of the Married Couple's Allowance which is deductible from
Income Tax Liability
```
parse to a single string. The fixer locates the last continuation line and appends `.` there, so the sentence ends correctly (`...Income Tax Liability.`) — not mid-clause.
A handful of parameter files contain date-like keys that pyyaml's generic loader rejects with `year 0 is out of range`. The test catches `Exception` so pre-existing parse quirks don't block the assertion; PolicyEngine-core uses its own loader to read these at runtime.
Test plan
🤖 Generated with Claude Code