diff --git a/.github/styles/config/vocabularies/PSDK/accept.txt b/.github/styles/config/vocabularies/PSDK/accept.txt new file mode 100644 index 000000000..9a712c7bf --- /dev/null +++ b/.github/styles/config/vocabularies/PSDK/accept.txt @@ -0,0 +1,24 @@ +BeagleBone +Broadcom +GStreamer +Jacinto +Khronos +OpenCL +OpenGL +OpenVX +PVRCarbon +PVRTune +Sitara +UniFlash +Vulkan +Yocto +Zink +[Cc]odec +[Dd]unfell +[Ee]thernet +[Ff]ramebuffer +[Kk]irkstone +[Mm]ulticast +[Ss]carthgap +[Tt]oolchain +balenaEtcher diff --git a/.github/styles/config/vocabularies/PSDK/reject.txt b/.github/styles/config/vocabularies/PSDK/reject.txt new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml new file mode 100644 index 000000000..ef4678739 --- /dev/null +++ b/.github/workflows/vale.yml @@ -0,0 +1,40 @@ +--- +name: "vale" + +on: [pull_request] + +defaults: + run: + shell: bash + +jobs: + vale: + name: vale + runs-on: ubuntu-latest + container: + image: ghcr.io/staticrocket/processor-sdk-doc:latest + options: --entrypoint /bin/bash + + steps: + - name: Prepare GitHub workdir + run: | + mkdir -p /github/home/ + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v46 + with: + files: | + **.rst + **.md + + - name: Run vale checks on modified files + uses: StaticRocket/vale-action@d377866f2e3305ae80ef6ce6516370a7ec4ea55a + if: steps.changed-files.outputs.any_changed == 'true' + with: + fail_on_error: false # to be changed when upstream addresses 84 + files: ${{ steps.changed-files.outputs.all_changed_files }} + version: none diff --git a/.gitignore b/.gitignore index 462b73df7..761bc0cea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ +# python artifacts *.swp *.pyc + +# build artifacts build/ -.vale/ + +# vale configs and intermediary data +.github/styles/* +!.github/styles/config diff --git a/.vale.ini b/.vale.ini index 8ee6fb3b2..d37b4a017 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,6 +1,11 @@ +StylesPath = .github/styles MinAlertLevel = suggestion Packages = RedHat +Vocab = PSDK + [*.{md,rst}] BasedOnStyles = RedHat +RedHat.PascalCamelCase = NO +RedHat.GitLinks = NO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad00468d8..f63fbf011 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -180,6 +180,22 @@ Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com All other files inherit the generic CC-BY-SA-4.0 license and do not require an explicit license / copyright notice. +## Vale grammar, spelling and prose checking + +This project currently uses [Vale](https://vale.sh/) for grammar spelling and +prose checking. We operate on a loose version of [Red Hat's documentation style +guidelines](https://github.com/redhat-documentation/vale-at-red-hat). + +If there are words it detects as misspellings, add those words to the custom +vocabulary entry in +[accept.txt](.github/styles/config/vocabularies/PSDK/accept.txt). If there are +words you see that you think do not constitute usage here, add those words to +the [reject.txt](.github/styles/config/vocabularies/PSDK/reject.txt). Ensure the +contents of these files are alphabetically sorted after any modifications. + +Information about the formatting of these files is available +[upstream](https://vale.sh/docs/keys/vocab#file-format). + ## Fighting workflows The workflows are here to help, but occasionally they can raise false positives. diff --git a/docker/Dockerfile b/docker/Dockerfile index d3e046b10..11701d20d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,6 +13,7 @@ RUN apk add --no-cache \ ripgrep \ shadow \ su-exec \ + vale \ zip \ && echo "**** create abc user and make our folders ****" \ && useradd -u 1000 -U -d /config -s /bin/false abc \