From 2a0f3f314bd005de85e0f9d800195714ba4a3c07 Mon Sep 17 00:00:00 2001 From: Aidan Reilly <74046732+aireilly@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:58:31 +0100 Subject: [PATCH] implementing reading grade rule --- .../RedHat/ReadabilityGrade/testinvalid.adoc | 1 + .../RedHat/ReadabilityGrade/testvalid.adoc | 1 + .vale/styles/RedHat/ReadabilityGrade.yml | 15 +++++---------- .../reference-guide/pages/readabilitygrade.adoc | 3 ++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.vale/fixtures/RedHat/ReadabilityGrade/testinvalid.adoc b/.vale/fixtures/RedHat/ReadabilityGrade/testinvalid.adoc index e69de29bb..bcb248128 100644 --- a/.vale/fixtures/RedHat/ReadabilityGrade/testinvalid.adoc +++ b/.vale/fixtures/RedHat/ReadabilityGrade/testinvalid.adoc @@ -0,0 +1 @@ +Before you can deploy virtual distributed unit (vDU) applications, you need to tune and configure the cluster host firmware and various other cluster configuration settings. diff --git a/.vale/fixtures/RedHat/ReadabilityGrade/testvalid.adoc b/.vale/fixtures/RedHat/ReadabilityGrade/testvalid.adoc index e69de29bb..5841d106d 100644 --- a/.vale/fixtures/RedHat/ReadabilityGrade/testvalid.adoc +++ b/.vale/fixtures/RedHat/ReadabilityGrade/testvalid.adoc @@ -0,0 +1 @@ +Tune and configure the cluster host firmware and various other cluster configuration settings. diff --git a/.vale/styles/RedHat/ReadabilityGrade.yml b/.vale/styles/RedHat/ReadabilityGrade.yml index 32c913b58..879896f50 100644 --- a/.vale/styles/RedHat/ReadabilityGrade.yml +++ b/.vale/styles/RedHat/ReadabilityGrade.yml @@ -1,12 +1,7 @@ --- -extends: readability -grade: 21 -level: suggestion +extends: metric +message: "Simplify your language. The calculated Flesch–Kincaid grade level (%s) is above the recommended value of 16." link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/readabilitygrade/ -message: "Grade level ('%s') too high." -metrics: - - Automated Readability - - Coleman-Liau - - Flesch-Kincaid - - Gunning Fog - - SMOG +formula: | + (0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59 +condition: "> 16" diff --git a/modules/reference-guide/pages/readabilitygrade.adoc b/modules/reference-guide/pages/readabilitygrade.adoc index 9971de3af..b099b5d00 100644 --- a/modules/reference-guide/pages/readabilitygrade.adoc +++ b/modules/reference-guide/pages/readabilitygrade.adoc @@ -3,9 +3,10 @@ = Readability grade -Grade level too high. +Try to write sentences that have a calculated Flesch–Kincaid grade level above the recommended value of 15. .Additional resources +* link:https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests[Flesch–Kincaid readability tests] * link:https://vale.sh/docs/topics/styles#metric[Vale documentation - `metric` extension point] * link:{repository-url}blob/main/.vale/styles/RedHat/ReadabilityGrade.yml[`ReadabilityGrade.yml` source code]