diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9d3046422a..f915ea08ce 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,4 +56,7 @@ jobs: - uses: actions/checkout@v3 - uses: errata-ai/vale-action@reviewdog with: + files: '["archetypes", "assets", "content", "data", "layouts", "static", "themes"]' + vale_flags: "--config=tools/vale/.vale-github-action.ini" filter_mode: diff_context + fail_on_error: true diff --git a/.vale.ini b/.vale.ini index f1221b5e49..976134d1c4 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,15 +1,18 @@ # Vale configuration file. # +# This config file configures Vale when it's run locally. +# The tools/vale/.vale-github-action.ini file configures Vale when it's run by GitHub Actions. +# # For more information, see https://vale.sh/docs/. StylesPath = tools/vale/ -MinAlertLevel = warning +MinAlertLevel = suggestion SkippedScopes = code -Packages = Microsoft, write-good, Readability, Hugo +Packages = Microsoft, write-good, Hugo Vocab = Chef -[*.md] -BasedOnStyles = chef, Microsoft, Readability, vale, write-good +[*.{md,yaml,yml}] +BasedOnStyles = chef, Microsoft, vale, write-good # Ignore SVG markup TokenIgnores = (\*\*\{\w*\}\*\*) diff --git a/tools/vale/.vale-github-action.ini b/tools/vale/.vale-github-action.ini new file mode 100644 index 0000000000..9b83eeebe0 --- /dev/null +++ b/tools/vale/.vale-github-action.ini @@ -0,0 +1,19 @@ +# Vale configuration file. +# +# This config file is for Vale lints run by GitHub Actions. +# See the .github/workflows/lint.yml file. +# See the .vale.ini file in the project root for lints run on a local workstation. +# +# For more information, see https://vale.sh/docs/. + +StylesPath = ../vale/ +MinAlertLevel = error +SkippedScopes = code +Packages = Microsoft, write-good, Hugo +Vocab = Chef + +[*.{md,yaml,yml}] +BasedOnStyles = chef, Microsoft, vale, write-good + +# Ignore SVG markup +TokenIgnores = (\*\*\{\w*\}\*\*) diff --git a/tools/vale/Readability/AutomatedReadability.yml b/tools/vale/Readability/AutomatedReadability.yml deleted file mode 100644 index dd9fe6697c..0000000000 --- a/tools/vale/Readability/AutomatedReadability.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Automated Readability Index (%s) below 8." -link: https://en.wikipedia.org/wiki/Automated_readability_index - -formula: | - (4.71 * (characters / words)) + (0.5 * (words / sentences)) - 21.43 - -condition: "> 8" diff --git a/tools/vale/Readability/ColemanLiau.yml b/tools/vale/Readability/ColemanLiau.yml deleted file mode 100644 index d478303c2d..0000000000 --- a/tools/vale/Readability/ColemanLiau.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Coleman–Liau Index grade (%s) below 9." -link: https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index - -formula: | - (0.0588 * (characters / words) * 100) - (0.296 * (sentences / words) * 100) - 15.8 - -condition: "> 9" diff --git a/tools/vale/Readability/FleschKincaid.yml b/tools/vale/Readability/FleschKincaid.yml deleted file mode 100644 index 3f60f205dd..0000000000 --- a/tools/vale/Readability/FleschKincaid.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Flesch–Kincaid grade level (%s) below 8." -link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests - -formula: | - (0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59 - -condition: "> 8" diff --git a/tools/vale/Readability/FleschReadingEase.yml b/tools/vale/Readability/FleschReadingEase.yml deleted file mode 100644 index 6179766715..0000000000 --- a/tools/vale/Readability/FleschReadingEase.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Flesch reading ease score (%s) above 70." -link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests - -formula: | - 206.835 - (1.015 * (words / sentences)) - (84.6 * (syllables / words)) - -condition: "< 70" diff --git a/tools/vale/Readability/GunningFog.yml b/tools/vale/Readability/GunningFog.yml deleted file mode 100644 index 302c0eeb0e..0000000000 --- a/tools/vale/Readability/GunningFog.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the Gunning-Fog index (%s) below 10." -link: https://en.wikipedia.org/wiki/Gunning_fog_index - -formula: | - 0.4 * ((words / sentences) + 100 * (complex_words / words)) - -condition: "> 10" diff --git a/tools/vale/Readability/LIX.yml b/tools/vale/Readability/LIX.yml deleted file mode 100644 index f5b0f4e8b1..0000000000 --- a/tools/vale/Readability/LIX.yml +++ /dev/null @@ -1,17 +0,0 @@ -extends: metric -message: "Try to keep the LIX score (%s) below 35." - -link: https://en.wikipedia.org/wiki/Lix_(readability_test) -# Very Easy: 20 - 25 -# -# Easy: 30 - 35 -# -# Medium: 40 - 45 -# -# Difficult: 50 - 55 -# -# Very Difficult: 60+ -formula: | - (words / sentences) + ((long_words * 100) / words) - -condition: "> 35" diff --git a/tools/vale/Readability/SMOG.yml b/tools/vale/Readability/SMOG.yml deleted file mode 100644 index e7f5913bc9..0000000000 --- a/tools/vale/Readability/SMOG.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: metric -message: "Try to keep the SMOG grade (%s) below 10." -link: https://en.wikipedia.org/wiki/SMOG - -formula: | - 1.0430 * math.sqrt((polysyllabic_words * 30.0) / sentences) + 3.1291 - -condition: "> 10" diff --git a/tools/vale/Readability/meta.json b/tools/vale/Readability/meta.json deleted file mode 100644 index 0ff71c3024..0000000000 --- a/tools/vale/Readability/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "feed": "https://github.com/errata-ai/Readability/releases.atom", - "vale_version": ">=2.13.0" -} \ No newline at end of file