Add a Vale rule to check abstract length#5013
Merged
aneta-petrova merged 4 commits intoJul 8, 2026
Merged
Conversation
Add AbstractLength.yml Vale rule to check that module abstracts are between 50 and 300 characters long. The rule uses a Tengo script to: - Find the [role="_abstract"] marker in AsciiDoc modules - Capture the abstract paragraph (single paragraph per module) - Count characters including text that spans multiple lines - Report errors with actual character count for clarity The script includes detailed comments explaining: - Import purposes and regex pattern breakdown - How the match array works and what each element contains - Why [\s\S] is used instead of . to match multi-line content - The one-abstract-per-module constraint Integrates with the foreman-documentation Vale style package. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The PR preview for b79f841 is available at theforeman-foreman-documentation-preview-pr-5013.surge.sh No diff compared to the current base |
982e921 to
834995e
Compare
Contributor
I agree. |
Lennonka
approved these changes
Jul 8, 2026
Lennonka
left a comment
Contributor
There was a problem hiding this comment.
Thank you! Looks good to me.
This reverts commit 834995e.
Member
Author
|
I reverted the test commit whose purpose was to demonstrate and test the behavior. I'll merge with green GHA. |
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.
What changes are you introducing?
Adding a new Vale rule that reports paragraphs that do not conform to the length requirement for abstracts.
Why are you introducing these changes? (Explanation, links to references, issues, etc.)
Abstracts must be 50-300 characters long.
Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)
There are some limitations with this implementation:
{RHBK}) but not the string the attribute translates to in a given build context (Red Hat build of Keycloak). This can mean that the real abstract in the preview build could be longer than what Vale checks, potentially exceeding the 300 character limit.This, of course, would also not report accurate character count.
IMO this doesn't really pose an issue for the rule as I propose it. Upstream, even an approximate character count limit helps ensure abstracts don't get too long. Downstream, we'll have an additional check (but the upstream one will help us catch some violations before merging, which is still helpful).
Contributor checklists
Please cherry-pick my commits into: