Browse Source
Add explicit validation for QAPI documentation formatting rules: 1. Lines must not exceed 70 columns in width (including '# ' prefix) 2. Sentences must be separated by two spaces Example sections and literal :: blocks (seldom case) are excluded, we don't require them to be <= 70, that would be too restrictive. Anyway, they share common 80-columns recommendations (not requirements). Add two simple tests, illustrating the change. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-ID: <20251031183129.246814-1-vsementsov@yandex-team.ru> The detection of example and literal blocks isn't quite correct, but it works well enough, and we can improve on top. Reviewed-by: Markus Armbruster <armbru@redhat.com> [Comments, error messages, and test file names tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>pull/307/head
committed by
Markus Armbruster
8 changed files with 66 additions and 1 deletions
@ -0,0 +1,2 @@ |
|||
doc-bad-space-between-sentences.json:4:47: Use two spaces between sentences |
|||
If this not the end of a sentence, please report a bug. |
|||
@ -0,0 +1,6 @@ |
|||
## |
|||
# @foo: |
|||
# |
|||
# Sentences should be separated by two spaces. But here is only one. |
|||
## |
|||
{ 'command': 'foo' } |
|||
@ -0,0 +1 @@ |
|||
doc-long-line.json:4:1: documentation line longer than 70 characters |
|||
@ -0,0 +1,6 @@ |
|||
## |
|||
# @foo: |
|||
# |
|||
# This line has exactly 71 chars, including the leading hash and space. |
|||
## |
|||
{ 'command': 'foo' } |
|||
Loading…
Reference in new issue