From 061dea0974c241b69407fe7101b7b9adde16b023 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 11:37:34 +0100 Subject: [PATCH 001/526] add vale --- .vale.ini | 7 ++++ styles/Repitition.yml | 10 +++++ styles/custom/LatinAbbreviations.yml | 10 +++++ styles/custom/Passive.yml | 19 +++++++++ styles/custom/SentenceCaseHeaders.yml | 8 ++++ styles/custom/Spelling.yml | 55 +++++++++++++++++++++++++++ styles/custom/UIElements.yml | 13 +++++++ styles/custom/your-dictionary.dic | 21 ++++++++++ 8 files changed, 143 insertions(+) create mode 100644 .vale.ini create mode 100644 styles/Repitition.yml create mode 100644 styles/custom/LatinAbbreviations.yml create mode 100644 styles/custom/Passive.yml create mode 100644 styles/custom/SentenceCaseHeaders.yml create mode 100644 styles/custom/Spelling.yml create mode 100644 styles/custom/UIElements.yml create mode 100644 styles/custom/your-dictionary.dic diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 00000000000..edbd97348c0 --- /dev/null +++ b/.vale.ini @@ -0,0 +1,7 @@ +StylesPath = styles +MinAlertLevel = suggestion + +[*.md] +BasedOnStyles = custom + +Vocab = EN diff --git a/styles/Repitition.yml b/styles/Repitition.yml new file mode 100644 index 00000000000..4f49e8380eb --- /dev/null +++ b/styles/Repitition.yml @@ -0,0 +1,10 @@ +extends: existence + +message: "Repetitive word found: '$0'." +level: warning +# Regex to match repetitive words (e.g., "the the", "and and") + +ignorecase: true +nonword: true +tokens: + - '\b(\w+)\s+\1\b' diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml new file mode 100644 index 00000000000..3c983764beb --- /dev/null +++ b/styles/custom/LatinAbbreviations.yml @@ -0,0 +1,10 @@ +extends: substitution + +message: "Avoid Latin abbreviations: '$1'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." +level: warning +swap: + - e.g.: for example + - i.e.: for example + - i.e.: that is + - etc.: and so on + - N.B.: Note diff --git a/styles/custom/Passive.yml b/styles/custom/Passive.yml new file mode 100644 index 00000000000..aa7637d2da2 --- /dev/null +++ b/styles/custom/Passive.yml @@ -0,0 +1,19 @@ +extends: substitution + +message: "Avoid passive voice: '$1'. Instead, use active voice by making sure the subject of the sentence performs the action. For example: 'The contributor writes the documentation.' " +level: warning +# Provide the correct solution for passive constructions +swap: + - is being: is + - are being: are + - was being: was + - were being: were + - has been: has + - had been: had + - have been: have + - is used: uses + - shall be: shall + - \bis\s+(?:\w+ed)\b: \1 # Matches 'is' followed by a word ending in 'ed' + - \bare\s+(?:\w+ed)\b: \1 # Matches 'are' followed by a word ending in 'ed' + - \bwas\s+(?:\w+ed)\b: \1 # Matches 'was' followed by a word ending in 'ed' + - \bwere\s+(?:\w+ed)\b: \1 # Matches 'were' followed by a word ending in 'ed' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml new file mode 100644 index 00000000000..7fd8bc07021 --- /dev/null +++ b/styles/custom/SentenceCaseHeaders.yml @@ -0,0 +1,8 @@ +extends: existence + +message: "Header '$0' should be in sentence case: 'Sentence case header'." +level: warning +scope: heading +ignorecase: false +tokens: | + (?i)^[#]{1,4}\s+[A-Z][a-z]*\b(?:\s+[a-z]+)*$ diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml new file mode 100644 index 00000000000..fcbc28099fa --- /dev/null +++ b/styles/custom/Spelling.yml @@ -0,0 +1,55 @@ +extends: spelling + +message: "Use American English spelling for '$0'." +level: warning +ignore: + - dbt + - dbt Cloud + - ETL + - ELT + - DAG + - CTE + - DDL + - DML + - JSON + - CI/CD + +path: styles/custom/your-dictionary.dic + +# Additional spelling rules for common typos +--- + +extends: existence + +message: "Possible typo: '$0'." +level: warning + +# Custom rules for catching obvious typos +tokens: + - 'teh' + - 'recieve' + - 'definately' + - 'seperate' + - 'occured' + - 'untill' +--- + +extends: existence + +message: "Repetitive word found: '$0'." +level: warning +# Regex to match repetitive words (e.g., "the the", "and and") +# This example is simplified; you may need a more complex regex for your needs +ignorecase: true +nonword: true +tokens: + - '\b(\w+)\s+\1\b' +--- + +extends: existence + +message: "Ignore specific patterns" +level: skip +tokens: + - '\bdbt\s+Cloud\b' + - '\bdbt\s+.*?\b' diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml new file mode 100644 index 00000000000..d7065138609 --- /dev/null +++ b/styles/custom/UIElements.yml @@ -0,0 +1,13 @@ +extends: existence + +message: "UI elements should be bold: '$1'." +level: warning +tokens: + - '\Save\b' + - '\bCancel\b' + - '\bSubmit\b' + - '\bEdit\b' + - '\bAccount settings\b' + - '\bProject details\b' + - '\bProfile settings\b' + - '\bPersonal profile\b' diff --git a/styles/custom/your-dictionary.dic b/styles/custom/your-dictionary.dic new file mode 100644 index 00000000000..dc9a616bfd5 --- /dev/null +++ b/styles/custom/your-dictionary.dic @@ -0,0 +1,21 @@ +colour color +favour favor +organisation organization +licence license +defence defense +neighbour neighbor +organise organize +recognise recognize +analyse analyze +analogue analog +centre centre +grey gray +labour labor +pretence pretence +standardise standardize +teh the +recieve receive +definately definitely +seperate separate +occured occurred +untill until From 38f580dd5ea6c1b62a27c265b489de1be5b15808 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 11:51:13 +0100 Subject: [PATCH 002/526] updates --- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Spelling.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 7fd8bc07021..cb0812dc387 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: existence -message: "Header '$0' should be in sentence case: 'Sentence case header'." +message: "Header '$0' should be in sentence case: 'Sentence case header'. Context: '$1'." level: warning scope: heading ignorecase: false diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index fcbc28099fa..58a09ddde3b 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -16,7 +16,6 @@ ignore: path: styles/custom/your-dictionary.dic -# Additional spelling rules for common typos --- extends: existence From 2ede23859704bd31bfe848d6d006419d2902bb84 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 11:52:32 +0100 Subject: [PATCH 003/526] add gha --- .github/workflows/vale.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/vale.yml diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml new file mode 100644 index 00000000000..1cddbb4285a --- /dev/null +++ b/.github/workflows/vale.yml @@ -0,0 +1,42 @@ +name: Vale Lint + +on: + pull_request: + paths: + - '**/*.md' + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Vale + run: | + curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + sudo mv vale /usr/local/bin/ + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + echo "::set-output name=files::$(jq -R -s -c 'split("\n") | map(select(length > 0))' <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.md'))" + + - name: Run Vale + run: | + CHANGED_FILES=$(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]') + for file in $CHANGED_FILES; do + vale $file + done + shell: bash From b86c862eb1afbaebfcc9d744818b0dddcd041717 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:59:20 +0100 Subject: [PATCH 004/526] Update vale.yml --- .github/workflows/vale.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1cddbb4285a..e5e3729ceed 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: 2 # Ensure sufficient depth to get the necessary commit history - name: Set up Python uses: actions/setup-python@v2 @@ -31,7 +31,11 @@ jobs: - name: Get changed files id: changed-files run: | - echo "::set-output name=files::$(jq -R -s -c 'split("\n") | map(select(length > 0))' <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.md'))" + git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV + git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md' | jq -R -s -c 'split("\n") | map(select(length > 0))' > changed_files.json + echo "::set-output name=files::$(cat changed_files.json)" - name: Run Vale run: | From 3c9bd21be90dda42575680794a747a1bc7abc444 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:05:40 +0100 Subject: [PATCH 005/526] add --- .github/workflows/vale.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1cddbb4285a..2f07ceffa58 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,17 +13,10 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' + fetch-depth: 2 # Ensure sufficient depth to get the necessary commit history - name: Install Vale - run: | - curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - sudo mv vale /usr/local/bin/ + uses: errata-ai/vale-action@v2 - name: Install jq run: sudo apt-get install -y jq @@ -31,7 +24,11 @@ jobs: - name: Get changed files id: changed-files run: | - echo "::set-output name=files::$(jq -R -s -c 'split("\n") | map(select(length > 0))' <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.md'))" + git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV + git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md' | jq -R -s -c 'split("\n") | map(select(length > 0))' > changed_files.json + echo "::set-output name=files::$(cat changed_files.json)" - name: Run Vale run: | From be7a73faeaad8f1dc9152123bbb85be874df808d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:20:35 +0100 Subject: [PATCH 006/526] add --- .github/workflows/vale.yml | 27 ++++++++++++++++----------- styles/custom/Passive.yml | 3 +-- styles/custom/SentenceCaseHeaders.yml | 8 ++++---- styles/custom/Spelling.yml | 5 ++--- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2f07ceffa58..503bca8bfea 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -6,18 +6,16 @@ on: - '**/*.md' jobs: - lint: + vale: + name: runner / vale runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 # Ensure sufficient depth to get the necessary commit history - - name: Install Vale - uses: errata-ai/vale-action@v2 - - name: Install jq run: sudo apt-get install -y jq @@ -30,10 +28,17 @@ jobs: git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md' | jq -R -s -c 'split("\n") | map(select(length > 0))' > changed_files.json echo "::set-output name=files::$(cat changed_files.json)" - - name: Run Vale + - name: Print SHAs run: | - CHANGED_FILES=$(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]') - for file in $CHANGED_FILES; do - vale $file - done - shell: bash + echo "BASE_SHA: $BASE_SHA" + echo "HEAD_SHA: ${{ github.sha }}" + + - name: Print Changed Files + run: cat changed_files.json + + - name: Run Vale and Reviewdog + uses: errata-ai/vale-action@reviewdog + with: + list-files: changed_files.json + reporter: github-pr-review + level: warning diff --git a/styles/custom/Passive.yml b/styles/custom/Passive.yml index aa7637d2da2..cc0d82b6299 100644 --- a/styles/custom/Passive.yml +++ b/styles/custom/Passive.yml @@ -1,8 +1,7 @@ extends: substitution -message: "Avoid passive voice: '$1'. Instead, use active voice by making sure the subject of the sentence performs the action. For example: 'The contributor writes the documentation.' " +message: "Avoid passive voice: '$1'. Instead, use active voice by making sure the subject of the sentence performs the action. For example: 'The contributor writes the documentation.'" level: warning -# Provide the correct solution for passive constructions swap: - is being: is - are being: are diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index cb0812dc387..bdc519b04f3 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,8 +1,8 @@ extends: existence -message: "Header '$0' should be in sentence case: 'Sentence case header'. Context: '$1'." -level: warning +message: "Header '$0' should be in sentence case: 'Sentence case header'." +level: error scope: heading ignorecase: false -tokens: | - (?i)^[#]{1,4}\s+[A-Z][a-z]*\b(?:\s+[a-z]+)*$ +match: | + (?i)^[#]{1,4}\s+[A-Z][a-z]*(\s+[a-z]+)*$ diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index 58a09ddde3b..dd3d8f8ea11 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -20,7 +20,7 @@ path: styles/custom/your-dictionary.dic extends: existence -message: "Possible typo: '$0'." +message: "Possible typo: '$0'. Did you mean one of these common corrections?" level: warning # Custom rules for catching obvious typos @@ -35,10 +35,9 @@ tokens: extends: existence -message: "Repetitive word found: '$0'." +message: "Repetitive word found: '$0'. Consider revising." level: warning # Regex to match repetitive words (e.g., "the the", "and and") -# This example is simplified; you may need a more complex regex for your needs ignorecase: true nonword: true tokens: From bc0d3b27b26a8ad3f132aaf13c0d70281747b559 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:28:39 +0100 Subject: [PATCH 007/526] fix --- styles/custom/SentenceCaseHeaders.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index bdc519b04f3..7f4b9b62ed2 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -4,5 +4,5 @@ message: "Header '$0' should be in sentence case: 'Sentence case header'." level: error scope: heading ignorecase: false -match: | +tokens: | (?i)^[#]{1,4}\s+[A-Z][a-z]*(\s+[a-z]+)*$ From 097fc0465087cb54db519b187ce8db9b03a40e87 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:36:39 +0100 Subject: [PATCH 008/526] update --- .github/workflows/vale.yml | 2 +- styles/custom/Passive.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Spelling.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 503bca8bfea..00de676a1d2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 2 # Ensure sufficient depth to get the necessary commit history + fetch-depth: 2 - name: Install jq run: sudo apt-get install -y jq diff --git a/styles/custom/Passive.yml b/styles/custom/Passive.yml index cc0d82b6299..194bed3b33f 100644 --- a/styles/custom/Passive.yml +++ b/styles/custom/Passive.yml @@ -1,6 +1,6 @@ extends: substitution -message: "Avoid passive voice: '$1'. Instead, use active voice by making sure the subject of the sentence performs the action. For example: 'The contributor writes the documentation.'" +message: "Avoid passive voice: '$1'. Use active voice instead." level: warning swap: - is being: is diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 7f4b9b62ed2..39e3ac1604d 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -5,4 +5,4 @@ level: error scope: heading ignorecase: false tokens: | - (?i)^[#]{1,4}\s+[A-Z][a-z]*(\s+[a-z]+)*$ + ^[#]{1,4}\s+[a-z][^\n]*$ diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index dd3d8f8ea11..13be7b602e7 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -1,6 +1,6 @@ extends: spelling -message: "Use American English spelling for '$0'." +message: "Detected a spelling error: '$0'." level: warning ignore: - dbt @@ -20,7 +20,7 @@ path: styles/custom/your-dictionary.dic extends: existence -message: "Possible typo: '$0'. Did you mean one of these common corrections?" +message: "Possible typo detected: '$0'. Did you mean 'the', 'receive', etc.?" level: warning # Custom rules for catching obvious typos From a6804b3ed5754f3742d4e811995ef44e5209260e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:49:18 +0100 Subject: [PATCH 009/526] add --- styles/Repitition.yml | 4 ++-- styles/custom/Spelling.yml | 26 -------------------------- styles/custom/Typos.yml | 11 +++++++++++ styles/custom/your-dictionary.dic | 6 ------ 4 files changed, 13 insertions(+), 34 deletions(-) create mode 100644 styles/custom/Typos.yml diff --git a/styles/Repitition.yml b/styles/Repitition.yml index 4f49e8380eb..1886e30530e 100644 --- a/styles/Repitition.yml +++ b/styles/Repitition.yml @@ -1,10 +1,10 @@ extends: existence -message: "Repetitive word found: '$0'." +message: "Repetitive word found: '$0'. Consider revising." level: warning # Regex to match repetitive words (e.g., "the the", "and and") - ignorecase: true nonword: true tokens: - '\b(\w+)\s+\1\b' +--- diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index 13be7b602e7..966d7ac727c 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -20,32 +20,6 @@ path: styles/custom/your-dictionary.dic extends: existence -message: "Possible typo detected: '$0'. Did you mean 'the', 'receive', etc.?" -level: warning - -# Custom rules for catching obvious typos -tokens: - - 'teh' - - 'recieve' - - 'definately' - - 'seperate' - - 'occured' - - 'untill' ---- - -extends: existence - -message: "Repetitive word found: '$0'. Consider revising." -level: warning -# Regex to match repetitive words (e.g., "the the", "and and") -ignorecase: true -nonword: true -tokens: - - '\b(\w+)\s+\1\b' ---- - -extends: existence - message: "Ignore specific patterns" level: skip tokens: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml new file mode 100644 index 00000000000..e65bc0313b5 --- /dev/null +++ b/styles/custom/Typos.yml @@ -0,0 +1,11 @@ +extends: existence + +message: "Possible typo detected: '$0'. Did you mean 'the', 'receive', etc.?" +level: warning +tokens: + - 'teh' + - 'recieve' + - 'definately' + - 'seperate' + - 'occured' + - 'untill' diff --git a/styles/custom/your-dictionary.dic b/styles/custom/your-dictionary.dic index dc9a616bfd5..9c4e9af5908 100644 --- a/styles/custom/your-dictionary.dic +++ b/styles/custom/your-dictionary.dic @@ -13,9 +13,3 @@ grey gray labour labor pretence pretence standardise standardize -teh the -recieve receive -definately definitely -seperate separate -occured occurred -untill until From 0de99bdc7c413f1c4291053957695f982bd0771e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:51:45 +0100 Subject: [PATCH 010/526] add --- styles/custom/Spelling.yml | 2 +- styles/custom/Typos.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index 966d7ac727c..f7113cc3253 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -1,6 +1,6 @@ extends: spelling -message: "Detected a spelling error: '$0'." +message: "Detected non-American spelling. Please use American spelling." level: warning ignore: - dbt diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index e65bc0313b5..e1d389491a7 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,11 +1,11 @@ extends: existence -message: "Possible typo detected: '$0'. Did you mean 'the', 'receive', etc.?" +message: "Possible typo detected: '$0'. Did you mean '$1'?" level: warning tokens: - - 'teh' - - 'recieve' - - 'definately' - - 'seperate' - - 'occured' - - 'untill' + - 'teh': 'the' + - 'recieve': 'receive' + - 'definately': 'definitely' + - 'seperate': 'separate' + - 'occured': 'occurred' + - 'untill': 'until' From 3be35453f95f4e48055d0cdd5829250783b382e4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 12:53:06 +0100 Subject: [PATCH 011/526] add --- styles/{ => custom}/Repitition.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename styles/{ => custom}/Repitition.yml (100%) diff --git a/styles/Repitition.yml b/styles/custom/Repitition.yml similarity index 100% rename from styles/Repitition.yml rename to styles/custom/Repitition.yml From b471e09698a739e8818ae42e222baa05ddddc857 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 13:00:08 +0100 Subject: [PATCH 012/526] add --- styles/custom/Typos.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index e1d389491a7..54e278b577c 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -2,10 +2,10 @@ extends: existence message: "Possible typo detected: '$0'. Did you mean '$1'?" level: warning -tokens: - - 'teh': 'the' - - 'recieve': 'receive' - - 'definately': 'definitely' - - 'seperate': 'separate' - - 'occured': 'occurred' - - 'untill': 'until' +swap: + - teh: the + - recieve: receive + - definately: definitely + - seperate: separate + - occured: occurred + - untill: until From 9cd989e0a4dddf648866c4f54ea07d58109f0555 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 13:00:48 +0100 Subject: [PATCH 013/526] add --- styles/custom/Typos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 54e278b577c..6e449598033 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,6 +1,6 @@ -extends: existence +extends: substitution -message: "Possible typo detected: '$0'. Did you mean '$1'?" +message: "Possible typo detected: Consider using '%s' instead of '%s'" level: warning swap: - teh: the From 7981eb09e3abe8f4ce2d7f591eb35543ebab5ebd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 6 Jun 2024 13:08:16 +0100 Subject: [PATCH 014/526] add --- .github/workflows/vale.yml | 32 ++++++++++++++++++++++++++------ styles/custom/Passive.yml | 18 ------------------ styles/custom/Spelling.yml | 2 +- 3 files changed, 27 insertions(+), 25 deletions(-) delete mode 100644 styles/custom/Passive.yml diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 00de676a1d2..5cec0826234 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,9 +36,29 @@ jobs: - name: Print Changed Files run: cat changed_files.json - - name: Run Vale and Reviewdog - uses: errata-ai/vale-action@reviewdog - with: - list-files: changed_files.json - reporter: github-pr-review - level: warning + - name: Run Vale and Process Output + run: | + CHANGED_FILES=$(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]') + for file in $CHANGED_FILES; do + vale --output=JSON $file > vale-output.json + cat vale-output.json | jq -r '.[] | @base64' > vale-results.txt + while IFS= read -r line; do + _jq() { + echo ${line} | base64 --decode | jq -r ${1} + } + reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=$(_jq '.Severity | ascii_downcase') < Date: Thu, 6 Jun 2024 13:11:38 +0100 Subject: [PATCH 015/526] add --- .github/workflows/vale.yml | 56 ++++++++------------------------------ 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5cec0826234..29e75d29341 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -7,58 +7,24 @@ on: jobs: vale: - name: runner / vale runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV - git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md' | jq -R -s -c 'split("\n") | map(select(length > 0))' > changed_files.json - echo "::set-output name=files::$(cat changed_files.json)" - - name: Print SHAs - run: | - echo "BASE_SHA: $BASE_SHA" - echo "HEAD_SHA: ${{ github.sha }}" - - - name: Print Changed Files - run: cat changed_files.json + - name: Install Vale and Reviewdog + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review + level: warning - - name: Run Vale and Process Output + - name: Run Vale on Changed Files run: | - CHANGED_FILES=$(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]') + # Get the list of changed markdown files in the pull request + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.md') + + # Run Vale on each changed file and report via Reviewdog for file in $CHANGED_FILES; do - vale --output=JSON $file > vale-output.json - cat vale-output.json | jq -r '.[] | @base64' > vale-results.txt - while IFS= read -r line; do - _jq() { - echo ${line} | base64 --decode | jq -r ${1} - } - reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=$(_jq '.Severity | ascii_downcase') < Date: Thu, 6 Jun 2024 13:13:58 +0100 Subject: [PATCH 016/526] add --- .github/workflows/vale.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 29e75d29341..3c1f03b4e40 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -12,19 +12,30 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - - name: Install Vale and Reviewdog - uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review - level: warning + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(cat changed_files.json)" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Install Vale + uses: errata-ai/vale-action@v2 - name: Run Vale on Changed Files run: | - # Get the list of changed markdown files in the pull request - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.md') - - # Run Vale on each changed file and report via Reviewdog for file in $CHANGED_FILES; do vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.files }} From 534f372b242b9d73a7456999cbe1fe22cc3a6af4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:26:04 +0100 Subject: [PATCH 017/526] add reviewdog code suggester --- .github/workflows/vale.yml | 24 ++++++++++++++++++++---- styles/custom/Repitition.yml | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3c1f03b4e40..31c6b1a72da 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,7 +24,7 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(cat changed_files.json)" + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES @@ -32,10 +32,26 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Run Vale on Changed Files + - name: Install Reviewdog + uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest + + - name: Run Vale on changed files with reviewdog run: | - for file in $CHANGED_FILES; do + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: - CHANGED_FILES: ${{ steps.changed-files.outputs.files }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} + + - name: Run Vale with code suggester + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.SNIPPET_VALIDATION }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 1886e30530e..99e25d6a074 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -7,4 +7,4 @@ ignorecase: true nonword: true tokens: - '\b(\w+)\s+\1\b' ---- + From ac2ba7df64f467ff3c3cfd7f6d217c408c6cbd1d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:32:59 +0100 Subject: [PATCH 018/526] add diff --- .github/workflows/vale.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 31c6b1a72da..f8abd7a13b2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -9,6 +9,12 @@ jobs: vale: runs-on: ubuntu-latest + permissions: + contents: read + checks: write + issues: write + pull-requests: write + steps: - name: Checkout code uses: actions/checkout@v3 @@ -37,15 +43,18 @@ jobs: with: reviewdog_version: latest - - name: Run Vale on changed files with reviewdog + - name: Run Vale and Generate Suggestions run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + vale --output=line $file > vale_output.patch + if [ -s vale_output.patch ]; then + reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=warning -filter-mode=diff_context < vale_output.patch + fi done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} - - name: Run Vale with code suggester + - name: Run Vale with Code Suggester uses: reviewdog/action-suggester@v1 with: github_token: ${{ secrets.SNIPPET_VALIDATION }} From a29a0f779ea13b236d00d4500fbc4a7cb36295f2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:37:53 +0100 Subject: [PATCH 019/526] add echo --- .github/workflows/vale.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f8abd7a13b2..2101031c67c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,7 +30,7 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" + echo "::set-output name=files::$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES @@ -48,6 +48,7 @@ jobs: for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=line $file > vale_output.patch if [ -s vale_output.patch ]; then + cat vale_output.patch reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=warning -filter-mode=diff_context < vale_output.patch fi done @@ -64,3 +65,5 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From c45129e95657429b07c381426ab80a6b61b5429b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:41:34 +0100 Subject: [PATCH 020/526] add curl command --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2101031c67c..93bab3365a8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,7 +36,9 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + sudo mv vale /usr/local/bin/ - name: Install Reviewdog uses: reviewdog/action-setup@v1 From 98989575eb47e95d92f07883d7bb1951bc2cbb2e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:51:04 +0100 Subject: [PATCH 021/526] updates install --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 93bab3365a8..891d5b3beab 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -37,7 +37,9 @@ jobs: - name: Install Vale run: | - curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + VALE_VERSION=$(curl --silent "https://api.github.com/repos/errata-ai/vale/releases/latest" | jq -r .tag_name) + curl -sSfL "https://github.com/errata-ai/vale/releases/download/${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz + tar -xzf vale.tar.gz sudo mv vale /usr/local/bin/ - name: Install Reviewdog From 149da14f6aee7b4ae90d53db9eea0b65692f2050 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:54:17 +0100 Subject: [PATCH 022/526] fix install --- .github/workflows/vale.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 891d5b3beab..2101031c67c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,11 +36,7 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - run: | - VALE_VERSION=$(curl --silent "https://api.github.com/repos/errata-ai/vale/releases/latest" | jq -r .tag_name) - curl -sSfL "https://github.com/errata-ai/vale/releases/download/${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz - tar -xzf vale.tar.gz - sudo mv vale /usr/local/bin/ + uses: errata-ai/vale-action@v2 - name: Install Reviewdog uses: reviewdog/action-setup@v1 From 65b4965375ff9054a3eacfc078ef8750fbb90818 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 12:57:04 +0100 Subject: [PATCH 023/526] one more time --- .github/workflows/vale.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2101031c67c..3d3f2289741 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,18 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits + - name: Install Homebrew + run: | + sudo apt-get update + sudo apt-get install -y build-essential + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bash_profile + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + + - name: Install Vale + run: | + brew install vale + - name: Install jq run: sudo apt-get install -y jq @@ -35,9 +47,6 @@ jobs: - name: Print Changed Files run: echo $CHANGED_FILES - - name: Install Vale - uses: errata-ai/vale-action@v2 - - name: Install Reviewdog uses: reviewdog/action-setup@v1 with: From f6332dd62f7e4c6d5d62acac770a512a0a8764e4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:03:38 +0100 Subject: [PATCH 024/526] update --- .github/workflows/vale.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3d3f2289741..1c4006d7156 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,23 +16,10 @@ jobs: pull-requests: write steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history so we can access all commits - - name: Install Homebrew - run: | - sudo apt-get update - sudo apt-get install -y build-essential - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bash_profile - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - - - name: Install Vale - run: | - brew install vale - - name: Install jq run: sudo apt-get install -y jq @@ -47,6 +34,9 @@ jobs: - name: Print Changed Files run: echo $CHANGED_FILES + - name: Install Vale + uses: errata-ai/vale-action@v2 + - name: Install Reviewdog uses: reviewdog/action-setup@v1 with: @@ -74,5 +64,3 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From 8efc232ca1d9eb56248648e8ebeff301f861ad52 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:04:39 +0100 Subject: [PATCH 025/526] removes redundancies --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1c4006d7156..737c40f5d78 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,8 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history so we can access all commits From d7c1fab9becc4162b361516ee8ce0312af756367 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:10:50 +0100 Subject: [PATCH 026/526] update --- .github/workflows/vale.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 737c40f5d78..30e10f618d9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,7 +36,11 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + VALE_VERSION=$(curl --silent "https://api.github.com/repos/errata-ai/vale/releases/latest" | jq -r .tag_name) + curl -sSfL "https://github.com/errata-ai/vale/releases/download/${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz + tar -xzf vale.tar.gz + sudo mv vale /usr/local/bin/ - name: Install Reviewdog uses: reviewdog/action-setup@v1 @@ -46,7 +50,7 @@ jobs: - name: Run Vale and Generate Suggestions run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=line $file > vale_output.patch + ./vale --output=line $file > vale_output.patch if [ -s vale_output.patch ]; then cat vale_output.patch reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=warning -filter-mode=diff_context < vale_output.patch From 9ce430d50222237ed2e6a093e58b4e792432e041 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:29:12 +0100 Subject: [PATCH 027/526] update --- .github/workflows/vale.yml | 93 ++++++++++++-------------------------- 1 file changed, 30 insertions(+), 63 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 30e10f618d9..eabf7bbd14c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,71 +1,38 @@ -name: Vale Lint +name: CI on: pull_request: - paths: - - '**/*.md' + types: [opened, synchronize, reopened, edited] jobs: - vale: + lint: + name: Lint Documentation runs-on: ubuntu-latest - permissions: - contents: read - checks: write - issues: write - pull-requests: write - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split("\n")[:-1]')" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Install Vale - run: | - VALE_VERSION=$(curl --silent "https://api.github.com/repos/errata-ai/vale/releases/latest" | jq -r .tag_name) - curl -sSfL "https://github.com/errata-ai/vale/releases/download/${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz - tar -xzf vale.tar.gz - sudo mv vale /usr/local/bin/ - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 - with: - reviewdog_version: latest - - - name: Run Vale and Generate Suggestions - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - ./vale --output=line $file > vale_output.patch - if [ -s vale_output.patch ]; then - cat vale_output.patch - reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=warning -filter-mode=diff_context < vale_output.patch - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} - - - name: Run Vale with Code Suggester - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.SNIPPET_VALIDATION }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Vale + uses: errata-ai/vale-action@reviewdog + with: + version: 2.17.0 + + - name: Run Vale and Reviewdog for Linting + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + vale --output=JSON . | reviewdog -f=vale -name="Vale" -reporter=github-pr-check -fail-on-error=true -filter-mode=diff_context + + - name: Run Vale for Suggestions + run: vale --output=line . > vale_suggestions.diff + + - name: Apply Suggestions and Run Reviewdog Suggester + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tool_name: "Vale Suggestions" + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cat vale_suggestions.diff | reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -filter-mode=diff_context -fail-on-error=false From 061493d6f67a6f2390dc58579a830d70cddd9df8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:29:27 +0100 Subject: [PATCH 028/526] update token --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index eabf7bbd14c..1fe64e60d8d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: - name: Run Vale and Reviewdog for Linting env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} run: | vale --output=JSON . | reviewdog -f=vale -name="Vale" -reporter=github-pr-check -fail-on-error=true -filter-mode=diff_context @@ -30,9 +30,9 @@ jobs: - name: Apply Suggestions and Run Reviewdog Suggester uses: reviewdog/action-suggester@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.SNIPPET_VALIDATION }} tool_name: "Vale Suggestions" env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} run: | cat vale_suggestions.diff | reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -filter-mode=diff_context -fail-on-error=false From 77defdee30a002a74964742da6754fdb05de8712 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:31:53 +0100 Subject: [PATCH 029/526] update --- .github/workflows/vale.yml | 54 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1fe64e60d8d..9cc1a94cf6e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,38 +1,40 @@ -name: CI +name: Vale Lint on: pull_request: - types: [opened, synchronize, reopened, edited] + paths: + - '**/*.md' jobs: - lint: - name: Lint Documentation + vale: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - version: 2.17.0 + - name: Install jq + run: sudo apt-get install -y jq - - name: Run Vale and Reviewdog for Linting - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} - run: | - vale --output=JSON . | reviewdog -f=vale -name="Vale" -reporter=github-pr-check -fail-on-error=true -filter-mode=diff_context + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(cat changed_files.json)" + - name: Print Changed Files + run: echo $CHANGED_FILES - - name: Run Vale for Suggestions - run: vale --output=line . > vale_suggestions.diff + - name: Install Vale + uses: errata-ai/vale-action@v2 - - name: Apply Suggestions and Run Reviewdog Suggester - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.SNIPPET_VALIDATION }} - tool_name: "Vale Suggestions" - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} - run: | - cat vale_suggestions.diff | reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -filter-mode=diff_context -fail-on-error=false + - name: Run Vale on Changed Files + run: | + for file in $CHANGED_FILES; do + vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + done + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.files }} From b38f996ab8ded60d1ade0ac5b3a4d96ec90ba3bc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:38:01 +0100 Subject: [PATCH 030/526] update --- .github/workflows/vale.yml | 62 ++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9cc1a94cf6e..325ae67f5d2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Vale Lint and Suggest on: pull_request: @@ -10,31 +10,35 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(cat changed_files.json)" - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Run Vale on Changed Files - run: | - for file in $CHANGED_FILES; do - vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - done - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.files }} + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$CHANGED_FILES" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Run Vale and Reviewdog for Linting and Suggestions + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} + run: | + for file in $CHANGED_FILES; do + vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + + vale --output=line $file > vale_suggestions.diff + cat vale_suggestions.diff | reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=info -filter-mode=nofilter + done From 4b31a22b7b251d72dff708f2de78622d873c496f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:46:14 +0100 Subject: [PATCH 031/526] update --- .github/workflows/vale.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 325ae67f5d2..11da65ce093 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,6 +5,9 @@ on: paths: - '**/*.md' +permissions: + contents: read # Allows the workflow to read repository contents. + jobs: vale: runs-on: ubuntu-latest @@ -30,7 +33,14 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + sudo mv vale /usr/local/bin/vale # Move Vale to a directory in the PATH + + - name: Install Reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh + sudo mv reviewdog /usr/local/bin/reviewdog # Move Reviewdog to a directory in the PATH - name: Run Vale and Reviewdog for Linting and Suggestions env: From b579bc237b91dc5f72d230669f6bb57df165d226 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:47:33 +0100 Subject: [PATCH 032/526] update --- .github/workflows/vale.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 11da65ce093..c443e8daba5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,9 +5,6 @@ on: paths: - '**/*.md' -permissions: - contents: read # Allows the workflow to read repository contents. - jobs: vale: runs-on: ubuntu-latest @@ -33,18 +30,12 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - run: | - curl -sSfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - sudo mv vale /usr/local/bin/vale # Move Vale to a directory in the PATH + uses: errata-ai/vale-action@v2 - name: Install Reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh - sudo mv reviewdog /usr/local/bin/reviewdog # Move Reviewdog to a directory in the PATH + uses: reviewdog/action-setup@v1 - name: Run Vale and Reviewdog for Linting and Suggestions - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} run: | for file in $CHANGED_FILES; do vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter From 745550c7c0b9601b43008c531ba57f366aad9c5a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 13:50:21 +0100 Subject: [PATCH 033/526] add --- .github/workflows/vale.yml | 75 +++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c443e8daba5..fad0c5c8653 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint and Suggest +name: Vale Lint on: pull_request: @@ -10,36 +10,43 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$CHANGED_FILES" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run Vale and Reviewdog for Linting and Suggestions - run: | - for file in $CHANGED_FILES; do - vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - - vale --output=line $file > vale_suggestions.diff - cat vale_suggestions.diff | reviewdog -f=diff -name="Vale Suggestions" -reporter=github-pr-review -level=info -filter-mode=nofilter - done + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Run Vale and Reviewdog on Changed Files + run: | + for file in $CHANGED_FILES; do + vale --output=JSON $file > vale_output.json + reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} + + - name: Install Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.SNIPPET_VALIDATION }} + + - name: Run Reviewdog Suggestion + run: | + git diff > diff_output.txt + reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < diff_output.txt From b6c478aad1bdc2aec6d0ecae283ca97efa072d81 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:04:12 +0100 Subject: [PATCH 034/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index fad0c5c8653..83a0b744577 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,7 +35,7 @@ jobs: - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do - vale --output=JSON $file > vale_output.json + /path/to/vale --output=JSON $file > vale_output.json reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json done env: From 9675405236102b691058629c7bd3e6b4d50bcdcc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:07:02 +0100 Subject: [PATCH 035/526] update --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 83a0b744577..b122ac63145 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,9 +35,9 @@ jobs: - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do - /path/to/vale --output=JSON $file > vale_output.json - reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json - done + /home/runner/vale --output=JSON $file > vale_output.json + /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json + done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From 989b2f637200e733fcd6ded8f1cc3c071664eb9a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:11:08 +0100 Subject: [PATCH 036/526] update --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b122ac63145..0d02fa6691d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,12 +32,17 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + - name: Install Reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin + - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json + cat vale_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json - done + done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From c8700b0a17cb99316f2892267dc87eb268734ef9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:14:54 +0100 Subject: [PATCH 037/526] update --- .github/workflows/vale.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0d02fa6691d..cfc889235d1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,16 +32,13 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Install Reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin - - - name: Run Vale and Reviewdog on Changed Files + - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - cat vale_output.json - /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json + jq -c '[.[] | .file = $file | .]' vale_output.json | jq -s '.' > rdjson_output.json + cat rdjson_output.json + /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From f7aaf7697b2777862dc1972a70cac3455c6ddf5d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:16:22 +0100 Subject: [PATCH 038/526] update yaml --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cfc889235d1..b7c788c8e1d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,7 +32,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Run Vale and Reviewdog on Changed Files + - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json From 4a3e814ffe3478a892321d72c07234b7328b1226 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:19:34 +0100 Subject: [PATCH 039/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b7c788c8e1d..1ed3a3247e7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,7 +36,7 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq -c '[.[] | .file = $file | .]' vale_output.json | jq -s '.' > rdjson_output.json + jq --arg file "$file" -c '[.[] | .file = $file | .]' vale_output.json | jq -s '.' > rdjson_output.json cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From 1cc9e6a9c62e4a06162ca16c728fabc8abf85cac Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:22:05 +0100 Subject: [PATCH 040/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1ed3a3247e7..42e1b23fac6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,7 +36,7 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq --arg file "$file" -c '[.[] | .file = $file | .]' vale_output.json | jq -s '.' > rdjson_output.json + jq --arg file "$file" -c 'map(. + {file: $file})' vale_output.json > rdjson_output.json cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From fa81150d27eae2c7160fcf9b50ee914585e2bed6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:25:01 +0100 Subject: [PATCH 041/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 42e1b23fac6..e9f2a71483d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,7 +36,7 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq --arg file "$file" -c 'map(. + {file: $file})' vale_output.json > rdjson_output.json + jq --arg file "$file" '.[$file] | map(.file = $file)' vale_output.json | jq -s '.' > rdjson_output.json cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From 37f0424496a2b7b8215cd9a8ec5650b194b74d23 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:28:55 +0100 Subject: [PATCH 042/526] update --- .github/workflows/vale.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e9f2a71483d..0ac2a1df4df 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,13 +30,17 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@v2 + run: curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + + - name: Install Reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq --arg file "$file" '.[$file] | map(.file = $file)' vale_output.json | jq -s '.' > rdjson_output.json + jq --arg file "$file" '[.[$file][] | .file = $file]' vale_output.json | jq -c '.' > rdjson_output.json cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From ade50ee635a7277f7b52d08338b23e5b771382c8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:29:14 +0100 Subject: [PATCH 043/526] update --- .github/workflows/vale.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0ac2a1df4df..145bd9a6b54 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,11 +30,7 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - run: curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - - - name: Install Reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin + uses: errata-ai/vale-action@v2 - name: Run Vale and Reviewdog on Changed Files run: | From ba5e933f4d5a6292a29ac81dc40875e29541ebde Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:34:25 +0100 Subject: [PATCH 044/526] update --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 145bd9a6b54..652ba1d44e8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,9 +36,9 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq --arg file "$file" '[.[$file][] | .file = $file]' vale_output.json | jq -c '.' > rdjson_output.json - cat rdjson_output.json - /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json + jq -c --arg file "$file" '.[$file][] | .file = $file' vale_output.json > rdjsonl_output.json + cat rdjsonl_output.json + /home/runner/reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjsonl_output.json done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From 667bfe00e5a51cc105199eab00510a118cac967e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:38:20 +0100 Subject: [PATCH 045/526] update --- .github/workflows/vale.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 652ba1d44e8..a619e06e246 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,13 +32,17 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + - name: Create RDJSON Conversion Script + run: | + echo 'jq -r '"'"'to_entries[] | .value[] | {message: .Message, location: {path: .file, range: {start: {line: .Line, column: (.Span[0] + 1)}, end: {line: .Line, column: (.Span[1] + 1)}}}, severity: .Severity, code: {value: .Check, url: .Link}}'"'"'' > convert-to-rdjson.jq + - name: Run Vale and Reviewdog on Changed Files run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq -c --arg file "$file" '.[$file][] | .file = $file' vale_output.json > rdjsonl_output.json - cat rdjsonl_output.json - /home/runner/reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjsonl_output.json + jq -s -f convert-to-rdjson.jq vale_output.json > rdjson_output.json + cat rdjson_output.json + /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From 8db965b1c3dcf221c3dc803a3e31f61760296867 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:45:56 +0100 Subject: [PATCH 046/526] add --- .github/workflows/vale.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a619e06e246..10d180119aa 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,7 +34,20 @@ jobs: - name: Create RDJSON Conversion Script run: | - echo 'jq -r '"'"'to_entries[] | .value[] | {message: .Message, location: {path: .file, range: {start: {line: .Line, column: (.Span[0] + 1)}, end: {line: .Line, column: (.Span[1] + 1)}}}, severity: .Severity, code: {value: .Check, url: .Link}}'"'"'' > convert-to-rdjson.jq + cat << 'EOF' > convert-to-rdjson.jq + to_entries[] | .value[] | { + message: .Message, + location: { + path: .file, + range: { + start: { line: .Line, column: (.Span[0] + 1) }, + end: { line: .Line, column: (.Span[1] + 1) } + } + }, + severity: .Severity, + code: { value: .Check, url: .Link } + } + EOF - name: Run Vale and Reviewdog on Changed Files run: | From d25542201c07a5b6d3d3a92cf77868d4ae5194ec Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:49:04 +0100 Subject: [PATCH 047/526] add --- .github/workflows/vale.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 10d180119aa..e518971a307 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,6 +15,15 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits + - name: Setup Cache for Dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cache + /usr/local/bin/vale + /usr/local/bin/reviewdog + key: ${{ runner.os }}-vale-reviewdog-${{ hashFiles('**/*.md') }} + - name: Install jq run: sudo apt-get install -y jq @@ -53,7 +62,7 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq -s -f convert-to-rdjson.jq vale_output.json > rdjson_output.json + jq --arg file "$file" '[.[$file][] | .file = $file]' vale_output.json > rdjson_output.json cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From 34b5dbbe9f8fb3d8564a2540dfb776ca028306fa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:51:17 +0100 Subject: [PATCH 048/526] add --- .github/workflows/vale.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e518971a307..a143c1d267d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,15 +15,6 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits - - name: Setup Cache for Dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cache - /usr/local/bin/vale - /usr/local/bin/reviewdog - key: ${{ runner.os }}-vale-reviewdog-${{ hashFiles('**/*.md') }} - - name: Install jq run: sudo apt-get install -y jq From f19fcf373645b5b3d39a7326407c395223551886 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 14:54:59 +0100 Subject: [PATCH 049/526] add --- .github/workflows/vale.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a143c1d267d..76d1c38dea3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,6 +15,7 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits + - name: Install jq run: sudo apt-get install -y jq @@ -38,7 +39,7 @@ jobs: to_entries[] | .value[] | { message: .Message, location: { - path: .file, + path: $file, range: { start: { line: .Line, column: (.Span[0] + 1) }, end: { line: .Line, column: (.Span[1] + 1) } @@ -53,7 +54,10 @@ jobs: run: | for file in $CHANGED_FILES; do /home/runner/vale --output=JSON $file > vale_output.json - jq --arg file "$file" '[.[$file][] | .file = $file]' vale_output.json > rdjson_output.json + echo "Vale output for $file:" + cat vale_output.json + jq -s --arg file "$file" -f convert-to-rdjson.jq vale_output.json > rdjson_output.json + echo "RDJSON output for $file:" cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done From ab9e95c1b7300c0a6b63b51dcf4dc8d198ec7802 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:01:01 +0100 Subject: [PATCH 050/526] add --- .github/workflows/vale.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 76d1c38dea3..5fccd2e394f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,8 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits - + fetch-depth: 0 # Fetch all history so we can access all commits} - name: Install jq run: sudo apt-get install -y jq @@ -33,6 +32,14 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + - name: Run Vale and Print JSON Output + run: | + for file in $CHANGED_FILES; do + /home/runner/vale --output=JSON $file > vale_output.json + echo "Vale output for $file:" + cat vale_output.json + done + - name: Create RDJSON Conversion Script run: | cat << 'EOF' > convert-to-rdjson.jq From 918e29c0f2c977b104d2f000ac07b54d10d46042 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:05:26 +0100 Subject: [PATCH 051/526] add --- .github/workflows/vale.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5fccd2e394f..cb281b12b38 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits} + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install jq run: sudo apt-get install -y jq @@ -32,21 +32,13 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Run Vale and Print JSON Output - run: | - for file in $CHANGED_FILES; do - /home/runner/vale --output=JSON $file > vale_output.json - echo "Vale output for $file:" - cat vale_output.json - done - - name: Create RDJSON Conversion Script run: | cat << 'EOF' > convert-to-rdjson.jq - to_entries[] | .value[] | { + . as \$input | to_entries[] | .value[] | { message: .Message, location: { - path: $file, + path: .file, range: { start: { line: .Line, column: (.Span[0] + 1) }, end: { line: .Line, column: (.Span[1] + 1) } @@ -54,7 +46,7 @@ jobs: }, severity: .Severity, code: { value: .Check, url: .Link } - } + } | .file = \$input.key EOF - name: Run Vale and Reviewdog on Changed Files @@ -63,7 +55,7 @@ jobs: /home/runner/vale --output=JSON $file > vale_output.json echo "Vale output for $file:" cat vale_output.json - jq -s --arg file "$file" -f convert-to-rdjson.jq vale_output.json > rdjson_output.json + jq --arg file "$file" -f convert-to-rdjson.jq vale_output.json > rdjson_output.json echo "RDJSON output for $file:" cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json From 90831d8ce29c9cea06f9db24ba7cd244f01c3a4a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:10:22 +0100 Subject: [PATCH 052/526] add --- .github/workflows/vale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cb281b12b38..5bc12bba682 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,10 +35,10 @@ jobs: - name: Create RDJSON Conversion Script run: | cat << 'EOF' > convert-to-rdjson.jq - . as \$input | to_entries[] | .value[] | { + . as $input | to_entries[] | .value[] | { message: .Message, location: { - path: .file, + path: $input.key, range: { start: { line: .Line, column: (.Span[0] + 1) }, end: { line: .Line, column: (.Span[1] + 1) } @@ -46,7 +46,7 @@ jobs: }, severity: .Severity, code: { value: .Check, url: .Link } - } | .file = \$input.key + } EOF - name: Run Vale and Reviewdog on Changed Files @@ -55,7 +55,7 @@ jobs: /home/runner/vale --output=JSON $file > vale_output.json echo "Vale output for $file:" cat vale_output.json - jq --arg file "$file" -f convert-to-rdjson.jq vale_output.json > rdjson_output.json + jq --arg file "$file" -s -f convert-to-rdjson.jq vale_output.json > rdjson_output.json echo "RDJSON output for $file:" cat rdjson_output.json /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json From 2c829f6ac2223579cbe84588c5d03c9d0238f6ed Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:15:03 +0100 Subject: [PATCH 053/526] add --- .github/workflows/vale.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5bc12bba682..95a2ba18963 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,18 +35,21 @@ jobs: - name: Create RDJSON Conversion Script run: | cat << 'EOF' > convert-to-rdjson.jq - . as $input | to_entries[] | .value[] | { - message: .Message, - location: { - path: $input.key, - range: { - start: { line: .Line, column: (.Span[0] + 1) }, - end: { line: .Line, column: (.Span[1] + 1) } - } - }, - severity: .Severity, - code: { value: .Check, url: .Link } - } + map( + # Construct the Reviewdog-compatible object + { + message: .Message, + location: { + path: .File, + range: { + start: { line: .Line, column: (.Span[0] + 1) }, + end: { line: .Line, column: (.Span[1] + 1) } + } + }, + severity: .Severity, + code: { value: .Check, url: .Link } + } + ) EOF - name: Run Vale and Reviewdog on Changed Files From f00ca2b3a315cca5d81c282b2e75a7d568a83e8e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:18:53 +0100 Subject: [PATCH 054/526] add --- .github/workflows/vale.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 95a2ba18963..ed9ff4fc8cc 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,21 +35,21 @@ jobs: - name: Create RDJSON Conversion Script run: | cat << 'EOF' > convert-to-rdjson.jq - map( - # Construct the Reviewdog-compatible object - { - message: .Message, - location: { - path: .File, - range: { - start: { line: .Line, column: (.Span[0] + 1) }, - end: { line: .Line, column: (.Span[1] + 1) } - } - }, - severity: .Severity, - code: { value: .Check, url: .Link } - } - ) + to_entries[] | { + file: .key, + diagnostics: .value + } | .diagnostics[] | { + message: .Message, + location: { + path: .file, + range: { + start: { line: .Line, column: (.Span[0] + 1) }, + end: { line: .Line, column: (.Span[1] + 1) } + } + }, + severity: .Severity, + code: { value: .Check, url: .Link } + } EOF - name: Run Vale and Reviewdog on Changed Files From ba93d5b40f1d8546122014a6d574162bd458d266 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:26:22 +0100 Subject: [PATCH 055/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ed9ff4fc8cc..1706f8f9d57 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,7 +39,6 @@ jobs: file: .key, diagnostics: .value } | .diagnostics[] | { - message: .Message, location: { path: .file, range: { From d2cb6900e7fd44863f3c8fd1bd8b173f2fb478f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:31:02 +0100 Subject: [PATCH 056/526] add --- .github/workflows/vale.yml | 42 +++++--------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1706f8f9d57..7dd79170e93 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,52 +15,20 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Create RDJSON Conversion Script + - name: Install Reviewdog run: | - cat << 'EOF' > convert-to-rdjson.jq - to_entries[] | { - file: .key, - diagnostics: .value - } | .diagnostics[] | { - location: { - path: .file, - range: { - start: { line: .Line, column: (.Span[0] + 1) }, - end: { line: .Line, column: (.Span[1] + 1) } - } - }, - severity: .Severity, - code: { value: .Check, url: .Link } - } - EOF + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin - name: Run Vale and Reviewdog on Changed Files run: | - for file in $CHANGED_FILES; do - /home/runner/vale --output=JSON $file > vale_output.json + for file in ${{ steps.changed-files.outputs.files }}; do + vale --output=JSON $file > vale_output.json echo "Vale output for $file:" cat vale_output.json - jq --arg file "$file" -s -f convert-to-rdjson.jq vale_output.json > rdjson_output.json - echo "RDJSON output for $file:" - cat rdjson_output.json - /home/runner/reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json + reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} From 62a8bb6a2c806fa73ed67f416d6787c560e21f50 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 15:36:47 +0100 Subject: [PATCH 057/526] add --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7dd79170e93..e9f02611f53 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,12 +31,12 @@ jobs: reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json done env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.SNIPPET_VALIDATION }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Install Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: - github_token: ${{ secrets.SNIPPET_VALIDATION }} + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run Reviewdog Suggestion run: | From 0a9f64a6560d51359b3b67ff4cbc77d64596ee8a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 16:56:55 +0100 Subject: [PATCH 058/526] add --- .github/workflows/vale.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e9f02611f53..d029c8846da 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,12 +15,22 @@ jobs: with: fetch-depth: 0 # Fetch all history so we can access all commits - - name: Install Vale - uses: errata-ai/vale-action@v2 + - name: Install jq + run: sudo apt-get install -y jq - - name: Install Reviewdog + - name: Get changed files + id: changed-files run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Install Vale + uses: errata-ai/vale-action@v2 - name: Run Vale and Reviewdog on Changed Files run: | From ce216595df57a09ecce705275ec79ca006970b16 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:08:10 +0100 Subject: [PATCH 059/526] add --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d029c8846da..6dd66f88db0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -38,7 +38,10 @@ jobs: vale --output=JSON $file > vale_output.json echo "Vale output for $file:" cat vale_output.json - reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < vale_output.json + jq '.[] | .file = "'$file'"' vale_output.json | jq -s . > rdjson_output.json + echo "RDJSON output for $file:" + cat rdjson_output.json + reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -52,3 +55,5 @@ jobs: run: | git diff > diff_output.txt reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < diff_output.txt + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From f512855a9361a6da83ec3e9d6edfa0167694d376 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:12:54 +0100 Subject: [PATCH 060/526] ad --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6dd66f88db0..d309f000637 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,7 +30,9 @@ jobs: run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + curl -L https://github.com/errata-ai/vale/releases/latest/download/vale-linux-amd64.tar.gz | tar -xz + sudo mv vale /usr/local/bin/vale - name: Run Vale and Reviewdog on Changed Files run: | From 1cf964b3c0733336dc44093b583667d5b4d15d99 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:17:24 +0100 Subject: [PATCH 061/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d309f000637..db731012eee 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,7 +31,8 @@ jobs: - name: Install Vale run: | - curl -L https://github.com/errata-ai/vale/releases/latest/download/vale-linux-amd64.tar.gz | tar -xz + curl -L -o vale.tar.gz https://github.com/errata-ai/vale/releases/latest/download/vale-linux-amd64.tar.gz + tar -xzf vale.tar.gz sudo mv vale /usr/local/bin/vale - name: Run Vale and Reviewdog on Changed Files From 32eebe121549fb0393b97f512e17583d5dbd5afb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:21:52 +0100 Subject: [PATCH 062/526] add --- .github/workflows/vale.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index db731012eee..4954b28fbae 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,12 +29,6 @@ jobs: - name: Print Changed Files run: echo $CHANGED_FILES - - name: Install Vale - run: | - curl -L -o vale.tar.gz https://github.com/errata-ai/vale/releases/latest/download/vale-linux-amd64.tar.gz - tar -xzf vale.tar.gz - sudo mv vale /usr/local/bin/vale - - name: Run Vale and Reviewdog on Changed Files run: | for file in ${{ steps.changed-files.outputs.files }}; do From ef128ac768008ebfde4085344af985681c30a689 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:25:06 +0100 Subject: [PATCH 063/526] add --- .github/workflows/vale.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4954b28fbae..176c985f61e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,7 +27,10 @@ jobs: echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files - run: echo $CHANGED_FILES + run: echo ${{ steps.changed-files.outputs.files }} + + - name: Install Vale + uses: errata-ai/vale-action@reviewdog - name: Run Vale and Reviewdog on Changed Files run: | From 946e374cb8e36ea821b2ef6cb9331f9c9a275e07 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:26:26 +0100 Subject: [PATCH 064/526] add --- .github/workflows/vale.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 176c985f61e..9bffff1fee6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,6 +31,9 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog + with: + files: styles/custom + reporter: github-pr-check - name: Run Vale and Reviewdog on Changed Files run: | From 8173a12495ea23577b9b5233fb526f78de433d7d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:36:48 +0100 Subject: [PATCH 065/526] add --- .github/workflows/vale.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9bffff1fee6..a31ba763759 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,19 +35,13 @@ jobs: files: styles/custom reporter: github-pr-check - - name: Run Vale and Reviewdog on Changed Files + - name: Run Vale on Changed Files run: | - for file in ${{ steps.changed-files.outputs.files }}; do - vale --output=JSON $file > vale_output.json - echo "Vale output for $file:" - cat vale_output.json - jq '.[] | .file = "'$file'"' vale_output.json | jq -s . > rdjson_output.json - echo "RDJSON output for $file:" - cat rdjson_output.json - reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + for file in $CHANGED_FILES; do + vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + done + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.files }} - name: Install Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 From 33249fa4e5e66ed168f5cfda7fa5e3e4543a498a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:41:42 +0100 Subject: [PATCH 066/526] add --- .github/workflows/vale.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a31ba763759..781814843fc 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,30 +27,31 @@ jobs: echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files - run: echo ${{ steps.changed-files.outputs.files }} + run: echo $CHANGED_FILES - name: Install Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 + + - name: Install Reviewdog + uses: reviewdog/action-setup@v1 with: - files: styles/custom - reporter: github-pr-check + reviewdog_version: latest - - name: Run Vale on Changed Files + - name: Run Vale on changed files with reviewdog run: | - for file in $CHANGED_FILES; do + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - done - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.files }} + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Install Reviewdog Suggestion Action + - name: Run Vale with code suggester uses: reviewdog/action-suggester@v1 with: github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Run Reviewdog Suggestion - run: | - git diff > diff_output.txt - reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < diff_output.txt - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" From 9881401aae877cb9e7dd27e9bda7cef5abe2887f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:47:19 +0100 Subject: [PATCH 067/526] add --- .github/workflows/vale.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 781814843fc..6f9bf979001 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -55,3 +55,9 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" + - name: Run Reviewdog Suggestion + run: | + git diff > diff_output.txt + reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < diff_output.txt + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 5e2b3065e4d7f95f4dab0005c472a8581a12adb2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 17:49:59 +0100 Subject: [PATCH 068/526] add --- .github/workflows/vale.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6f9bf979001..fbe6c95c1bb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -46,6 +46,16 @@ jobs: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run Vale with code suggester + run: | + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + vale --output=JSON $file > vale_output.json + jq '.[] | .file = "'$file'"' vale_output.json | jq -s . > rdjson_output.json + reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -55,6 +65,7 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" + - name: Run Reviewdog Suggestion run: | git diff > diff_output.txt From 7bb8d14503c1df4e2386bbd4be1620db88394f77 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 21:44:01 +0100 Subject: [PATCH 069/526] add --- .github/workflows/vale.yml | 2 ++ .reviewdog.yml | 8 ++++++++ styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/UIElements.yml | 2 +- 6 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .reviewdog.yml diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index fbe6c95c1bb..0d6dd7803d6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -62,9 +62,11 @@ jobs: tool_name: Vale level: "warning" filter_mode: "diff_context" + reporter: github-pr-review fail_on_error: "false" reviewdog_flags: "" cleanup: "true" + reviewdog_flags: "--diff='git diff HEAD^'" - name: Run Reviewdog Suggestion run: | diff --git a/.reviewdog.yml b/.reviewdog.yml new file mode 100644 index 00000000000..08a73d53bfa --- /dev/null +++ b/.reviewdog.yml @@ -0,0 +1,8 @@ +runner: + vale: + cmd: vale --output=JSON . + format: JSON + name: Vale + level: warning + errorformat: + - '%f:%l:%c: %m' diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 3c983764beb..ff3962fb88c 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,6 +1,6 @@ extends: substitution -message: "Avoid Latin abbreviations: '$1'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." +message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." level: warning swap: - e.g.: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 99e25d6a074..fcaceeb10d4 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: existence -message: "Repetitive word found: '$0'. Consider revising." +message: "Repetitive word found: '%s'. Consider revising." level: warning # Regex to match repetitive words (e.g., "the the", "and and") ignorecase: true diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 39e3ac1604d..1d53f8ab232 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: existence -message: "Header '$0' should be in sentence case: 'Sentence case header'." +message: "Header '%s' should be in sentence case: 'Sentence case header'." level: error scope: heading ignorecase: false diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index d7065138609..904a5a6e583 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,6 +1,6 @@ extends: existence -message: "UI elements should be bold: '$1'." +message: "UI elements should be bold: '%s'." level: warning tokens: - '\Save\b' From a06a2d730dee168945a6b111b9bc172a8815c0cc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 21:48:00 +0100 Subject: [PATCH 070/526] add --- .github/workflows/vale.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0d6dd7803d6..8306e53f090 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -40,7 +40,7 @@ jobs: - name: Run Vale on changed files with reviewdog run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + vale --output=JSON $file . > vale_output.json | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -62,11 +62,9 @@ jobs: tool_name: Vale level: "warning" filter_mode: "diff_context" - reporter: github-pr-review fail_on_error: "false" reviewdog_flags: "" cleanup: "true" - reviewdog_flags: "--diff='git diff HEAD^'" - name: Run Reviewdog Suggestion run: | From 846b36b954418c7b8a9aca03da01346666d2102d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 21:53:39 +0100 Subject: [PATCH 071/526] add --- .github/workflows/vale.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8306e53f090..7782b370cb2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -37,10 +37,11 @@ jobs: with: reviewdog_version: latest - - name: Run Vale on changed files with reviewdog + - name: Run Vale on changed files with Reviewdog run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=JSON $file . > vale_output.json | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + vale --output=JSON $file > vale_output.json + cat vale_output.json | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -50,7 +51,7 @@ jobs: for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file > vale_output.json jq '.[] | .file = "'$file'"' vale_output.json | jq -s . > rdjson_output.json - reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.json + cat rdjson_output.json | reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -65,10 +66,3 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" - - - name: Run Reviewdog Suggestion - run: | - git diff > diff_output.txt - reviewdog -f=diff -f.diff.strip=1 -reporter=github-pr-review < diff_output.txt - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 014a22274945df4c9b62aab63646a48ef3109ea9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:04:34 +0100 Subject: [PATCH 072/526] add --- .github/workflows/vale.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7782b370cb2..c083f119d40 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -37,21 +37,12 @@ jobs: with: reviewdog_version: latest - - name: Run Vale on changed files with Reviewdog + - name: Run Vale and Create Suggestions run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file > vale_output.json - cat vale_output.json | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Run Vale with code suggester - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=JSON $file > vale_output.json - jq '.[] | .file = "'$file'"' vale_output.json | jq -s . > rdjson_output.json - cat rdjson_output.json | reviewdog -f=rdjson -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + cat vale_output.json | jq -r '.[] | .file = "'$file'" | @json' > rdjson_output.jsonl + cat rdjson_output.jsonl | reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 4389f462e692bb558b0f9fc8894508c8e98f3549 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:10:51 +0100 Subject: [PATCH 073/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c083f119d40..ba1adb65697 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -41,7 +41,7 @@ jobs: run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file > vale_output.json - cat vale_output.json | jq -r '.[] | .file = "'$file'" | @json' > rdjson_output.jsonl + jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' vale_output.json > rdjson_output.jsonl cat rdjson_output.jsonl | reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: From f534554d4de16ab2207fc35177531dacf409b533 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:17:34 +0100 Subject: [PATCH 074/526] add --- .github/workflows/vale.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ba1adb65697..3be5a41a701 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 - name: Install jq run: sudo apt-get install -y jq @@ -37,11 +37,25 @@ jobs: with: reviewdog_version: latest - - name: Run Vale and Create Suggestions + - name: Run Vale on changed files run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Running Vale on $file" vale --output=JSON $file > vale_output.json - jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' vale_output.json > rdjson_output.jsonl + cat vale_output.json + done + + - name: Process Vale output + run: | + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + vale --output=JSON $file > vale_output.json + cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl + cat rdjson_output.jsonl + done + + - name: Run Reviewdog with processed output + run: | + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do cat rdjson_output.jsonl | reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: From 62644478dad22ca00f65a2a7d7e716490b13aed7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:26:09 +0100 Subject: [PATCH 075/526] add --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3be5a41a701..5dd79c18c67 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -49,6 +49,7 @@ jobs: run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do vale --output=JSON $file > vale_output.json + cat vale_output.json cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl cat rdjson_output.jsonl done From 2d569cbe1aefa81987aa10b12015c19c4877d08c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:33:04 +0100 Subject: [PATCH 076/526] add --- .github/workflows/reviewdog.yml | 25 +++++++++++++++++++++++ .github/workflows/vale.yml | 36 +++------------------------------ 2 files changed, 28 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 00000000000..8557d3b53e6 --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,25 @@ +name: Reviewdog suggester + +on: + pull_request: + paths: + - '**/*.md' + +jobs: + suggest: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5dd79c18c67..26c6ffdc07c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -12,8 +12,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 + + - name: Install Vale + uses: errata-ai/vale-action@v2 - name: Install jq run: sudo apt-get install -y jq @@ -29,46 +30,15 @@ jobs: - name: Print Changed Files run: echo $CHANGED_FILES - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 - with: - reviewdog_version: latest - - name: Run Vale on changed files run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" vale --output=JSON $file > vale_output.json cat vale_output.json - done - - - name: Process Vale output - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=JSON $file > vale_output.json - cat vale_output.json cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl cat rdjson_output.jsonl - done - - - name: Run Reviewdog with processed output - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do cat rdjson_output.jsonl | reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" From dfaf8f6edb962070e33b62a87274be576b11a37c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 13 Jun 2024 22:43:35 +0100 Subject: [PATCH 077/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 26c6ffdc07c..1d1a06e4402 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@v2 From 733a918aa3780d0a3940e9567e4092032aadfa27 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 14:58:23 +0100 Subject: [PATCH 078/526] add --- .github/workflows/reviewdog.yml | 11 +++++++++++ .github/workflows/vale.yml | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 8557d3b53e6..9e8a0ac7274 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -13,6 +13,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Download Vale results + uses: actions/download-artifact@v3 + with: + name: vale-results + - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: @@ -23,3 +28,9 @@ jobs: fail_on_error: "false" reviewdog_flags: "" cleanup: "true" + + - name: Run Reviewdog with Vale results + run: | + reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.jsonl + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1d1a06e4402..9e66fa72b42 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -40,7 +40,12 @@ jobs: cat vale_output.json cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl cat rdjson_output.jsonl - cat rdjson_output.jsonl | reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Upload Vale results + uses: actions/upload-artifact@v3 + with: + name: vale-results + path: rdjson_output.jsonl From 8d7b875a396ba694373abe6f8d04de28f0ed8c1b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:03:34 +0100 Subject: [PATCH 079/526] add --- .github/workflows/reviewdog.yml | 36 --------------------------------- .github/workflows/vale.yml | 34 +++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 9e8a0ac7274..e69de29bb2d 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -1,36 +0,0 @@ -name: Reviewdog suggester - -on: - pull_request: - paths: - - '**/*.md' - -jobs: - suggest: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download Vale results - uses: actions/download-artifact@v3 - with: - name: vale-results - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with Vale results - run: | - reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.jsonl - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9e66fa72b42..73100ca5893 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Lint and Suggest on: pull_request: @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -49,3 +49,33 @@ jobs: with: name: vale-results path: rdjson_output.jsonl + + suggest: # Reviewdog suggestion job + runs-on: ubuntu-latest + needs: vale # This ensures the suggest job runs after the vale job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download Vale results + uses: actions/download-artifact@v3 + with: + name: vale-results + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with Vale results + run: | + reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.jsonl + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From ea057aa75eef59444208802b964292a675a91a8c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:08:01 +0100 Subject: [PATCH 080/526] add --- .github/workflows/vale.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 73100ca5893..1ea76b8755f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and Suggest +name: Vale Lint on: pull_request: @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: @@ -37,8 +37,10 @@ jobs: for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" vale --output=JSON $file > vale_output.json + echo "Vale output for $file:" cat vale_output.json - cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0]}' > rdjson_output.jsonl + cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (if .Suggestions != null and .Suggestions | length > 0 then .Suggestions[0] else null end)}' > rdjson_output.jsonl + echo "Reviewdog JSONL output for $file:" cat rdjson_output.jsonl done env: @@ -50,6 +52,7 @@ jobs: name: vale-results path: rdjson_output.jsonl + suggest: # Reviewdog suggestion job runs-on: ubuntu-latest needs: vale # This ensures the suggest job runs after the vale job From a870091f7c37f0bcf35eda937d6649d4f5ece9e8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:09:22 +0100 Subject: [PATCH 081/526] add --- .github/workflows/vale.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1ea76b8755f..138b2a167be 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Lint and suggest on: pull_request: @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -34,14 +34,10 @@ jobs: - name: Run Vale on changed files run: | + echo "[]" > rdjson_output.jsonl for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file > vale_output.json - echo "Vale output for $file:" - cat vale_output.json - cat vale_output.json | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (if .Suggestions != null and .Suggestions | length > 0 then .Suggestions[0] else null end)}' > rdjson_output.jsonl - echo "Reviewdog JSONL output for $file:" - cat rdjson_output.jsonl + vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} @@ -52,7 +48,6 @@ jobs: name: vale-results path: rdjson_output.jsonl - suggest: # Reviewdog suggestion job runs-on: ubuntu-latest needs: vale # This ensures the suggest job runs after the vale job From 970dd4ff05930e756bb37de024481ee55514f883 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:17:42 +0100 Subject: [PATCH 082/526] add --- .github/workflows/vale.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 138b2a167be..c712dc58d12 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,9 +35,14 @@ jobs: - name: Run Vale on changed files run: | echo "[]" > rdjson_output.jsonl - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + vale_output=$(vale --output=JSON "$file") + if [ $? -eq 0 ]; then + echo "$vale_output" | jq -c '.[] | {file: "'"$file"'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + else + echo "Error processing $file" + fi done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 1274c3c2f22debe0f20b50efbbd3f73ef16cc49d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:23:22 +0100 Subject: [PATCH 083/526] add --- .github/workflows/vale.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c712dc58d12..be546131f3b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,15 +35,18 @@ jobs: - name: Run Vale on changed files run: | echo "[]" > rdjson_output.jsonl - for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do + for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do echo "Running Vale on $file" vale_output=$(vale --output=JSON "$file") if [ $? -eq 0 ]; then - echo "$vale_output" | jq -c '.[] | {file: "'"$file"'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + echo "$vale_output" | jq -c --arg file "$file" '.[] | {file: $file, line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl else echo "Error processing $file" fi done + echo "Vale output:" + cat rdjson_output.jsonl + env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 1fd5393b150c5b771599460a974bcade49beb341 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:27:21 +0100 Subject: [PATCH 084/526] add --- .github/workflows/vale.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index be546131f3b..922ff227a77 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,21 +35,24 @@ jobs: - name: Run Vale on changed files run: | echo "[]" > rdjson_output.jsonl - for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale_output=$(vale --output=JSON "$file") - if [ $? -eq 0 ]; then - echo "$vale_output" | jq -c --arg file "$file" '.[] | {file: $file, line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl - else - echo "Error processing $file" - fi + vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl || echo "Error processing $file" done echo "Vale output:" cat rdjson_output.jsonl - env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Check if rdjson_output.jsonl exists + run: | + if [ -f rdjson_output.jsonl ]; then + echo "rdjson_output.jsonl exists." + else + echo "rdjson_output.jsonl does not exist." + exit 1 + fi + - name: Upload Vale results uses: actions/upload-artifact@v3 with: @@ -69,6 +72,18 @@ jobs: with: name: vale-results + - name: List downloaded files + run: ls -l + + - name: Check if rdjson_output.jsonl exists + run: | + if [ -f rdjson_output.jsonl ]; then + echo "rdjson_output.jsonl exists." + else + echo "rdjson_output.jsonl does not exist." + exit 1 + fi + - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: @@ -82,6 +97,7 @@ jobs: - name: Run Reviewdog with Vale results run: | + cat rdjson_output.jsonl reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.jsonl env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 34df08877361f5a7ede1c1a377bcebfb745b5882 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:35:18 +0100 Subject: [PATCH 085/526] add --- styles/custom/SentenceCaseHeaders.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 1d53f8ab232..d565bee6a0a 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,7 +1,7 @@ extends: existence message: "Header '%s' should be in sentence case: 'Sentence case header'." -level: error +level: warning scope: heading ignorecase: false tokens: | From bb84f78f490d598280ddd3a56099050288eb17e2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:37:52 +0100 Subject: [PATCH 086/526] add --- styles/custom/LatinAbbreviations.yml | 7 +++++++ styles/custom/Repitition.yml | 2 ++ styles/custom/Typos.yml | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index ff3962fb88c..eb49fe7add9 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -8,3 +8,10 @@ swap: - i.e.: that is - etc.: and so on - N.B.: Note + +edit: + - 's/e.g./for example/g' + - 's/i.e./for example/g' + - 's/i.e./that is/g' + - 's/etc./and so on/g' + - 's/N.B./Note/g' diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index fcaceeb10d4..afd02730433 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -8,3 +8,5 @@ nonword: true tokens: - '\b(\w+)\s+\1\b' +edit: + - 's/\b(\w+)\s+\1\b/\1/' diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 6e449598033..06cf72fde3f 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -9,3 +9,11 @@ swap: - seperate: separate - occured: occurred - untill: until + +edit: + - 's/teh/the/g' + - 's/recieve/receive/g' + - 's/definately/definitely/g' + - 's/seperate/separate/g' + - 's/occured/occurred/g' + - 's/untill/until/g' From afbf3b76c15f8e183a5bc9217c565bd06d757404 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:43:08 +0100 Subject: [PATCH 087/526] add --- styles/custom/LatinAbbreviations.yml | 8 ++------ styles/custom/Repitition.yml | 8 ++++++-- styles/custom/Typos.yml | 9 ++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index eb49fe7add9..d3ecf15df08 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -9,9 +9,5 @@ swap: - etc.: and so on - N.B.: Note -edit: - - 's/e.g./for example/g' - - 's/i.e./for example/g' - - 's/i.e./that is/g' - - 's/etc./and so on/g' - - 's/N.B./Note/g' +action: + name: replace diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index afd02730433..2708a834559 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -8,5 +8,9 @@ nonword: true tokens: - '\b(\w+)\s+\1\b' -edit: - - 's/\b(\w+)\s+\1\b/\1/' +action: + name: edit + params: + - regex + - '\b(\w+)\s+\1\b' + - '\1' diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 06cf72fde3f..be02d360dcc 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -10,10 +10,5 @@ swap: - occured: occurred - untill: until -edit: - - 's/teh/the/g' - - 's/recieve/receive/g' - - 's/definately/definitely/g' - - 's/seperate/separate/g' - - 's/occured/occurred/g' - - 's/untill/until/g' +action: + name: replace From 49081c6bc9c9b06ac3d37ba32a7e9736efaefa45 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:51:39 +0100 Subject: [PATCH 088/526] add --- .github/workflows/vale.yml | 56 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 922ff227a77..de2c0f4b732 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,30 +34,34 @@ jobs: - name: Run Vale on changed files run: | - echo "[]" > rdjson_output.jsonl for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file | jq -c '.[] | {file: "'$file'", line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl || echo "Error processing $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.json" done - echo "Vale output:" - cat rdjson_output.jsonl - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + echo "Vale outputs:" + ls -l - - name: Check if rdjson_output.jsonl exists + - name: Apply Vale edits run: | - if [ -f rdjson_output.jsonl ]; then - echo "rdjson_output.jsonl exists." - else - echo "rdjson_output.jsonl does not exist." - exit 1 - fi + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + mv $file "${file}.original" + vale --output=edit $file > $file + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Upload Vale results uses: actions/upload-artifact@v3 with: name: vale-results - path: rdjson_output.jsonl + path: '*.json' + + - name: Upload corrected files + uses: actions/upload-artifact@v3 + with: + name: corrected-files + path: '*.md' suggest: # Reviewdog suggestion job runs-on: ubuntu-latest @@ -72,18 +76,14 @@ jobs: with: name: vale-results + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + - name: List downloaded files run: ls -l - - name: Check if rdjson_output.jsonl exists - run: | - if [ -f rdjson_output.jsonl ]; then - echo "rdjson_output.jsonl exists." - else - echo "rdjson_output.jsonl does not exist." - exit 1 - fi - - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: @@ -97,7 +97,13 @@ jobs: - name: Run Reviewdog with Vale results run: | - cat rdjson_output.jsonl - reviewdog -f=rdjsonl -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < rdjson_output.jsonl + for file in $(ls *.md.original); do + original="${file}" + corrected="${file%.original}" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + fi + done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From ab3f9c7fb39762d52bc72e0db0e4516e525ca3f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 15:57:16 +0100 Subject: [PATCH 089/526] add --- .github/workflows/vale.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index de2c0f4b732..7d9524e7b76 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -37,7 +37,7 @@ jobs: for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l @@ -46,17 +46,11 @@ jobs: run: | for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do mv $file "${file}.original" - vale --output=edit $file > $file + mv "vale_output_${file//\//_}_edit.md" $file done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: '*.json' - - name: Upload corrected files uses: actions/upload-artifact@v3 with: @@ -71,11 +65,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Download Vale results - uses: actions/download-artifact@v3 - with: - name: vale-results - - name: Download corrected files uses: actions/download-artifact@v3 with: @@ -95,7 +84,7 @@ jobs: reviewdog_flags: "" cleanup: "true" - - name: Run Reviewdog with Vale results + - name: Run Reviewdog with corrected files run: | for file in $(ls *.md.original); do original="${file}" From e8af3fcb0bf22d8b528feb5cb977b27686bccf3e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 16:08:29 +0100 Subject: [PATCH 090/526] add --- .github/workflows/vale.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7d9524e7b76..0eef0d3a64f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -42,20 +42,28 @@ jobs: echo "Vale outputs:" ls -l - - name: Apply Vale edits + - name: Apply Vale edits and save originals run: | + mkdir -p original_files + mkdir -p corrected_files for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - mv $file "${file}.original" - mv "vale_output_${file//\//_}_edit.md" $file + cp $file "original_files/${file//\//_}.original" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Upload original files + uses: actions/upload-artifact@v3 + with: + name: original-files + path: original_files/ + - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files - path: '*.md' + path: corrected_files/ suggest: # Reviewdog suggestion job runs-on: ubuntu-latest @@ -65,6 +73,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Download original files + uses: actions/download-artifact@v3 + with: + name: original-files + - name: Download corrected files uses: actions/download-artifact@v3 with: @@ -86,9 +99,9 @@ jobs: - name: Run Reviewdog with corrected files run: | - for file in $(ls *.md.original); do - original="${file}" - corrected="${file%.original}" + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" diff_output=$(diff -u "$original" "$corrected") if [[ -n "$diff_output" ]]; then echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter From d29c4894d01d0937a75c8164ade9c822019a548a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 16:31:47 +0100 Subject: [PATCH 091/526] add --- .github/workflows/vale.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0eef0d3a64f..a915c31631b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -47,9 +47,13 @@ jobs: mkdir -p original_files mkdir -p corrected_files for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - cp $file "original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 0e612d560d6e290b52dc8cb0fbdea0d929b3bad2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 16:36:05 +0100 Subject: [PATCH 092/526] add --- .github/workflows/vale.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a915c31631b..b798656a741 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -47,7 +47,9 @@ jobs: mkdir -p original_files mkdir -p corrected_files for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" done echo "Original files:" @@ -62,12 +64,14 @@ jobs: with: name: original-files path: original_files/ + continue-on-error: true - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files path: corrected_files/ + continue-on-error: true suggest: # Reviewdog suggestion job runs-on: ubuntu-latest @@ -88,7 +92,11 @@ jobs: name: corrected-files - name: List downloaded files - run: ls -l + run: | + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 From 08d82db424df29568ca48e3c6f26b09f551748ed Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 14 Jun 2024 16:41:51 +0100 Subject: [PATCH 093/526] add --- .github/workflows/vale.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b798656a741..5d22af4fedc 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,14 +27,14 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" @@ -46,7 +46,7 @@ jobs: run: | mkdir -p original_files mkdir -p corrected_files - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" @@ -64,14 +64,12 @@ jobs: with: name: original-files path: original_files/ - continue-on-error: true - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files path: corrected_files/ - continue-on-error: true suggest: # Reviewdog suggestion job runs-on: ubuntu-latest From dc6a3995e7d45aa005fe2d89e9bf7b0ea8a5578b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 09:24:58 +0100 Subject: [PATCH 094/526] add --- .github/workflows/vale.yml | 142 ++++++++----------------------------- 1 file changed, 31 insertions(+), 111 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5d22af4fedc..b6c4e982b68 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and suggest +name: Vale Linting and Suggestions on: pull_request: @@ -6,116 +6,36 @@ on: - '**/*.md' jobs: - vale: # Vale linting job + vale-lint: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Upload original files - uses: actions/upload-artifact@v3 - with: - name: original-files - path: original_files/ - - - name: Upload corrected files - uses: actions/upload-artifact@v3 - with: - name: corrected-files - path: corrected_files/ - - suggest: # Reviewdog suggestion job - runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download original files - uses: actions/download-artifact@v3 - with: - name: original-files - - - name: Download corrected files - uses: actions/download-artifact@v3 - with: - name: corrected-files - - - name: List downloaded files - run: | - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Vale + run: | + curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh -s -- -b $HOME/.local/bin + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Run Vale + run: | + vale --output=JSON . > vale_output.json + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Process Vale Output for Reviewdog + run: | + jq -c '.[] | {file: .Path, line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0], severity: .Severity}' vale_output.json > rdjson_output.jsonl + + - name: Reviewdog - Report results and Suggest changes + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale + level: warning + reporter: github-pr-review + filter_mode: added + fail_on_error: true + input_file: rdjson_output.jsonl + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 212dfceb21098c29a6de33589f074c6a7b9c24de Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 09:40:07 +0100 Subject: [PATCH 095/526] add --- .github/workflows/vale.yml | 147 +++++++++++++++++++++++++++++-------- 1 file changed, 116 insertions(+), 31 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b6c4e982b68..3a23164c659 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Linting and Suggestions +name: Lint and suggest on: pull_request: @@ -6,36 +6,121 @@ on: - '**/*.md' jobs: - vale-lint: + vale: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Vale - run: | - curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh -s -- -b $HOME/.local/bin - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Run Vale - run: | - vale --output=JSON . > vale_output.json - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Process Vale Output for Reviewdog - run: | - jq -c '.[] | {file: .Path, line: .Line, column: .Span[0], message: .Message, suggestion: .Suggestions[0], severity: .Severity}' vale_output.json > rdjson_output.jsonl - - - name: Reviewdog - Report results and Suggest changes - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - level: warning - reporter: github-pr-review - filter_mode: added - fail_on_error: true - input_file: rdjson_output.jsonl - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Upload original files + uses: actions/upload-artifact@v3 + with: + name: original-files + path: original_files/ + + - name: Upload corrected files + uses: actions/upload-artifact@v3 + with: + name: corrected-files + path: corrected_files/ + + suggest: + runs-on: ubuntu-latest + needs: vale + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download original files + uses: actions/download-artifact@v3 + with: + name: original-files + + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + + - name: List downloaded files + run: | + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with corrected files + run: | + mkdir -p temp_diff + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" > "temp_diff/$(basename "$file" .original).diff" + fi + done + ls temp_diff/ + for diff_file in temp_diff/*.diff; do + reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < "$diff_file" + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From d4ad07daf10a67d3c725c1f5c2863c17b015ff00 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 09:43:42 +0100 Subject: [PATCH 096/526] add --- .github/workflows/vale.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3a23164c659..87b0d543bdd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -6,7 +6,7 @@ on: - '**/*.md' jobs: - vale: + vale: runs-on: ubuntu-latest steps: @@ -59,19 +59,31 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Verify original files + run: | + echo "Verifying original files:" + ls -l original_files + + - name: Verify corrected files + run: | + echo "Verifying corrected files:" + ls -l corrected_files + - name: Upload original files uses: actions/upload-artifact@v3 with: name: original-files path: original_files/ + continue-on-error: true - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files path: corrected_files/ + continue-on-error: true - suggest: + suggest: runs-on: ubuntu-latest needs: vale From aa8976f26b522751804f306303c3469716092736 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 09:49:07 +0100 Subject: [PATCH 097/526] add --- .github/workflows/vale.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 87b0d543bdd..ceeccd642f9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,15 +5,21 @@ on: paths: - '**/*.md' +permissions: + contents: read + checks: write + issues: write + pull-requests: write + jobs: - vale: + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@v2 @@ -27,7 +33,7 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES @@ -59,29 +65,17 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Verify original files - run: | - echo "Verifying original files:" - ls -l original_files - - - name: Verify corrected files - run: | - echo "Verifying corrected files:" - ls -l corrected_files - - name: Upload original files uses: actions/upload-artifact@v3 with: name: original-files path: original_files/ - continue-on-error: true - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files path: corrected_files/ - continue-on-error: true suggest: runs-on: ubuntu-latest From 4b3f76bb32b902ff1c440b5573c99c88dba09ec4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:03:03 +0100 Subject: [PATCH 098/526] add --- .github/workflows/vale.yml | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ceeccd642f9..0e0a3a4153b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,14 +5,8 @@ on: paths: - '**/*.md' -permissions: - contents: read - checks: write - issues: write - pull-requests: write - jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -33,14 +27,14 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" @@ -52,7 +46,7 @@ jobs: run: | mkdir -p original_files mkdir -p corrected_files - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" @@ -62,8 +56,6 @@ jobs: ls -l original_files echo "Corrected files:" ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Upload original files uses: actions/upload-artifact@v3 @@ -77,9 +69,9 @@ jobs: name: corrected-files path: corrected_files/ - suggest: + suggest: # Reviewdog suggestion job runs-on: ubuntu-latest - needs: vale + needs: vale # This ensures the suggest job runs after the vale job steps: - name: Checkout code @@ -115,18 +107,13 @@ jobs: - name: Run Reviewdog with corrected files run: | - mkdir -p temp_diff for file in original_files/*.original; do original="$file" corrected="corrected_files/$(basename "$file" .original)" diff_output=$(diff -u "$original" "$corrected") if [[ -n "$diff_output" ]]; then - echo "$diff_output" > "temp_diff/$(basename "$file" .original).diff" + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter fi done - ls temp_diff/ - for diff_file in temp_diff/*.diff; do - reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter < "$diff_file" - done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 65300a538082d6c3878403ddf84aa96755d5662e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:08:16 +0100 Subject: [PATCH 099/526] add --- .github/workflows/vale.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0e0a3a4153b..b5dc3d47d0d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,7 +27,9 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" + echo "CHANGED_FILES in GITHUB_ENV: ${{ env.CHANGED_FILES }}" - name: Print Changed Files run: echo $CHANGED_FILES @@ -56,18 +58,22 @@ jobs: ls -l original_files echo "Corrected files:" ls -l corrected_files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Upload original files uses: actions/upload-artifact@v3 with: name: original-files path: original_files/ + continue-on-error: true - name: Upload corrected files uses: actions/upload-artifact@v3 with: name: corrected-files path: corrected_files/ + continue-on-error: true suggest: # Reviewdog suggestion job runs-on: ubuntu-latest From d9ade0e4ab90ee4b2d00533fc4f8c9ea01626037 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:11:25 +0100 Subject: [PATCH 100/526] add --- .github/workflows/vale.yml | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b5dc3d47d0d..6f91166d23c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,48 +18,26 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Install jq - run: sudo apt-get install -y jq - - name: Get changed files id: changed-files run: | BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" - echo "CHANGED_FILES in GITHUB_ENV: ${{ env.CHANGED_FILES }}" - - - name: Print Changed Files - run: echo $CHANGED_FILES + echo "Changed files: $CHANGED_FILES" - name: Run Vale on changed files run: | + mkdir -p original_files corrected_files for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do - echo "Copying $file to original_files/${file//\//_}.original" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + echo "Vale outputs:" + ls -l - name: Upload original files uses: actions/upload-artifact@v3 From 96bd891d99253bb43d21c8611400b2717b8920a0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:16:38 +0100 Subject: [PATCH 101/526] add --- .github/workflows/vale.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6f91166d23c..eb09efd9940 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,9 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog + with: + version: latest - name: Get changed files id: changed-files @@ -37,7 +39,8 @@ jobs: cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" done echo "Vale outputs:" - ls -l + ls -l original_files + ls -l corrected_files - name: Upload original files uses: actions/upload-artifact@v3 From 9894d5879cdb8b53db9503acddea3a4fb23886d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:32:01 +0100 Subject: [PATCH 102/526] add --- .github/workflows/vale.yml | 85 ++++++++------------------------------ 1 file changed, 18 insertions(+), 67 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index eb09efd9940..399f3d8fd6e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,8 +5,12 @@ on: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - vale: # Vale linting job + lint: runs-on: ubuntu-latest steps: @@ -30,77 +34,24 @@ jobs: - name: Run Vale on changed files run: | - mkdir -p original_files corrected_files for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" - cp "$file" "original_files/${file//\//_}.original" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + $HOME/.local/bin/vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + $HOME/.local/bin/vale --output=edit "$file" done echo "Vale outputs:" - ls -l original_files - ls -l corrected_files - - - name: Upload original files - uses: actions/upload-artifact@v3 - with: - name: original-files - path: original_files/ - continue-on-error: true + ls -l - - name: Upload corrected files - uses: actions/upload-artifact@v3 - with: - name: corrected-files - path: corrected_files/ - continue-on-error: true - - suggest: # Reviewdog suggestion job - runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download original files - uses: actions/download-artifact@v3 - with: - name: original-files - - - name: Download corrected files - uses: actions/download-artifact@v3 - with: - name: corrected-files - - - name: List downloaded files + - name: Commit and push changes run: | - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Apply Vale fixes" + git push + continue-on-error: true - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 + - name: Suggest changes + uses: parkerbxyz/suggest-changes@v1 with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + comment: 'Please commit the suggested changes from Vale.' From 909498fc975373e9d8a1f32d7d27ce6262aabe4c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:42:41 +0100 Subject: [PATCH 103/526] add --- .github/workflows/vale.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 399f3d8fd6e..c5d165d36b9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and suggest +name: Lint and Suggest on: pull_request: @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - lint: + vale: runs-on: ubuntu-latest steps: @@ -20,9 +20,10 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - version: latest + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq - name: Get changed files id: changed-files @@ -30,18 +31,36 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "Changed files: $CHANGED_FILES" + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES - name: Run Vale on changed files run: | for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - $HOME/.local/bin/vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - $HOME/.local/bin/vale --output=edit "$file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in ${{ env.CHANGED_FILES }}; do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + - name: Commit and push changes run: | git config --global user.name "github-actions[bot]" From 1a9848b66e7edab29aa81ce9713f8b1a6d7add93 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:47:10 +0100 Subject: [PATCH 104/526] add --- .github/workflows/vale.yml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c5d165d36b9..7d051a678b7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,16 +22,13 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Install jq - run: sudo apt-get install -y jq - - name: Get changed files id: changed-files run: | BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "Changed files: $CHANGED_FILES" - name: Print Changed Files run: echo $CHANGED_FILES @@ -40,27 +37,12 @@ jobs: run: | for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=edit "$file" done echo "Vale outputs:" ls -l - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - name: Commit and push changes run: | git config --global user.name "github-actions[bot]" From 2f2208e476a8b68794ef75bafd58c0dc2955e015 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:51:02 +0100 Subject: [PATCH 105/526] add --- .github/workflows/vale.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7d051a678b7..27ef19ea2b9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,14 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + echo 'export PATH=$HOME/.local/bin:$PATH' >> $GITHUB_ENV + + - name: Verify Vale Installation + run: | + vale --version - name: Get changed files id: changed-files @@ -37,8 +44,8 @@ jobs: run: | for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --output=edit "$file" + $HOME/.local/bin/vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + $HOME/.local/bin/vale --output=edit "$file" done echo "Vale outputs:" ls -l From aa8f49241c97a91cd2ef790b783a519f166e86f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 10:57:18 +0100 Subject: [PATCH 106/526] add --- .github/workflows/vale.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 27ef19ea2b9..ae590d13fed 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -26,8 +26,7 @@ jobs: echo 'export PATH=$HOME/.local/bin:$PATH' >> $GITHUB_ENV - name: Verify Vale Installation - run: | - vale --version + run: echo "PATH=$PATH" && $HOME/.local/bin/vale --version - name: Get changed files id: changed-files From 0571744a3f934b6945ea3318c843c0fcd2af0612 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:00:48 +0100 Subject: [PATCH 107/526] add --- .github/workflows/vale.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ae590d13fed..b1baf5b595d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,13 +20,7 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - run: | - curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - echo "$HOME/.local/bin" >> $GITHUB_PATH - echo 'export PATH=$HOME/.local/bin:$PATH' >> $GITHUB_ENV - - - name: Verify Vale Installation - run: echo "PATH=$PATH" && $HOME/.local/bin/vale --version + uses: errata-ai/vale-action@v2 - name: Get changed files id: changed-files @@ -43,8 +37,8 @@ jobs: run: | for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - $HOME/.local/bin/vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - $HOME/.local/bin/vale --output=edit "$file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l From 67229ce2b3a955e8098b68010e11a27729fd5d99 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:11:21 +0100 Subject: [PATCH 108/526] add --- .github/workflows/vale.yml | 5 +++-- styles/custom/SentenceCaseHeaders.yml | 7 +++++-- styles/custom/Spelling.yml | 11 ----------- styles/custom/Typos.yml | 14 +++++++++++++- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b1baf5b595d..f72261edcc0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + with: + version: latest - name: Get changed files id: changed-files @@ -37,8 +39,7 @@ jobs: run: | for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=line "$file" done echo "Vale outputs:" ls -l diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index d565bee6a0a..44a3acbe9e1 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -2,7 +2,10 @@ extends: existence message: "Header '%s' should be in sentence case: 'Sentence case header'." level: warning -scope: heading -ignorecase: false +scope: + - heading.h1 + - heading.h2 + - heading.h3 + - heading.h4 tokens: | ^[#]{1,4}\s+[a-z][^\n]*$ diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index 2cf033f7ea6..edafa517926 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -2,17 +2,6 @@ extends: spelling message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." level: warning -ignore: - - dbt - - dbt Cloud - - ETL - - ELT - - DAG - - CTE - - DDL - - DML - - JSON - - CI/CD path: styles/custom/your-dictionary.dic diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index be02d360dcc..40a091e3e56 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,6 +1,6 @@ extends: substitution -message: "Possible typo detected: Consider using '%s' instead of '%s'" +message: "Oops there's a typo! Consider changing '{{.Match}}' to '{{.Suggestions}}.'" level: warning swap: - teh: the @@ -10,5 +10,17 @@ swap: - occured: occurred - untill: until +ignore: + - dbt + - dbt Cloud + - ETL + - ELT + - DAG + - CTE + - DDL + - DML + - JSON + - CI/CD + action: name: replace From c0bbbc6e7c3903872347ebaca07a47b853065674 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:15:20 +0100 Subject: [PATCH 109/526] add --- .github/workflows/vale.yml | 52 +++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f72261edcc0..ab4e16857f9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,8 +21,9 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - with: - version: latest + + - name: Install jq + run: sudo apt-get install -y jq - name: Get changed files id: changed-files @@ -30,28 +31,55 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "Changed files: $CHANGED_FILES" + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=line "$file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l - - name: Commit and push changes + - name: Apply Vale edits run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "Apply Vale fixes" - git push - continue-on-error: true + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + mv $file "${file}.original" + vale --output=edit $file > $file + done + + - name: Upload Vale results + uses: actions/upload-artifact@v3 + with: + name: vale-results + path: '*.json' + + - name: Upload corrected files + uses: actions/upload-artifact@v3 + with: + name: corrected-files + path: '*.md' + + suggest: + runs-on: ubuntu-latest + needs: vale # This ensures the suggest job runs after the vale job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + + - name: List downloaded files + run: ls -l - name: Suggest changes uses: parkerbxyz/suggest-changes@v1 From 474122343a0ba552ee7ffe2cadabd604c52d441d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:19:02 +0100 Subject: [PATCH 110/526] add --- .github/workflows/vale.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ab4e16857f9..d1b6a406018 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + with: + version: latest - name: Install jq run: sudo apt-get install -y jq @@ -46,11 +48,12 @@ jobs: echo "Vale outputs:" ls -l - - name: Apply Vale edits + - name: Simulate Vale changes run: | + mkdir -p simulated_changes for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - mv $file "${file}.original" - vale --output=edit $file > $file + cp "$file" "simulated_changes/$(basename "$file")" + vale --output=edit "simulated_changes/$(basename "$file")" done - name: Upload Vale results @@ -59,11 +62,11 @@ jobs: name: vale-results path: '*.json' - - name: Upload corrected files + - name: Upload simulated changes uses: actions/upload-artifact@v3 with: - name: corrected-files - path: '*.md' + name: simulated-changes + path: simulated_changes suggest: runs-on: ubuntu-latest @@ -73,13 +76,13 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Download corrected files + - name: Download simulated changes uses: actions/download-artifact@v3 with: - name: corrected-files + name: simulated-changes - name: List downloaded files - run: ls -l + run: ls -l simulated_changes - name: Suggest changes uses: parkerbxyz/suggest-changes@v1 From c6508f0870b67492fba2b9a743ec2745e251212a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:27:10 +0100 Subject: [PATCH 111/526] add --- .github/workflows/vale.yml | 10 ++++------ styles/custom/Typos.yml | 13 +------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d1b6a406018..85903a3a9fd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and Suggest +name: Lint and suggest on: pull_request: @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -21,8 +21,6 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - with: - version: latest - name: Install jq run: sudo apt-get install -y jq @@ -33,14 +31,14 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 40a091e3e56..5d56dec1097 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -9,18 +9,7 @@ swap: - seperate: separate - occured: occurred - untill: until + - occurence: occurrence -ignore: - - dbt - - dbt Cloud - - ETL - - ELT - - DAG - - CTE - - DDL - - DML - - JSON - - CI/CD - action: name: replace From 1c20c18f1caef4f027d01da712c967c3bfe3da70 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:30:52 +0100 Subject: [PATCH 112/526] add --- styles/custom/Typos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 5d56dec1097..5940d57a48e 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,6 +1,6 @@ extends: substitution -message: "Oops there's a typo! Consider changing '{{.Match}}' to '{{.Suggestions}}.'" +message: "Oops there's a typo! Consider changing '%s' instead of '%s'" level: warning swap: - teh: the From 2e7be86084679df4e7d46c4e69fd72fcf746f988 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:32:32 +0100 Subject: [PATCH 113/526] add --- .github/workflows/vale.yml | 39 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 85903a3a9fd..efb4d8ae498 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and suggest +name: Lint and Suggest on: pull_request: @@ -10,20 +10,19 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 - - - name: Install jq - run: sudo apt-get install -y jq + with: + version: latest - name: Get changed files id: changed-files @@ -31,27 +30,25 @@ jobs: BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l - - name: Simulate Vale changes + - name: Apply Vale suggestions run: | - mkdir -p simulated_changes + mkdir -p suggested_changes for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - cp "$file" "simulated_changes/$(basename "$file")" - vale --output=edit "simulated_changes/$(basename "$file")" + vale --output=line "$file" | grep -oP 'Consider changing.*' > suggested_changes/"$(basename "$file")".suggestions done - name: Upload Vale results @@ -60,27 +57,27 @@ jobs: name: vale-results path: '*.json' - - name: Upload simulated changes + - name: Upload suggested changes uses: actions/upload-artifact@v3 with: - name: simulated-changes - path: simulated_changes + name: suggested-changes + path: suggested_changes/ suggest: runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job + needs: vale steps: - name: Checkout code uses: actions/checkout@v3 - - name: Download simulated changes + - name: Download suggested changes uses: actions/download-artifact@v3 with: - name: simulated-changes + name: suggested-changes - name: List downloaded files - run: ls -l simulated_changes + run: ls -l suggested_changes - name: Suggest changes uses: parkerbxyz/suggest-changes@v1 From 0dc10ca89270f2abc49971f6c45353237b763e49 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:35:33 +0100 Subject: [PATCH 114/526] add --- .github/workflows/vale.yml | 90 ++++++++------------------------------ 1 file changed, 18 insertions(+), 72 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index efb4d8ae498..0e34903dea2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,85 +1,31 @@ -name: Lint and Suggest +name: Reviewdog with Vale -on: - pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - pull-requests: write +on: [pull_request] jobs: - vale: + reviewdog: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - name: Check out code + uses: actions/checkout@v2 - name: Install Vale uses: errata-ai/vale-action@v2 with: version: latest - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - done - echo "Vale outputs:" - ls -l - - - name: Apply Vale suggestions - run: | - mkdir -p suggested_changes - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - vale --output=line "$file" | grep -oP 'Consider changing.*' > suggested_changes/"$(basename "$file")".suggestions - done - - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: '*.json' - - - name: Upload suggested changes - uses: actions/upload-artifact@v3 - with: - name: suggested-changes - path: suggested_changes/ - - suggest: - runs-on: ubuntu-latest - needs: vale - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download suggested changes - uses: actions/download-artifact@v3 - with: - name: suggested-changes - - - name: List downloaded files - run: ls -l suggested_changes + - name: Run Vale + run: vale --output=line . - - name: Suggest changes - uses: parkerbxyz/suggest-changes@v1 + - name: Run Reviewdog + uses: reviewdog/action-reviewdog@v1 with: - comment: 'Please commit the suggested changes from Vale.' + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + reporter: github-pr-review + filter_mode: diff_context + fail_on_error: false + level: warning + tool_name: vale + reviewdog_flags: "-f=rdjson" + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From d0017d8986a1347cbe95b61a74dc88175ab49a3d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:40:01 +0100 Subject: [PATCH 115/526] add --- .github/workflows/vale.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0e34903dea2..5a9807bb8fa 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,16 +16,3 @@ jobs: - name: Run Vale run: vale --output=line . - - - name: Run Reviewdog - uses: reviewdog/action-reviewdog@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - reporter: github-pr-review - filter_mode: diff_context - fail_on_error: false - level: warning - tool_name: vale - reviewdog_flags: "-f=rdjson" - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 1d4b4d13d527f18d37792b8215771db5b78a74cb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 11:48:11 +0100 Subject: [PATCH 116/526] add --- .github/workflows/vale.yml | 120 ++++++++++++++++++++++++++++++++++--- 1 file changed, 113 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5a9807bb8fa..a04a453162e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,18 +1,124 @@ -name: Reviewdog with Vale +name: Lint and Suggest -on: [pull_request] +on: + pull_request: + paths: + - '**/*.md' + +permissions: + contents: read + pull-requests: write jobs: - reviewdog: + vale: runs-on: ubuntu-latest + steps: - - name: Check out code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 with: version: latest - - name: Run Vale - run: vale --output=line . + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + done + echo "Vale outputs:" + ls -l + + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + + - name: Upload original files + uses: actions/upload-artifact@v3 + with: + name: original-files + path: original_files/ + + - name: Upload corrected files + uses: actions/upload-artifact@v3 + with: + name: corrected-files + path: corrected_files/ + + suggest: + runs-on: ubuntu-latest + needs: vale # This ensures the suggest job runs after the vale job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download original files + uses: actions/download-artifact@v3 + with: + name: original-files + + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + + - name: List downloaded files + run: | + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with corrected files + run: | + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + fi + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From f5fe768616054ac23688d11c72b90c1f1685d3a2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:03:36 +0100 Subject: [PATCH 117/526] add --- .github/workflows/vale.yml | 10 ++-------- .vale.ini | 1 + styles/custom/Spelling.yml | 16 ---------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a04a453162e..5713c5d9511 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,13 +39,7 @@ jobs: run: echo $CHANGED_FILES - name: Run Vale on changed files - run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - done - echo "Vale outputs:" - ls -l + run: vale --config=vale.ini --output=JSON $file > "vale_output_${file//\//_}.json" - name: Apply Vale edits and save originals run: | @@ -105,7 +99,7 @@ jobs: github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} tool_name: Vale level: "warning" - filter_mode: "diff_context" + filter_mode: "added" fail_on_error: "false" reviewdog_flags: "" cleanup: "true" diff --git a/.vale.ini b/.vale.ini index edbd97348c0..e9388121025 100644 --- a/.vale.ini +++ b/.vale.ini @@ -3,5 +3,6 @@ MinAlertLevel = suggestion [*.md] BasedOnStyles = custom +BasedOnStyles = Vale.Spelling Vocab = EN diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index edafa517926..e69de29bb2d 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -1,16 +0,0 @@ -extends: spelling - -message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." -level: warning - -path: styles/custom/your-dictionary.dic - ---- - -extends: existence - -message: "Ignore specific patterns" -level: skip -tokens: - - '\bdbt\s+Cloud\b' - - '\bdbt\s+.*?\b' From 9032015beb0c38c2be49231dd504479549dc39be Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:06:05 +0100 Subject: [PATCH 118/526] add --- .github/workflows/vale.yml | 201 ++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 102 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5713c5d9511..c5af0f9f24a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,114 +5,111 @@ on: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: + lint: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: latest - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\\n\")[:-1]')" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: vale --config=vale.ini --output=JSON $file > "vale_output_${file//\//_}.json" - - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - - name: Upload original files - uses: actions/upload-artifact@v3 - with: - name: original-files - path: original_files/ - - - name: Upload corrected files - uses: actions/upload-artifact@v3 - with: - name: corrected-files - path: corrected_files/ + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + run: | + wget -qO- https://install.goreleaser.com/github.com/ValeLint/vale.sh | sh -s v2.9.4 + sudo mv ./bin/vale /usr/local/bin/vale + shell: bash + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --config=vale.ini --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --config=vale.ini --output=edit "$file" > "vale_output_${file//\//_}_edit.md" + done + shell: bash + + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in ${{ env.CHANGED_FILES }}; do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Upload original files + uses: actions/upload-artifact@v3 + with: + name: original-files + path: original_files/ + + - name: Upload corrected files + uses: actions/upload-artifact@v3 + with: + name: corrected-files + path: corrected_files/ suggest: runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job + needs: lint steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download original files - uses: actions/download-artifact@v3 - with: - name: original-files - - - name: Download corrected files - uses: actions/download-artifact@v3 - with: - name: corrected-files - - - name: List downloaded files - run: | - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "added" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download original files + uses: actions/download-artifact@v3 + with: + name: original-files + + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + + - name: List downloaded files + run: | + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with corrected files + run: | + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=war From 178cd04db57f7b9bf908775f528112757b9b2abb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:14:07 +0100 Subject: [PATCH 119/526] add --- .github/workflows/vale.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c5af0f9f24a..c6a613ac95b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,10 +16,13 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - run: | - wget -qO- https://install.goreleaser.com/github.com/ValeLint/vale.sh | sh -s v2.9.4 - sudo mv ./bin/vale /usr/local/bin/vale - shell: bash + uses: errata-ai/vale-action@reviewdog + with: + version: 2.17.0 + files: all + reporter: github-pr-check + filter_mode: nofilter + - name: Install jq run: sudo apt-get install -y jq From 6211b088f250466826a4bd903490d599cc2c5eda Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:21:21 +0100 Subject: [PATCH 120/526] add --- .github/workflows/vale.yml | 181 ++++++++++++++++--------------------- 1 file changed, 78 insertions(+), 103 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c6a613ac95b..13f88fbfbb2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,118 +1,93 @@ -name: Lint and Suggest +name: Lint and suggest on: pull_request: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - lint: + vale: # Vale linting job runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - version: 2.17.0 - files: all - reporter: github-pr-check - filter_mode: nofilter - - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --config=vale.ini --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --config=vale.ini --output=edit "$file" > "vale_output_${file//\//_}_edit.md" - done - shell: bash - - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Upload original files - uses: actions/upload-artifact@v3 - with: - name: original-files - path: original_files/ - - - name: Upload corrected files - uses: actions/upload-artifact@v3 - with: - name: corrected-files - path: corrected_files/ + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@v2g + with: + version: 2.17.0 + files: all + reporter: github-pr-check + filter_mode: nofilter + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Simulate Vale changes + run: | + mkdir -p simulated_changes + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + cp "$file" "simulated_changes/$(basename "$file")" + vale --output=edit "simulated_changes/$(basename "$file")" + done + + - name: Upload Vale results + uses: actions/upload-artifact@v3 + with: + name: vale-results + path: '*.json' + + - name: Upload simulated changes + uses: actions/upload-artifact@v3 + with: + name: simulated-changes + path: simulated_changes suggest: runs-on: ubuntu-latest - needs: lint + needs: vale # This ensures the suggest job runs after the vale job steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download original files - uses: actions/download-artifact@v3 - with: - name: original-files - - - name: Download corrected files - uses: actions/download-artifact@v3 - with: - name: corrected-files - - - name: List downloaded files - run: | - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=war + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download simulated changes + uses: actions/download-artifact@v3 + with: + name: simulated-changes + + - name: List downloaded files + run: ls -l simulated_changes + + - name: Suggest changes + uses: parkerbxyz/suggest-changes@v1 + with: + comment: 'Please commit the suggested changes from Vale.' From 6f761e0f4a3c59f4b5a916f5aacd12b65d942532 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:29:54 +0100 Subject: [PATCH 121/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 13f88fbfbb2..22ad93ab3b6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2g + uses: errata-ai/vale-action@v2 with: version: 2.17.0 files: all From 1f3c52e4f0391f59ec704ae58e431c2da1770e8d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:37:00 +0100 Subject: [PATCH 122/526] add --- .github/workflows/vale.yml | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 22ad93ab3b6..bb60d0d3ce9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -25,7 +25,6 @@ jobs: version: 2.17.0 files: all reporter: github-pr-check - filter_mode: nofilter - name: Install jq run: sudo apt-get install -y jq @@ -51,43 +50,3 @@ jobs: echo "Vale outputs:" ls -l - - name: Simulate Vale changes - run: | - mkdir -p simulated_changes - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - cp "$file" "simulated_changes/$(basename "$file")" - vale --output=edit "simulated_changes/$(basename "$file")" - done - - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: '*.json' - - - name: Upload simulated changes - uses: actions/upload-artifact@v3 - with: - name: simulated-changes - path: simulated_changes - - suggest: - runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download simulated changes - uses: actions/download-artifact@v3 - with: - name: simulated-changes - - - name: List downloaded files - run: ls -l simulated_changes - - - name: Suggest changes - uses: parkerbxyz/suggest-changes@v1 - with: - comment: 'Please commit the suggested changes from Vale.' From e885a42fbc2511c7166891b6a7f9ee94378d507b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:42:09 +0100 Subject: [PATCH 123/526] add --- .github/workflows/vale.yml | 78 +++++++++++++++++--------------------- .vale.ini | 3 +- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bb60d0d3ce9..9b3553cade0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,52 +1,44 @@ -name: Lint and suggest +name: Lint Markdown Files on: pull_request: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: # Vale linting job + vale: + name: Vale Markdown Lint runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: 2.17.0 - files: all - reporter: github-pr-check - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Vale + uses: errata-ai/vale-action@v2 + with: + version: 2.17.0 + files: all + reporter: github-pr-check + fail_on_error: true + + - name: Run Vale on changed files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + for file in $CHANGED_FILES; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + + - name: Upload Vale results + uses: actions/upload-artifact@v3 + with: + name: vale-results + path: . # Uploads current directory by default + + - name: Vale Check Summary + run: echo "Vale check completed successfully." + + env: + GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} diff --git a/.vale.ini b/.vale.ini index e9388121025..0040200d0d5 100644 --- a/.vale.ini +++ b/.vale.ini @@ -2,7 +2,6 @@ StylesPath = styles MinAlertLevel = suggestion [*.md] -BasedOnStyles = custom -BasedOnStyles = Vale.Spelling +BasedOnStyles = custom, Vale.Spelling Vocab = EN From 1f3634b9fb05f98888a33204fd8e84221cf040ee Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:47:35 +0100 Subject: [PATCH 124/526] add --- .github/workflows/vale.yml | 40 ++++++++++++++++++++------------------ styles/custom/Spelling.yml | 16 +++++++++++++++ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9b3553cade0..6782de30ef3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,24 +21,26 @@ jobs: reporter: github-pr-check fail_on_error: true + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + - name: Run Vale on changed files run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - for file in $CHANGED_FILES; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: . # Uploads current directory by default - - - name: Vale Check Summary - run: echo "Vale check completed successfully." - - env: - GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index e69de29bb2d..edafa517926 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -0,0 +1,16 @@ +extends: spelling + +message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." +level: warning + +path: styles/custom/your-dictionary.dic + +--- + +extends: existence + +message: "Ignore specific patterns" +level: skip +tokens: + - '\bdbt\s+Cloud\b' + - '\bdbt\s+.*?\b' From e404ef582a9cfc3833b0c6a922e0ea1f86f0bf97 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:47:46 +0100 Subject: [PATCH 125/526] add --- styles/custom/Spelling.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml index edafa517926..e69de29bb2d 100644 --- a/styles/custom/Spelling.yml +++ b/styles/custom/Spelling.yml @@ -1,16 +0,0 @@ -extends: spelling - -message: "Detected non-American spelling. Consider using American spelling: '%s' instead of '%s." -level: warning - -path: styles/custom/your-dictionary.dic - ---- - -extends: existence - -message: "Ignore specific patterns" -level: skip -tokens: - - '\bdbt\s+Cloud\b' - - '\bdbt\s+.*?\b' From c59b8e5a62cf92c2d75e2dd880b3b2d20e5b6bbe Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:50:55 +0100 Subject: [PATCH 126/526] add --- .github/workflows/vale.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6782de30ef3..755c8c9bb00 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,20 +27,20 @@ jobs: - name: Get changed files id: changed-files run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - name: Print Changed Files run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l From cf7fe040bbb1d3e7a7608d8121e51a8ccd7fc60c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:56:48 +0100 Subject: [PATCH 127/526] add --- .github/workflows/vale.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 755c8c9bb00..7da98449b2e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -23,7 +23,7 @@ jobs: - name: Install jq run: sudo apt-get install -y jq - + - name: Get changed files id: changed-files run: | @@ -31,16 +31,21 @@ jobs: CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - + - name: Print Changed Files run: echo $CHANGED_FILES - + - name: Run Vale on changed files run: | - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + echo "[]" > rdjson_output.jsonl + for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale_output=$(vale --output=JSON "$file") + if [ $? -eq 0 ]; then + echo "$vale_output" | jq -c --arg file "$file" '.[] | {file: $file, line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl + else + echo "Error processing $file" + fi done - echo "Vale outputs:" - ls -l + echo "Vale output:" + cat rdjson_output.jsonl From c13cebec5281e4f3421668055d3ca90bc5321d1d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 12:58:14 +0100 Subject: [PATCH 128/526] add --- .github/workflows/vale.yml | 121 ++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 42 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7da98449b2e..85903a3a9fd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,51 +1,88 @@ -name: Lint Markdown Files +name: Lint and suggest on: pull_request: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - vale: - name: Vale Markdown Lint + vale: # Vale linting job runs-on: ubuntu-latest + steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: 2.17.0 - files: all - reporter: github-pr-check - fail_on_error: true - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "::set-output name=files::$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - echo "[]" > rdjson_output.jsonl - for file in $(echo "${{ steps.changed-files.outputs.files }}" | jq -r '.[]'); do - echo "Running Vale on $file" - vale_output=$(vale --output=JSON "$file") - if [ $? -eq 0 ]; then - echo "$vale_output" | jq -c --arg file "$file" '.[] | {file: $file, line: .Line, column: .Span[0], message: .Message, suggestion: (.Suggestions[0] // "")}' >> rdjson_output.jsonl - else - echo "Error processing $file" - fi - done - echo "Vale output:" - cat rdjson_output.jsonl + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Simulate Vale changes + run: | + mkdir -p simulated_changes + for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do + cp "$file" "simulated_changes/$(basename "$file")" + vale --output=edit "simulated_changes/$(basename "$file")" + done + + - name: Upload Vale results + uses: actions/upload-artifact@v3 + with: + name: vale-results + path: '*.json' + + - name: Upload simulated changes + uses: actions/upload-artifact@v3 + with: + name: simulated-changes + path: simulated_changes + + suggest: + runs-on: ubuntu-latest + needs: vale # This ensures the suggest job runs after the vale job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download simulated changes + uses: actions/download-artifact@v3 + with: + name: simulated-changes + + - name: List downloaded files + run: ls -l simulated_changes + + - name: Suggest changes + uses: parkerbxyz/suggest-changes@v1 + with: + comment: 'Please commit the suggested changes from Vale.' From 1704c4d941bcd602010281df085edc73375dc045 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:02:39 +0100 Subject: [PATCH 129/526] add --- .github/workflows/vale.yml | 41 +------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 85903a3a9fd..393fccfeb32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -46,43 +46,4 @@ jobs: echo "Vale outputs:" ls -l - - name: Simulate Vale changes - run: | - mkdir -p simulated_changes - for file in $(echo ${{ steps.changed-files.outputs.files }} | jq -r '.[]'); do - cp "$file" "simulated_changes/$(basename "$file")" - vale --output=edit "simulated_changes/$(basename "$file")" - done - - - name: Upload Vale results - uses: actions/upload-artifact@v3 - with: - name: vale-results - path: '*.json' - - - name: Upload simulated changes - uses: actions/upload-artifact@v3 - with: - name: simulated-changes - path: simulated_changes - - suggest: - runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download simulated changes - uses: actions/download-artifact@v3 - with: - name: simulated-changes - - - name: List downloaded files - run: ls -l simulated_changes - - - name: Suggest changes - uses: parkerbxyz/suggest-changes@v1 - with: - comment: 'Please commit the suggested changes from Vale.' + \ No newline at end of file From 041aa2ddc511082b758ffcad89cf178f939996a5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:02:48 +0100 Subject: [PATCH 130/526] add --- .github/workflows/reviewdog.yml | 0 styles/custom/Spelling.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/reviewdog.yml delete mode 100644 styles/custom/Spelling.yml diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/styles/custom/Spelling.yml b/styles/custom/Spelling.yml deleted file mode 100644 index e69de29bb2d..00000000000 From 93352eccab284c1f64bd2b7b6c9e609fc72833d5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:14:03 +0100 Subject: [PATCH 131/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 0040200d0d5..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -2,6 +2,6 @@ StylesPath = styles MinAlertLevel = suggestion [*.md] -BasedOnStyles = custom, Vale.Spelling +BasedOnStyles = custom Vocab = EN From 3601e64a60c436fa890c9f11860d00e3174658a9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:29:38 +0100 Subject: [PATCH 132/526] add --- styles/custom/Metrics.yml | 8 ++++++++ styles/custom/Typos.yml | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 styles/custom/Metrics.yml diff --git a/styles/custom/Metrics.yml b/styles/custom/Metrics.yml new file mode 100644 index 00000000000..e319f78cac8 --- /dev/null +++ b/styles/custom/Metrics.yml @@ -0,0 +1,8 @@ +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.0" diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 5940d57a48e..f45ecfbccfb 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -10,6 +10,22 @@ swap: - occured: occurred - untill: until - occurence: occurrence + - colour: color + - favour: favor + - organisation: organization + - licence: license + - defence: defense + - neighbour: neighbor + - organise: organize + - recognise: recognize + - analyse: analyze + - analogue: analog + - centre: centre + - grey: gray + - labour: labor + - pretence: pretence + - standardise: standardize + action: name: replace From 8e308bb9aedcef10f50cda85b27c99078a58cd8d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:41:49 +0100 Subject: [PATCH 133/526] add --- .github/workflows/vale.yml | 83 ++++++++++++++------------- styles/custom/SentenceCaseHeaders.yml | 3 +- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 393fccfeb32..93e24714164 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,49 +1,54 @@ -name: Lint and suggest +name: Lint and Suggest on: pull_request: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: # Vale linting job + vale: + name: Vale Markdown Lint runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Vale + uses: errata-ai/vale-action@v2 + with: + version: 2.17.0 + files: all + reporter: github-pr-check + fail_on_error: true + + - name: Install Reviewdog + run: | + curl -fSL https://github.com/reviewdog/reviewdog/releases/download/v0.13.0/reviewdog_linux_amd64 -o /tmp/reviewdog + chmod +x /tmp/reviewdog + sudo mv /tmp/reviewdog /usr/local/bin/ + + - name: Run Vale on changed files + id: vale + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV + + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Run Reviewdog with Vale + if: success() + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for file in $(find . -name "vale_output_*.json"); do + reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file + done diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 44a3acbe9e1..41a722c5f71 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,7 @@ extends: existence message: "Header '%s' should be in sentence case: 'Sentence case header'." + level: warning scope: - heading.h1 @@ -8,4 +9,4 @@ scope: - heading.h3 - heading.h4 tokens: | - ^[#]{1,4}\s+[a-z][^\n]*$ + ^[#]{1,4}\s+[A-Z][^\n]*$ From 5fe3cee7dc140b9177ed3e7e014e1bf2f4ccd656 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:46:32 +0100 Subject: [PATCH 134/526] add --- .github/workflows/vale.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 93e24714164..a5eac1d5019 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -23,10 +23,7 @@ jobs: fail_on_error: true - name: Install Reviewdog - run: | - curl -fSL https://github.com/reviewdog/reviewdog/releases/download/v0.13.0/reviewdog_linux_amd64 -o /tmp/reviewdog - chmod +x /tmp/reviewdog - sudo mv /tmp/reviewdog /usr/local/bin/ + uses: reviewdog/action-suggester@v1 - name: Run Vale on changed files id: vale @@ -47,7 +44,7 @@ jobs: - name: Run Reviewdog with Vale if: success() env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} run: | for file in $(find . -name "vale_output_*.json"); do reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file From 1678a502ec5a9cd941bc307b31a6a37ede6a6aff Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:47:44 +0100 Subject: [PATCH 135/526] add --- .github/workflows/vale.yml | 30 ++------------------------- styles/custom/SentenceCaseHeaders.yml | 4 ++-- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a5eac1d5019..f199f937287 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and Suggest +name: Lint Markdown Files on: pull_request: @@ -9,7 +9,6 @@ jobs: vale: name: Vale Markdown Lint runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v3 @@ -22,30 +21,5 @@ jobs: reporter: github-pr-check fail_on_error: true - - name: Install Reviewdog - uses: reviewdog/action-suggester@v1 - - name: Run Vale on changed files - id: vale - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV - - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Run Reviewdog with Vale - if: success() - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - run: | - for file in $(find . -name "vale_output_*.json"); do - reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file - done + run: vale --config=.vale.ini diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 41a722c5f71..570489af918 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -2,11 +2,11 @@ extends: existence message: "Header '%s' should be in sentence case: 'Sentence case header'." -level: warning +level: suggestion scope: - heading.h1 - heading.h2 - heading.h3 - heading.h4 tokens: | - ^[#]{1,4}\s+[A-Z][^\n]*$ + ^[#]{1,4}\s+[a-z][^\n]*$ From 649e58e174e7bfc0985aaad3ed4a6ee4f03c7c7c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:52:22 +0100 Subject: [PATCH 136/526] ad --- .github/workflows/vale.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f199f937287..c5a5272cc8e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint Markdown Files +name: Lint and Suggest on: pull_request: @@ -9,6 +9,7 @@ jobs: vale: name: Vale Markdown Lint runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v3 @@ -22,4 +23,18 @@ jobs: fail_on_error: true - name: Run Vale on changed files - run: vale --config=.vale.ini + id: vale + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV + + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + From 2a60152fc23812fcfe6e958dd24144206cd18394 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:54:37 +0100 Subject: [PATCH 137/526] add --- .github/workflows/vale.yml | 42 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c5a5272cc8e..9684d9958a0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,36 +5,26 @@ on: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: vale: - name: Vale Markdown Lint runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: 2.17.0 - files: all - reporter: github-pr-check - fail_on_error: true - - - name: Run Vale on changed files - id: vale - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + - name: Install Vale + uses: errata-ai/vale-action@v2 + with: + version: latest + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin From f10f0b9316dd5828fad7088cf8048365a74997ca Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:56:16 +0100 Subject: [PATCH 138/526] add --- .github/workflows/vale.yml | 60 ++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9684d9958a0..93e24714164 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,26 +5,50 @@ on: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: vale: + name: Vale Markdown Lint runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: latest - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Vale + uses: errata-ai/vale-action@v2 + with: + version: 2.17.0 + files: all + reporter: github-pr-check + fail_on_error: true + + - name: Install Reviewdog + run: | + curl -fSL https://github.com/reviewdog/reviewdog/releases/download/v0.13.0/reviewdog_linux_amd64 -o /tmp/reviewdog + chmod +x /tmp/reviewdog + sudo mv /tmp/reviewdog /usr/local/bin/ + + - name: Run Vale on changed files + id: vale + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV + + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Run Reviewdog with Vale + if: success() + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for file in $(find . -name "vale_output_*.json"); do + reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file + done From 1d91233d7b4669b771c5bf19e0ef5dfcdcd6081c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:56:29 +0100 Subject: [PATCH 139/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 93e24714164..4bdd21c7cc3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -47,7 +47,7 @@ jobs: - name: Run Reviewdog with Vale if: success() env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} run: | for file in $(find . -name "vale_output_*.json"); do reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file From 34210380d73ec56ac7c2e03b9081e1049b963cc2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 13:59:07 +0100 Subject: [PATCH 140/526] add --- .github/workflows/vale.yml | 83 ++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4bdd21c7cc3..393fccfeb32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,54 +1,49 @@ -name: Lint and Suggest +name: Lint and suggest on: pull_request: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - vale: - name: Vale Markdown Lint + vale: # Vale linting job runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - version: 2.17.0 - files: all - reporter: github-pr-check - fail_on_error: true - - - name: Install Reviewdog - run: | - curl -fSL https://github.com/reviewdog/reviewdog/releases/download/v0.13.0/reviewdog_linux_amd64 -o /tmp/reviewdog - chmod +x /tmp/reviewdog - sudo mv /tmp/reviewdog /usr/local/bin/ - - - name: Run Vale on changed files - id: vale - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_ENV - - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Run Reviewdog with Vale - if: success() - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - run: | - for file in $(find . -name "vale_output_*.json"); do - reviewdog -reporter=github-pr-review -name="Vale" -level=warning -filter-mode=nofilter < $file - done + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + \ No newline at end of file From 2be40eac35b0946329a756f91ff5eab819d87e89 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:10:55 +0100 Subject: [PATCH 141/526] add --- styles/custom/Repitition.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 2708a834559..7e1e6e94aa3 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -2,6 +2,7 @@ extends: existence message: "Repetitive word found: '%s'. Consider revising." level: warning + # Regex to match repetitive words (e.g., "the the", "and and") ignorecase: true nonword: true From e1601e0e90485eaba15fc3d61b38c6ed78f8ba64 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:13:15 +0100 Subject: [PATCH 142/526] test suggest --- styles/custom/Repitition.yml | 6 ++---- styles/custom/config/RepetitionFix.tengo | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 styles/custom/config/RepetitionFix.tengo diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 7e1e6e94aa3..6638efdba29 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -10,8 +10,6 @@ tokens: - '\b(\w+)\s+\1\b' action: - name: edit + name: suggest params: - - regex - - '\b(\w+)\s+\1\b' - - '\1' + - RepetitionFix.tengo diff --git a/styles/custom/config/RepetitionFix.tengo b/styles/custom/config/RepetitionFix.tengo new file mode 100644 index 00000000000..7a60b40d63c --- /dev/null +++ b/styles/custom/config/RepetitionFix.tengo @@ -0,0 +1,11 @@ +text := import("text") + +// `match` is provided by Vale and represents the rule's matched text. +// The regex pattern for detecting repetitive words. +pattern := `(\b\w+\s+\1\b)` + +// Replace repetitive words with a single instance of the word. +replaced := text.re_replace(pattern, match, `$1`) + +// `suggestions` is required by Vale and represents the script's output. +suggestions := [replaced] From eb1364b4bbf3d6045692964dc710886cf5fd54f8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:16:57 +0100 Subject: [PATCH 143/526] add --- styles/custom/Repitition.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 6638efdba29..063d7f728a0 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: existence -message: "Repetitive word found: '%s'. Consider revising." +message: "Repetitive word found: '%s'. Consider changing '%s' instead of '%s." level: warning # Regex to match repetitive words (e.g., "the the", "and and") @@ -10,6 +10,8 @@ tokens: - '\b(\w+)\s+\1\b' action: - name: suggest + name: edit params: - - RepetitionFix.tengo + - regex + - '\b(\w+)\s+\1\b' + - '\1' From 698b42a419dbbb8ce4959bbeb8ad32fd40e0ff72 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:20:49 +0100 Subject: [PATCH 144/526] add --- styles/custom/Repitition.yml | 8 +++----- styles/custom/config/RepetitionFix.tengo | 10 ++++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 063d7f728a0..cefa3fe4870 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: existence -message: "Repetitive word found: '%s'. Consider changing '%s' instead of '%s." +message: "Repetitive word found: '%s'. Consider changing '%s' to '%s'." level: warning # Regex to match repetitive words (e.g., "the the", "and and") @@ -10,8 +10,6 @@ tokens: - '\b(\w+)\s+\1\b' action: - name: edit + name: suggest params: - - regex - - '\b(\w+)\s+\1\b' - - '\1' + - RepetitionFix.tengo diff --git a/styles/custom/config/RepetitionFix.tengo b/styles/custom/config/RepetitionFix.tengo index 7a60b40d63c..dc80bc9256b 100644 --- a/styles/custom/config/RepetitionFix.tengo +++ b/styles/custom/config/RepetitionFix.tengo @@ -1,11 +1,13 @@ text := import("text") -// `match` is provided by Vale and represents the rule's matched text. // The regex pattern for detecting repetitive words. -pattern := `(\b\w+\s+\1\b)` +pattern := `\b(\w+)\s+\1\b` + +// Capture the matched text. +incorrect := match // Replace repetitive words with a single instance of the word. -replaced := text.re_replace(pattern, match, `$1`) +correct := text.re_replace(pattern, match, `$1`) // `suggestions` is required by Vale and represents the script's output. -suggestions := [replaced] +suggestions := [correct] From 7d4166b75b0805199c16aed5d30c176a20e74eaa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:23:12 +0100 Subject: [PATCH 145/526] add --- styles/custom/config/RepetitionFix.tengo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/styles/custom/config/RepetitionFix.tengo b/styles/custom/config/RepetitionFix.tengo index dc80bc9256b..c4f897a3ae3 100644 --- a/styles/custom/config/RepetitionFix.tengo +++ b/styles/custom/config/RepetitionFix.tengo @@ -10,4 +10,5 @@ incorrect := match correct := text.re_replace(pattern, match, `$1`) // `suggestions` is required by Vale and represents the script's output. -suggestions := [correct] +// We need to include the incorrect and correct values as a part of the suggestion. +suggestions := [incorrect, correct] From 5bee758b09f7c9ff5e0866d70cbdd446bb376eb7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:30:47 +0100 Subject: [PATCH 146/526] add --- styles/custom/config/RepetitionFix.tengo | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/styles/custom/config/RepetitionFix.tengo b/styles/custom/config/RepetitionFix.tengo index c4f897a3ae3..26139db0fce 100644 --- a/styles/custom/config/RepetitionFix.tengo +++ b/styles/custom/config/RepetitionFix.tengo @@ -3,12 +3,8 @@ text := import("text") // The regex pattern for detecting repetitive words. pattern := `\b(\w+)\s+\1\b` -// Capture the matched text. -incorrect := match - // Replace repetitive words with a single instance of the word. correct := text.re_replace(pattern, match, `$1`) // `suggestions` is required by Vale and represents the script's output. -// We need to include the incorrect and correct values as a part of the suggestion. -suggestions := [incorrect, correct] +suggestions := [correct] From 78eb64e0ad3bf936a141a669abcb1e3119c0dae1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:34:34 +0100 Subject: [PATCH 147/526] add --- .github/workflows/vale.yml | 48 +++++++------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 393fccfeb32..3a0638f4e60 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,49 +1,19 @@ -name: Lint and suggest +name: Vale Lint -on: - pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - pull-requests: write +on: [push, pull_request] jobs: - vale: # Vale linting job + lint: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits + uses: actions/checkout@v2 - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES - - - name: Run Vale on changed files - run: | - for file in ${{ env.CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + uses: errata-ai/vale-action@v1.2.3 + with: + styles: styles/custom - \ No newline at end of file + - name: Run Vale + run: vale --output=JSON website/docs/ From af5b2f4f25a4a52c511ad9de6d63227d15f2ca5f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:43:50 +0100 Subject: [PATCH 148/526] add --- .github/workflows/vale.yml | 48 +++++++++++++++++++++++++++++++------- .vale.ini | 2 +- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3a0638f4e60..393fccfeb32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,19 +1,49 @@ -name: Vale Lint +name: Lint and suggest -on: [push, pull_request] +on: + pull_request: + paths: + - '**/*.md' + +permissions: + contents: read + pull-requests: write jobs: - lint: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v1.2.3 - with: - styles: styles/custom + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l - - name: Run Vale - run: vale --output=JSON website/docs/ + \ No newline at end of file diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom From bb81f5fd287cb6257e95c519c826b10be8d1ba5f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 14:53:56 +0100 Subject: [PATCH 149/526] add --- styles/custom/Repitition.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index cefa3fe4870..a7dbdb24362 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -10,6 +10,8 @@ tokens: - '\b(\w+)\s+\1\b' action: - name: suggest + name: edit params: - - RepetitionFix.tengo + - regex + - '\b(\w+)\s+\1\b' + - '\1' From 44a79a69503c99327ba883fe88d39dcfef06fa25 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:23:47 +0100 Subject: [PATCH 150/526] add --- .github/workflows/vale.yml | 82 +++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 393fccfeb32..bdf6a8031ee 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,10 +5,6 @@ on: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: vale: # Vale linting job runs-on: ubuntu-latest @@ -46,4 +42,80 @@ jobs: echo "Vale outputs:" ls -l - \ No newline at end of file + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in ${{ env.CHANGED_FILES }}; do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Upload original files + uses: actions/upload-artifact@v4 + with: + name: original-files + path: original_files/ + + - name: Upload corrected files + uses: actions/upload-artifact@v4 + with: + name: corrected-files + path: corrected_files/ + + suggest: # Reviewdog suggestion job + runs-on: ubuntu-latest + needs: vale # This ensures the suggest job runs after the vale job + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download original files + uses: actions/download-artifact@v3 + with: + name: original-files + + - name: Download corrected files + uses: actions/download-artifact@v3 + with: + name: corrected-files + + - name: List downloaded files + run: | + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with corrected files + run: | + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + fi + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From b3e91333dd564ca6c9c7ec7394770724b6b1e9a5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:26:49 +0100 Subject: [PATCH 151/526] add --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bdf6a8031ee..273f00eac1e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -80,12 +80,12 @@ jobs: uses: actions/checkout@v3 - name: Download original files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: original-files - name: Download corrected files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: corrected-files From 58b09e9e104f0b726495161129464f1c5ac8ba5b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:29:39 +0100 Subject: [PATCH 152/526] add --- .github/workflows/vale.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 273f00eac1e..7e26cba1efa 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -59,43 +59,6 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Upload original files - uses: actions/upload-artifact@v4 - with: - name: original-files - path: original_files/ - - - name: Upload corrected files - uses: actions/upload-artifact@v4 - with: - name: corrected-files - path: corrected_files/ - - suggest: # Reviewdog suggestion job - runs-on: ubuntu-latest - needs: vale # This ensures the suggest job runs after the vale job - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download original files - uses: actions/download-artifact@v4 - with: - name: original-files - - - name: Download corrected files - uses: actions/download-artifact@v4 - with: - name: corrected-files - - - name: List downloaded files - run: | - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: From 2b967071689026e212d37465fcb9b6ef04a3afc5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:33:15 +0100 Subject: [PATCH 153/526] add --- styles/custom/Repitition.yml | 21 +++++---------------- styles/custom/SentenceCaseHeaders.yml | 18 +++++++----------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index a7dbdb24362..102ebb3ce55 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,17 +1,6 @@ -extends: existence - -message: "Repetitive word found: '%s'. Consider changing '%s' to '%s'." -level: warning - -# Regex to match repetitive words (e.g., "the the", "and and") -ignorecase: true -nonword: true +extends: repetition +message: "'%s' is repeated!" +level: error +alpha: true tokens: - - '\b(\w+)\s+\1\b' - -action: - name: edit - params: - - regex - - '\b(\w+)\s+\1\b' - - '\1' + - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 570489af918..4456d4f5714 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,12 +1,8 @@ -extends: existence +extends: capitalization +message: "'%s' should use sentence-style capitalization." +level: error +scope: heading +match: $sentence +indicators: + - ":" -message: "Header '%s' should be in sentence case: 'Sentence case header'." - -level: suggestion -scope: - - heading.h1 - - heading.h2 - - heading.h3 - - heading.h4 -tokens: | - ^[#]{1,4}\s+[a-z][^\n]*$ From 4f92cf567d4b729a312431358f99a541377b8fb9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:33:38 +0100 Subject: [PATCH 154/526] add --- .github/workflows/vale.yml | 45 +++++--------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7e26cba1efa..393fccfeb32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,6 +5,10 @@ on: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: vale: # Vale linting job runs-on: ubuntu-latest @@ -42,43 +46,4 @@ jobs: echo "Vale outputs:" ls -l - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" - - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + \ No newline at end of file From dddf8b35b53fc63fc7022c2e608820a108277353 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:35:40 +0100 Subject: [PATCH 155/526] update level --- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 102ebb3ce55..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: error +level: warning alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 4456d4f5714..b64c47aeabf 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization." -level: error +level: warning scope: heading match: $sentence indicators: From e263cd4b1fa80d5afde68cbd216fb518ba48ccb4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:38:25 +0100 Subject: [PATCH 156/526] add --- styles/custom/Typos.yml | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index f45ecfbccfb..5c48a53e1fc 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,31 +1,7 @@ -extends: substitution +extends: spelling -message: "Oops there's a typo! Consider changing '%s' instead of '%s'" +message: "Did you really mean '%s'?" level: warning -swap: - - teh: the - - recieve: receive - - definately: definitely - - seperate: separate - - occured: occurred - - untill: until - - occurence: occurrence - - colour: color - - favour: favor - - organisation: organization - - licence: license - - defence: defense - - neighbour: neighbor - - organise: organize - - recognise: recognize - - analyse: analyze - - analogue: analog - - centre: centre - - grey: gray - - labour: labor - - pretence: pretence - - standardise: standardize - action: name: replace From a9a7ae20e4e81a49e70bcf027bc237369df3973f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:43:55 +0100 Subject: [PATCH 157/526] add --- .github/workflows/vale.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 393fccfeb32..0a2e7ffeb78 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -46,4 +46,47 @@ jobs: echo "Vale outputs:" ls -l + - name: Apply Vale edits and save originals + run: | + mkdir -p original_files + mkdir -p corrected_files + for file in ${{ env.CHANGED_FILES }}; do + echo "Copying $file to original_files/${file//\//_}.original" + cp "$file" "original_files/${file//\//_}.original" + echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" + cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" + done + echo "Original files:" + ls -l original_files + echo "Corrected files:" + ls -l corrected_files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + + - name: Debug Check Changed Files Environment Variable + run: echo "CHANGED_FILES is: ${{ env.CHANGED_FILES }}" + + - name: Run Reviewdog Suggestion Action + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + tool_name: Vale + level: "warning" + filter_mode: "diff_context" + fail_on_error: "false" + reviewdog_flags: "" + cleanup: "true" + + - name: Run Reviewdog with corrected files + run: | + for file in original_files/*.original; do + original="$file" + corrected="corrected_files/$(basename "$file" .original)" + diff_output=$(diff -u "$original" "$corrected") + if [[ -n "$diff_output" ]]; then + echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter + fi + done + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} \ No newline at end of file From 628159f4166dd5ff537d087d0da7fe01d487db67 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:45:59 +0100 Subject: [PATCH 158/526] add --- .github/workflows/vale.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0a2e7ffeb78..002e6da0c32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -7,7 +7,7 @@ on: permissions: contents: read - pull-requests: write + pull-requests: write jobs: vale: # Vale linting job @@ -89,4 +89,3 @@ jobs: done env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - \ No newline at end of file From e8d5d495c567a368c96dbcd6230616926a8d9c0b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:50:45 +0100 Subject: [PATCH 159/526] add --- .github/workflows/vale.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 002e6da0c32..43702fd8027 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -7,10 +7,10 @@ on: permissions: contents: read - pull-requests: write + pull-requests: write jobs: - vale: # Vale linting job + vale: # Vale linting and suggesting job runs-on: ubuntu-latest steps: @@ -30,27 +30,28 @@ jobs: run: | BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - name: Print Changed Files - run: echo $CHANGED_FILES + run: echo "CHANGED_FILES is: ${{ env.CHANGED_FILES }}" - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do + for file in $(echo $CHANGED_FILES | jq -r '.[]'); do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l + echo "Vale output files:" + ls -l vale_output_* - name: Apply Vale edits and save originals run: | mkdir -p original_files mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do + for file in $(echo $CHANGED_FILES | jq -r '.[]'); do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" @@ -63,9 +64,6 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Debug Check Changed Files Environment Variable - run: echo "CHANGED_FILES is: ${{ env.CHANGED_FILES }}" - - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 with: From c584ae87332d96f557dda6aff6fbcdcd046b762e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:53:17 +0100 Subject: [PATCH 160/526] add --- .github/workflows/vale.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 43702fd8027..60980fdfce6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,12 +5,8 @@ on: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: # Vale linting and suggesting job + vale: # Combined Vale linting and suggestion job runs-on: ubuntu-latest steps: @@ -30,28 +26,27 @@ jobs: run: | BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$(echo \"$CHANGED_FILES\" | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - name: Print Changed Files - run: echo "CHANGED_FILES is: ${{ env.CHANGED_FILES }}" + run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - for file in $(echo $CHANGED_FILES | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l - echo "Vale output files:" - ls -l vale_output_* - name: Apply Vale edits and save originals run: | mkdir -p original_files mkdir -p corrected_files - for file in $(echo $CHANGED_FILES | jq -r '.[]'); do + for file in ${{ env.CHANGED_FILES }}; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" @@ -61,8 +56,6 @@ jobs: ls -l original_files echo "Corrected files:" ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 From 0a09200ffcb3f2a104553de96da057c57a13a3cb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 15:56:48 +0100 Subject: [PATCH 161/526] add envar --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 60980fdfce6..8517e257ee3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -56,6 +56,8 @@ jobs: ls -l original_files echo "Corrected files:" ls -l corrected_files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run Reviewdog Suggestion Action uses: reviewdog/action-suggester@v1 From 6b32bfdda2795541be41a45c6bcf6b2cad70069e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 17:58:18 +0100 Subject: [PATCH 162/526] add --- .github/workflows/vale.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8517e257ee3..b0c3d043844 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,6 +5,10 @@ on: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: vale: # Combined Vale linting and suggestion job runs-on: ubuntu-latest @@ -21,23 +25,24 @@ jobs: - name: Install jq run: sudo apt-get install -y jq - - name: Get changed files - id: changed-files - run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + - name: Get Changed Files + id: get_changed_files + uses: tj-actions/changed-files@v44 + with: + files: | + **/*.md + separator: "," - - name: Print Changed Files - run: echo $CHANGED_FILES + - name: Print Changed Markdown Files + run: echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do + IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" + for file in "${files[@]}"; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l @@ -46,7 +51,8 @@ jobs: run: | mkdir -p original_files mkdir -p corrected_files - for file in ${{ env.CHANGED_FILES }}; do + IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" + for file in "${files[@]}"; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" From aecfc882e0e24b1072cf5f4d5912e42ffddc44f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 17:59:45 +0100 Subject: [PATCH 163/526] add --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b0c3d043844..a429e4371c4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,11 +30,11 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **/*.md + **.md separator: "," - - name: Print Changed Markdown Files - run: echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" + run: | + echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" - name: Run Vale on changed files run: | From a7d03099a558beb75dc456f7b6543453cd78e3f7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:03:00 +0100 Subject: [PATCH 164/526] add --- .github/workflows/vale.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a429e4371c4..8399954b721 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -38,14 +38,13 @@ jobs: - name: Run Vale on changed files run: | - IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" - for file in "${files[@]}"; do - echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l - name: Apply Vale edits and save originals run: | From 0807d2a74a153a5433e2cf8f5d5b90aa4081c984 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:06:09 +0100 Subject: [PATCH 165/526] add --- .github/workflows/vale.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8399954b721..4f3e974da36 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,10 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + run: | + curl -L -o vale.tar.gz https://github.com/errata-ai/vale/releases/latest/download/vale_2.11.1_Linux_64-bit.tar.gz + tar -xzf vale.tar.gz -C /usr/local/bin/ + vale --version - name: Install jq run: sudo apt-get install -y jq @@ -30,21 +33,22 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **.md + **/*.md separator: "," + - name: Print Changed Markdown Files - run: | - echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" + run: echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" - name: Run Vale on changed files run: | - for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" + for file in "${files[@]}"; do + echo "Running Vale on $file" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l - name: Apply Vale edits and save originals run: | From ebd055712588af231657af73cf8ca88fe9094fe6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:10:25 +0100 Subject: [PATCH 166/526] add --- .github/workflows/vale.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4f3e974da36..90b9521c798 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,10 +5,6 @@ on: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: vale: # Combined Vale linting and suggestion job runs-on: ubuntu-latest @@ -20,10 +16,7 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - run: | - curl -L -o vale.tar.gz https://github.com/errata-ai/vale/releases/latest/download/vale_2.11.1_Linux_64-bit.tar.gz - tar -xzf vale.tar.gz -C /usr/local/bin/ - vale --version + uses: errata-ai/vale-action@v2 - name: Install jq run: sudo apt-get install -y jq @@ -33,19 +26,21 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **/*.md + **.md separator: "," - - name: Print Changed Markdown Files - run: echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" + run: | + echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" + + - name: Print Changed Files + run: echo $CHANGED_FILES - name: Run Vale on changed files run: | - IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" - for file in "${files[@]}"; do + for file in ${{ steps.get_changed_files.outputs.all_changed_files}}; do echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l @@ -54,8 +49,7 @@ jobs: run: | mkdir -p original_files mkdir -p corrected_files - IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" - for file in "${files[@]}"; do + for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" From af05b33888606f95fcdd129ac265646f5d6bcfea Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:15:16 +0100 Subject: [PATCH 167/526] add --- .github/workflows/vale.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 90b9521c798..c91714c06dc 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,6 +5,10 @@ on: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: vale: # Combined Vale linting and suggestion job runs-on: ubuntu-latest @@ -18,6 +22,11 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + - name: Verify Vale Installation + run: | + echo "Checking Vale version..." + vale --version + - name: Install jq run: sudo apt-get install -y jq @@ -26,21 +35,20 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **.md + **/*.md separator: "," + - name: Print Changed Markdown Files run: | echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" - - name: Print Changed Files - run: echo $CHANGED_FILES - - name: Run Vale on changed files run: | - for file in ${{ steps.get_changed_files.outputs.all_changed_files}}; do + IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" + for file in "${files[@]}"; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l @@ -49,7 +57,8 @@ jobs: run: | mkdir -p original_files mkdir -p corrected_files - for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do + IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" + for file in "${files[@]}"; do echo "Copying $file to original_files/${file//\//_}.original" cp "$file" "original_files/${file//\//_}.original" echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" From b664a39b1b2f6614ce0c4c34d777f7f47d2cc572 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:17:11 +0100 Subject: [PATCH 168/526] add --- .github/workflows/vale.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c91714c06dc..cb1d99fc4cf 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,11 +22,6 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - - name: Verify Vale Installation - run: | - echo "Checking Vale version..." - vale --version - - name: Install jq run: sudo apt-get install -y jq From 5749856b26316a3e1dabf45521fc77152c17f0b4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 18:20:17 +0100 Subject: [PATCH 169/526] add --- .github/workflows/vale.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cb1d99fc4cf..255a898079e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,14 +39,13 @@ jobs: - name: Run Vale on changed files run: | - IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" - for file in "${files[@]}"; do - echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" - vale --output=edit "$file" > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l - name: Apply Vale edits and save originals run: | From fb9bcf1c82e64c117c4fd0a15dd445fb05faa89e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 19:13:28 +0100 Subject: [PATCH 170/526] add --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 255a898079e..4a155d1210d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - vale: # Combined Vale linting and suggestion job + vale: runs-on: ubuntu-latest steps: @@ -22,6 +22,11 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + - name: Check Vale installation + run: | + vale --version + continue-on-error: true # Continue even if Vale is not found + - name: Install jq run: sudo apt-get install -y jq From 520e09d13d4b6131841aebe7c696d4c0d5b8c4a0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 19:17:11 +0100 Subject: [PATCH 171/526] add --- .github/workflows/vale.yml | 117 +++++++++++-------------------------- 1 file changed, 33 insertions(+), 84 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4a155d1210d..0ffbeccd5f0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,95 +1,44 @@ -name: Lint and suggest +name: Lint Markdown with Vale and Suggest Changes on: pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - pull-requests: write + types: [opened, edited, synchronize, reopened] jobs: - vale: + lint: + name: Lint Markdown Files runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@v2 - - - name: Check Vale installation - run: | - vale --version - continue-on-error: true # Continue even if Vale is not found - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get Changed Files - id: get_changed_files - uses: tj-actions/changed-files@v44 - with: - files: | - **/*.md - separator: "," - - - name: Print Changed Markdown Files - run: | - echo "Changed markdown files: ${{ steps.get_changed_files.outputs.all_changed_files }}" - - - name: Run Vale on changed files - run: | - for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Lint changed markdown files + id: vale-lint + run: | + changed_files=$(jq -r '.[]' <<< "${{ steps.changed-files.outputs.all_changed_and_modified_files }}") + for file in $changed_files; do + if [[ $file == *.md ]]; then + vale $file || true + fi done - echo "Vale outputs:" - ls -l - - - name: Apply Vale edits and save originals - run: | - mkdir -p original_files - mkdir -p corrected_files - IFS="," read -r -a files <<< "${{ steps.get_changed_files.outputs.all_changed_files }}" - for file in "${files[@]}"; do - echo "Copying $file to original_files/${file//\//_}.original" - cp "$file" "original_files/${file//\//_}.original" - echo "Copying vale_output_${file//\//_}_edit.md to corrected_files/${file//\//_}" - cp "vale_output_${file//\//_}_edit.md" "corrected_files/${file//\//_}" - done - echo "Original files:" - ls -l original_files - echo "Corrected files:" - ls -l corrected_files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - - name: Run Reviewdog Suggestion Action - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - tool_name: Vale - level: "warning" - filter_mode: "diff_context" - fail_on_error: "false" - reviewdog_flags: "" - cleanup: "true" + - name: Setup reviewdog + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + filter_mode: 'added' - - name: Run Reviewdog with corrected files - run: | - for file in original_files/*.original; do - original="$file" - corrected="corrected_files/$(basename "$file" .original)" - diff_output=$(diff -u "$original" "$corrected") - if [[ -n "$diff_output" ]]; then - echo "$diff_output" | reviewdog -f=diff -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter - fi - done - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From ab5199b78060c6f0d83a046c839cfbfe1917f201 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 19:23:28 +0100 Subject: [PATCH 172/526] add --- .github/workflows/vale.yml | 48 +++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0ffbeccd5f0..5b0ee5f87d6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,44 +1,54 @@ -name: Lint Markdown with Vale and Suggest Changes +name: Lint and suggest on: pull_request: - types: [opened, edited, synchronize, reopened] + paths: + - '**/*.md' + +permissions: + contents: read + pull-requests: write jobs: - lint: - name: Lint Markdown Files + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 - - - name: Setup Node.js - uses: actions/setup-node@v3 with: - node-version: '16' + files: '**/*.md' + separator: "," - - name: Install Vale - uses: errata-ai/vale-action@v2 + - name: Print Changed Markdown Files + run: | + echo "Changed markdown files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - name: Lint changed markdown files - id: vale-lint + - name: Run Vale on changed files run: | - changed_files=$(jq -r '.[]' <<< "${{ steps.changed-files.outputs.all_changed_and_modified_files }}") - for file in $changed_files; do - if [[ $file == *.md ]]; then - vale $file || true - fi + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done + echo "Vale outputs:" + ls -l - name: Setup reviewdog uses: reviewdog/action-suggester@v1 with: tool_name: vale github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - filter_mode: 'added' From f780e9a50aed538f644fdb5256f9f5684fbc0601 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 20:39:22 +0100 Subject: [PATCH 173/526] add --- .github/workflows/vale.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5b0ee5f87d6..a1c36b6dad1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,18 +10,15 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: + name: runner / vale runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@v2 - + - uses: errata-ai/vale-action@v2 + - name: Install jq run: sudo apt-get install -y jq From 8e09b7dc5ff56ad9e518bf908920534f3f8d96d6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 20:41:32 +0100 Subject: [PATCH 174/526] add --- .github/workflows/vale.yml | 72 ++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a1c36b6dad1..393fccfeb32 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,42 +10,40 @@ permissions: pull-requests: write jobs: - vale: - name: runner / vale + vale: # Vale linting job runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - uses: errata-ai/vale-action@v2 - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v34 - with: - files: '**/*.md' - separator: "," - - - name: Print Changed Markdown Files - run: | - echo "Changed markdown files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - - - name: Run Vale on changed files - run: | - for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Setup reviewdog - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@v2 + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get changed files + id: changed-files + run: | + BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) + CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV + + - name: Print Changed Files + run: echo $CHANGED_FILES + + - name: Run Vale on changed files + run: | + for file in ${{ env.CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + \ No newline at end of file From b1cb111e3f38d0b61280337ca7e7f41c311ef700 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 20:51:43 +0100 Subject: [PATCH 175/526] add --- .github/workflows/vale.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 393fccfeb32..c7d74bc81dd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -25,20 +25,26 @@ jobs: - name: Install jq run: sudo apt-get install -y jq - - name: Get changed files - id: changed-files + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }}) - CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES=$(echo $CHANGED_FILES | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_ENV - - - name: Print Changed Files - run: echo $CHANGED_FILES + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done - name: Run Vale on changed files run: | - for file in ${{ env.CHANGED_FILES }}; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" From c459f31202e4c5c4b45e16c73589ee11324bf5b3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 20:56:37 +0100 Subject: [PATCH 176/526] add --- .github/workflows/vale.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c7d74bc81dd..6a236d16e6e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -52,4 +52,10 @@ jobs: echo "Vale outputs:" ls -l - \ No newline at end of file + - name: Post Vale suggestions with reviewdog + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} # Replace with your secret name + tool_name: vale # Name of the tool (Vale) for reporting + level: warning # Set the severity level for suggestions (optional) + # Additional flags can be provided here (refer to reviewdog documentation) From e832ff0f04d4a8d6e446450a6a98b508702fbc4b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:04:22 +0100 Subject: [PATCH 177/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6a236d16e6e..f6bac98960f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,4 +58,5 @@ jobs: github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} # Replace with your secret name tool_name: vale # Name of the tool (Vale) for reporting level: warning # Set the severity level for suggestions (optional) - # Additional flags can be provided here (refer to reviewdog documentation) + filter_mode: diff_context # Set the filter mode for suggestions (optional) + From 9c3ff104dd50a49bbc2e8873feda850fb45023df Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:08:03 +0100 Subject: [PATCH 178/526] new one --- .github/workflows/vale.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f6bac98960f..020537f2660 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -52,11 +52,7 @@ jobs: echo "Vale outputs:" ls -l - - name: Post Vale suggestions with reviewdog - uses: reviewdog/action-suggester@v1 + - name: Suggest changes from Vale + uses: parkerbxyz/suggest-changes@v1 with: - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} # Replace with your secret name - tool_name: vale # Name of the tool (Vale) for reporting - level: warning # Set the severity level for suggestions (optional) - filter_mode: diff_context # Set the filter mode for suggestions (optional) - + comment: 'Please review and consider the suggested changes from Vale.' # Optional comment From d83a48a9e618e9be0a41e125eb445d727d7740cd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:19:25 +0100 Subject: [PATCH 179/526] add --- .github/workflows/vale.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 020537f2660..c2f7fc70a68 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -25,26 +25,9 @@ jobs: - name: Install jq run: sudo apt-get install -y jq - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md - - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - name: Run Vale on changed files run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in $(git diff --name-only --cached); do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" From 72c4317fd66eb18b05a23dce8f70ed39c37be3d2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:22:28 +0100 Subject: [PATCH 180/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom From 75f1897de38cfe77c36b8baa5f3d85b846a96a31 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:31:38 +0100 Subject: [PATCH 181/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c2f7fc70a68..bcd4a79fbce 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + with: + reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq From 89b0ce0c871bb926aad94ab7731864b144a8847a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:38:30 +0100 Subject: [PATCH 182/526] add --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bcd4a79fbce..c39ae6e73fd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -38,6 +38,7 @@ jobs: ls -l - name: Suggest changes from Vale - uses: parkerbxyz/suggest-changes@v1 + uses: reviewdog/action-suggester@v1 with: - comment: 'Please review and consider the suggested changes from Vale.' # Optional comment + tool_name: vale # Name of the tool for reviewdog reporting + message: 'Please review and consider the suggested changes from Vale.' # Optional commen From b595e903a9cf32c33ab910a27072f6a1773f4f19 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:45:02 +0100 Subject: [PATCH 183/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c39ae6e73fd..f6a9c3cc3a9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -41,4 +41,5 @@ jobs: uses: reviewdog/action-suggester@v1 with: tool_name: vale # Name of the tool for reviewdog reporting - message: 'Please review and consider the suggested changes from Vale.' # Optional commen + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + filter_mode: diff_context From 7d4137caf451c90e3c8b2fcabbece58814617aea Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:48:02 +0100 Subject: [PATCH 184/526] add --- .github/workflows/vale.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f6a9c3cc3a9..43b091b3501 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,8 +16,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@v2 From 0b0a4e2659400c337dd342c4fd486db23951d2b2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:52:43 +0100 Subject: [PATCH 185/526] add --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 43b091b3501..ee62c73bfb9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq run: sudo apt-get install -y jq @@ -40,4 +40,4 @@ jobs: with: tool_name: vale # Name of the tool for reviewdog reporting github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - filter_mode: diff_context + filter_mode: added From 0a29ed123419e348f215f6661e422570843c8bb1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 21:57:44 +0100 Subject: [PATCH 186/526] add --- .github/workflows/vale.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ee62c73bfb9..9dbfa219741 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 with: - reporter: github-pr-check + reporter: github-pr-reviewer + filter_mode: added - name: Install jq run: sudo apt-get install -y jq @@ -40,4 +41,6 @@ jobs: with: tool_name: vale # Name of the tool for reviewdog reporting github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - filter_mode: added + filter_mode: added + + \ No newline at end of file From 699a5d6e499bce88c95b94bac62128ef1ec53e13 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:01:00 +0100 Subject: [PATCH 187/526] add --- .github/workflows/vale.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9dbfa219741..ae95ebde9d0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,7 +21,6 @@ jobs: uses: errata-ai/vale-action@v2 with: reporter: github-pr-reviewer - filter_mode: added - name: Install jq run: sudo apt-get install -y jq @@ -37,10 +36,6 @@ jobs: ls -l - name: Suggest changes from Vale - uses: reviewdog/action-suggester@v1 + uses: parkerbxyz/suggest-changes@v1 with: - tool_name: vale # Name of the tool for reviewdog reporting - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - filter_mode: added - - \ No newline at end of file + comment: 'Please review and consider the suggested changes from Vale.' From 384af2c236306d76ab21e3d060aa60fd21baf875 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:05:58 +0100 Subject: [PATCH 188/526] add --- .github/workflows/vale.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ae95ebde9d0..179c0b2f03a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -25,6 +25,23 @@ jobs: - name: Install jq run: sudo apt-get install -y jq + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + - name: Run Vale on changed files run: | for file in $(git diff --name-only --cached); do @@ -36,6 +53,8 @@ jobs: ls -l - name: Suggest changes from Vale - uses: parkerbxyz/suggest-changes@v1 + uses: reviewdog/action-suggester@v1 with: - comment: 'Please review and consider the suggested changes from Vale.' + tool_name: vale # Name of the tool for reviewdog reporting + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + filter_mode: diff_context From 06a36771a8b66f145490e4b0e65b2cf4381439d4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:08:45 +0100 Subject: [PATCH 189/526] add --- .github/workflows/vale.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 179c0b2f03a..bcd4a79fbce 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,32 +16,17 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@v2 with: - reporter: github-pr-reviewer + reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md - - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - name: Run Vale on changed files run: | for file in $(git diff --name-only --cached); do @@ -53,8 +38,6 @@ jobs: ls -l - name: Suggest changes from Vale - uses: reviewdog/action-suggester@v1 + uses: parkerbxyz/suggest-changes@v1 with: - tool_name: vale # Name of the tool for reviewdog reporting - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - filter_mode: diff_context + comment: 'Please review and consider the suggested changes from Vale.' # Optional comment From bd6896c32abae7d75ba6553cfad97ac120541916 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:14:28 +0100 Subject: [PATCH 190/526] add --- .github/workflows/vale.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bcd4a79fbce..9176a5060b9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,9 +20,9 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq run: sudo apt-get install -y jq @@ -37,7 +37,4 @@ jobs: echo "Vale outputs:" ls -l - - name: Suggest changes from Vale - uses: parkerbxyz/suggest-changes@v1 - with: - comment: 'Please review and consider the suggested changes from Vale.' # Optional comment + From bc7c8f433a7815b5a43aaea433a2fc00435ac7d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:17:19 +0100 Subject: [PATCH 191/526] add --- .github/workflows/vale.yml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9176a5060b9..6fa1d694007 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,16 +20,34 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: - reporter: github-pr-check + version: latest + reporter: github-pr-reviewer - name: Install jq run: sudo apt-get install -y jq + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + - name: Run Vale on changed files run: | - for file in $(git diff --name-only --cached); do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" @@ -37,4 +55,7 @@ jobs: echo "Vale outputs:" ls -l - + - name: Suggest changes from Vale + uses: parkerbxyz/suggest-changes@v1 + with: + comment: 'Please review and consider the suggested changes from Vale.' # Optional comment From 48f26119c9d5b3fafc681bf03a814f6ab65459da Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:33:45 +0100 Subject: [PATCH 192/526] add --- .github/workflows/vale.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6fa1d694007..46887a28d43 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,10 +20,9 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: - version: latest - reporter: github-pr-reviewer + reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq @@ -56,6 +55,6 @@ jobs: ls -l - name: Suggest changes from Vale - uses: parkerbxyz/suggest-changes@v1 + uses: reviewdog/action-suggester@v1 with: - comment: 'Please review and consider the suggested changes from Vale.' # Optional comment + tool_name: vale From 263fb586befb73f0b5eb215faaa1546db9942a5d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:40:00 +0100 Subject: [PATCH 193/526] add --- .github/workflows/vale.yml | 43 ++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 46887a28d43..539cabc84b1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,14 +10,14 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@reviewdog @@ -31,30 +31,51 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns files: | - **.md + **/*.md - - name: List all changed files markdown files + - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done + echo "Changed markdown files:" + echo "${{ env.ALL_CHANGED_FILES }}" - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l + - name: Combine Vale JSON outputs + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + echo "[]" > combined_vale_output.json + for file in vale_output_*.json; do + jq -s '.[0] + .[1]' combined_vale_output.json "$file" > tmp.json && mv tmp.json combined_vale_output.json + done + - name: Suggest changes from Vale + if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: reviewdog/action-suggester@v1 with: - tool_name: vale + tool_name: vale + level: error + reviewdog_flags: '-f=jq -name=vale -reporter=github-pr-review' + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SUGGESTION_FILE: combined_vale_output.json + + - name: Upload Vale outputs as artifacts + if: steps.changed-markdown-files.outputs.any_changed == 'true' + uses: actions/upload-artifact@v4 + with: + name: vale-outputs + path: vale_output_*.json From f47b1a587066b74ce11accfd79d179ce74421786 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:43:00 +0100 Subject: [PATCH 194/526] add --- .github/workflows/vale.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 539cabc84b1..f3ccedcac2a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -43,13 +43,11 @@ jobs: echo "${{ env.ALL_CHANGED_FILES }}" - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l From 4cbd3a5983ae9c45cb73c9780084f6d54cff3e28 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:47:19 +0100 Subject: [PATCH 195/526] add --- .github/workflows/vale.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f3ccedcac2a..d231a38ff53 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -43,37 +43,36 @@ jobs: echo "${{ env.ALL_CHANGED_FILES }}" - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON "$file" > "vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l - - name: Combine Vale JSON outputs + - name: Generate diffs from Vale outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - echo "[]" > combined_vale_output.json for file in vale_output_*.json; do - jq -s '.[0] + .[1]' combined_vale_output.json "$file" > tmp.json && mv tmp.json combined_vale_output.json + cat "$file" | jq -r '.[] | .diff' > "diff_output_${file//\//_}.txt" done - name: Suggest changes from Vale if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - level: error - reviewdog_flags: '-f=jq -name=vale -reporter=github-pr-review' env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SUGGESTION_FILE: combined_vale_output.json + run: | + for diff in diff_output_*.txt; do + reviewdog -f=diff -name=vale -reporter=github-pr-review -level=error < "$diff" + done - name: Upload Vale outputs as artifacts if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: vale-outputs path: vale_output_*.json From f37ae9af325ba37c97eb9240dbd2ddbcb42170a4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:49:05 +0100 Subject: [PATCH 196/526] add --- .github/workflows/vale.yml | 42 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d231a38ff53..46887a28d43 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,14 +10,14 @@ permissions: pull-requests: write jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@reviewdog @@ -31,48 +31,30 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: + # Avoid using single or double quotes for multiline patterns files: | - **/*.md + **.md - - name: List all changed markdown files + - name: List all changed files markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - echo "Changed markdown files:" - echo "${{ env.ALL_CHANGED_FILES }}" + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON "$file" > "vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l - - name: Generate diffs from Vale outputs - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - for file in vale_output_*.json; do - cat "$file" | jq -r '.[] | .diff' > "diff_output_${file//\//_}.txt" - done - - name: Suggest changes from Vale - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - for diff in diff_output_*.txt; do - reviewdog -f=diff -name=vale -reporter=github-pr-review -level=error < "$diff" - done - - - name: Upload Vale outputs as artifacts - if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: actions/upload-artifact@v3 + uses: reviewdog/action-suggester@v1 with: - name: vale-outputs - path: vale_output_*.json + tool_name: vale From 936879956dac3e89dbf9a800a979e282f1ee8250 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:55:13 +0100 Subject: [PATCH 197/526] add --- .github/workflows/vale.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 46887a28d43..55894f3e989 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,8 +53,19 @@ jobs: done echo "Vale outputs:" ls -l + + - name: Process Vale outputs with Reviewdog + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + for file in vale_output_*_edit.md; do + cat "$file" | reviewdog -f=diff -name=vale -reporter=github-pr-review + done - name: Suggest changes from Vale + if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: reviewdog/action-suggester@v1 with: - tool_name: vale + tool_name: vale + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + From 480cef9c678263093d3448ff67ca69ee81b2eb82 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 22:58:30 +0100 Subject: [PATCH 198/526] add --- .github/workflows/vale.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 55894f3e989..0dee5f60bc6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -61,6 +61,10 @@ jobs: cat "$file" | reviewdog -f=diff -name=vale -reporter=github-pr-review done + - name: Install reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin + - name: Suggest changes from Vale if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: reviewdog/action-suggester@v1 From c36ed509f381f48a472ebeeaf3b8ca6bab5a6187 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:00:53 +0100 Subject: [PATCH 199/526] add --- .github/workflows/vale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0dee5f60bc6..ea0881db267 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -54,6 +54,10 @@ jobs: echo "Vale outputs:" ls -l + - name: Install reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin + - name: Process Vale outputs with Reviewdog if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | @@ -61,10 +65,6 @@ jobs: cat "$file" | reviewdog -f=diff -name=vale -reporter=github-pr-review done - - name: Install reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin - - name: Suggest changes from Vale if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: reviewdog/action-suggester@v1 From e491ecbaf826dd4db3d10d6bdf06a72da8b81674 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:06:47 +0100 Subject: [PATCH 200/526] add --- .github/workflows/vale.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ea0881db267..c7e17c843b1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,23 +53,11 @@ jobs: done echo "Vale outputs:" ls -l - - - name: Install reviewdog - run: | - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin - - - name: Process Vale outputs with Reviewdog - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - for file in vale_output_*_edit.md; do - cat "$file" | reviewdog -f=diff -name=vale -reporter=github-pr-review - done - - name: Suggest changes from Vale + - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: reviewdog/action-suggester@v1 + uses: parkerbxyz/suggest-changes@v1 with: - tool_name: vale + comment: 'Please commit the suggested changes from Vale.' env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e5fe0f3585d3adcc2e33f43be17fdd7083df47ce Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:10:46 +0100 Subject: [PATCH 201/526] add --- .github/workflows/vale.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c7e17c843b1..5e23e97cc44 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -54,10 +54,18 @@ jobs: echo "Vale outputs:" ls -l + - name: Concatenate Vale edits + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + echo "" > suggestions.md + for file in vale_output_*_edit.md; do + cat "$file" >> suggestions.md + done + - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: parkerbxyz/suggest-changes@v1 with: comment: 'Please commit the suggested changes from Vale.' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From cf2af55253782815d2cfe75d96460154c7774741 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:13:49 +0100 Subject: [PATCH 202/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5e23e97cc44..71b9d3864f8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,7 +58,7 @@ jobs: if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | echo "" > suggestions.md - for file in vale_output_*_edit.md; do + for file in vale_output_${file//\//_}_edit.md; do cat "$file" >> suggestions.md done From 0fe5d4e8ece881b195da965ed48f6f394193390e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:16:51 +0100 Subject: [PATCH 203/526] add --- .github/workflows/vale.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 71b9d3864f8..36e70f6693b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,14 +53,6 @@ jobs: done echo "Vale outputs:" ls -l - - - name: Concatenate Vale edits - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - echo "" > suggestions.md - for file in vale_output_${file//\//_}_edit.md; do - cat "$file" >> suggestions.md - done - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' From 17926be0d98d3aa8096bfac1a8aa2f5d101066ce Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:21:03 +0100 Subject: [PATCH 204/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 36e70f6693b..11a3b3e755d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -60,4 +60,4 @@ jobs: with: comment: 'Please commit the suggested changes from Vale.' env: - GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} From 10affcb1b36d9f982082ef192802e777db835b49 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:22:45 +0100 Subject: [PATCH 205/526] add --- .github/workflows/vale.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 11a3b3e755d..1eb537575a2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -59,5 +59,4 @@ jobs: uses: parkerbxyz/suggest-changes@v1 with: comment: 'Please commit the suggested changes from Vale.' - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + From 3b41d9c1423f7efed755cb69b9bcc12617072658 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:26:32 +0100 Subject: [PATCH 206/526] add --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1eb537575a2..89454f689d0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -56,7 +56,7 @@ jobs: - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: parkerbxyz/suggest-changes@v1 + uses: reviewdog/action-suggester@v1 with: - comment: 'Please commit the suggested changes from Vale.' + tool_name: vale From 978bdd364cc1f3672373effb2e37b22bb60c6ea0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 17 Jun 2024 23:32:07 +0100 Subject: [PATCH 207/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 89454f689d0..aa2be730e7d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -23,6 +23,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: reporter: github-pr-review + filter_mode: added - name: Install jq run: sudo apt-get install -y jq @@ -59,4 +60,5 @@ jobs: uses: reviewdog/action-suggester@v1 with: tool_name: vale + filter_mode: added From 4c9e61590ff2f0987449c099596822bc8af53ab4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 12:38:24 +0100 Subject: [PATCH 208/526] add --- .github/workflows/vale.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index aa2be730e7d..5ecf32d9ffb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -45,20 +45,20 @@ jobs: echo "$file was changed" done - - name: Run Vale on changed files + - name: Run Vale and generate diff + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in ${ALL_CHANGED_FILES}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=diff $file > "vale_diff_${file//\//_}.diff" done - echo "Vale outputs:" - ls -l - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - filter_mode: added - + run: | + for file in ${ALL_CHANGED_FILES}; do + reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "vale_diff_${file//\//_}.diff" + done From f018a2bf0f5cc05b4dc8903704a12e09a045f009 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 12:45:16 +0100 Subject: [PATCH 209/526] add --- .github/workflows/vale.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5ecf32d9ffb..3c0e8454732 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + lint-and-suggest: runs-on: ubuntu-latest steps: @@ -20,10 +20,10 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-review - filter_mode: added + run: | + curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + sudo mv vale /usr/local/bin/ + vale --version # Check if Vale is correctly installed - name: Install jq run: sudo apt-get install -y jq @@ -32,11 +32,10 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns files: | **.md - - name: List all changed files markdown files + - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -50,15 +49,19 @@ jobs: env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | + TMPFILE=$(mktemp) for file in ${ALL_CHANGED_FILES}; do echo "Running Vale on $file" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - vale --output=diff $file > "vale_diff_${file//\//_}.diff" + vale --output=diff $file >> "${TMPFILE}" done - + echo "Generated diff:" + cat "${TMPFILE}" + - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | + TMPFILE=$(mktemp) for file in ${ALL_CHANGED_FILES}; do - reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "vale_diff_${file//\//_}.diff" + vale --output=diff $file >> "${TMPFILE}" done + reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" From 97e6f4bb500b1abe6e80b2235b130a890d773cf7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 12:48:17 +0100 Subject: [PATCH 210/526] add --- .github/workflows/vale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3c0e8454732..70127bf552a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,10 +20,10 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - run: | - curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - sudo mv vale /usr/local/bin/ - vale --version # Check if Vale is correctly installed + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-check + files: .vale.ini # Assuming the config file is in the root of the repository - name: Install jq run: sudo apt-get install -y jq From 13d735019e00740fdfb6bb76376ebe53c5d187f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 12:52:23 +0100 Subject: [PATCH 211/526] add --- .github/workflows/vale.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 70127bf552a..e2509beb862 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,24 +44,21 @@ jobs: echo "$file was changed" done - - name: Run Vale and generate diff + - name: Run Vale and generate JSON output if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - TMPFILE=$(mktemp) for file in ${ALL_CHANGED_FILES}; do echo "Running Vale on $file" - vale --output=diff $file >> "${TMPFILE}" + vale --output=JSON $file > "vale_output_${file//\//_}.json" done - echo "Generated diff:" - cat "${TMPFILE}" - - name: Suggest changes + - name: Suggest changes using Reviewdog if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - TMPFILE=$(mktemp) for file in ${ALL_CHANGED_FILES}; do - vale --output=diff $file >> "${TMPFILE}" + TMPFILE=$(mktemp) + vale --output=diff $file > "${TMPFILE}" + reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" done - reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" From c06a42f39390509b88c29935c0d09c0e246ab7d9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:15:41 +0100 Subject: [PATCH 212/526] add --- .github/workflows/vale.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e2509beb862..a31dff39402 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - lint-and-suggest: + vale: # Vale linting job runs-on: ubuntu-latest steps: @@ -22,8 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-check - files: .vale.ini # Assuming the config file is in the root of the repository + reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq @@ -32,10 +31,11 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: + # Avoid using single or double quotes for multiline patterns files: | **.md - - name: List all changed markdown files + - name: List all changed files markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -44,6 +44,17 @@ jobs: echo "$file was changed" done + - name: Run Vale on changed files + run: | + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Run Vale and generate JSON output if: steps.changed-markdown-files.outputs.any_changed == 'true' env: @@ -54,6 +65,11 @@ jobs: vale --output=JSON $file > "vale_output_${file//\//_}.json" done + - name: Suggest changes + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale + - name: Suggest changes using Reviewdog if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | From ba0ffd22e64a7f5a6f970a6fa95ee973f1fa070a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:19:25 +0100 Subject: [PATCH 213/526] add --- .github/workflows/vale.yml | 104 ++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a31dff39402..58b1b8d49f9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,67 +14,55 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-review + - name: Install Vale + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review - - name: Install jq - run: sudo apt-get install -y jq + - name: Install jq + run: sudo apt-get install -y jq - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **/*.md - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done + - name: List all changed markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + echo "Changed Markdown files:" + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + done - - name: Run Vale on changed files - run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l - - - name: Run Vale and generate JSON output - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - done - - - name: Suggest changes - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - - - name: Suggest changes using Reviewdog - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - for file in ${ALL_CHANGED_FILES}; do - TMPFILE=$(mktemp) - vale --output=diff $file > "${TMPFILE}" - reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" - done + - name: Suggest changes using Reviewdog + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + for file in ${ALL_CHANGED_FILES}; do + TMPFILE=$(mktemp) + vale --output=diff $file > "${TMPFILE}" + reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" + done From 23fcd7f2de1b83b5581c0276a90b5449c8b8a909 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:38:22 +0100 Subject: [PATCH 214/526] add --- .reviewdog.yml | 8 -------- .vale.ini | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 .reviewdog.yml diff --git a/.reviewdog.yml b/.reviewdog.yml deleted file mode 100644 index 08a73d53bfa..00000000000 --- a/.reviewdog.yml +++ /dev/null @@ -1,8 +0,0 @@ -runner: - vale: - cmd: vale --output=JSON . - format: JSON - name: Vale - level: warning - errorformat: - - '%f:%l:%c: %m' diff --git a/.vale.ini b/.vale.ini index edbd97348c0..70bc192ddc5 100644 --- a/.vale.ini +++ b/.vale.ini @@ -2,6 +2,6 @@ StylesPath = styles MinAlertLevel = suggestion [*.md] -BasedOnStyles = custom +BasedOnStyles = styles/custom, Microsoft Vocab = EN From e929e57ac507c7797b3f6fd86be18de23f51ad7f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:40:44 +0100 Subject: [PATCH 215/526] add --- .github/workflows/vale.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 58b1b8d49f9..05378f8c952 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -58,11 +58,3 @@ jobs: echo "Vale outputs:" ls -l - - name: Suggest changes using Reviewdog - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - for file in ${ALL_CHANGED_FILES}; do - TMPFILE=$(mktemp) - vale --output=diff $file > "${TMPFILE}" - reviewdog -f=diff -f.diff.strip=1 -name=vale -reporter=github-pr-review < "${TMPFILE}" - done From 70bc584dbb643eb987e3282d416ea3d642bfa4af Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:43:46 +0100 Subject: [PATCH 216/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 70bc192ddc5..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -2,6 +2,6 @@ StylesPath = styles MinAlertLevel = suggestion [*.md] -BasedOnStyles = styles/custom, Microsoft +BasedOnStyles = custom Vocab = EN From 7d93b2c385f39ab1aa25ade09f771d5cfdc456e7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:45:29 +0100 Subject: [PATCH 217/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 05378f8c952..7753fd7677a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq run: sudo apt-get install -y jq From 82e468becac6bf0ac1455ecd8997d163b95635a0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:46:46 +0100 Subject: [PATCH 218/526] add --- .github/workflows/vale.yml | 88 +++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7753fd7677a..a2b2b1aabe9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,47 +14,47 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-check - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **/*.md - - - name: List all changed markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - echo "Changed Markdown files:" - for file in ${ALL_CHANGED_FILES}; do - echo "$file" - done - - - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-check + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + + - name: Run Vale on changed files + run: | + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Suggest changes from Vale + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale From dfe8881d7f2e33aedcb48e990a8413495ca93204 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:49:52 +0100 Subject: [PATCH 219/526] add --- .github/workflows/vale.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a2b2b1aabe9..db323721569 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -54,7 +54,3 @@ jobs: echo "Vale outputs:" ls -l - - name: Suggest changes from Vale - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale From 656ec4f8bb071002149325f93013bd0b996c0dda Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:50:11 +0100 Subject: [PATCH 220/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index db323721569..5daa626db44 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,4 +53,4 @@ jobs: done echo "Vale outputs:" ls -l - +a From 718ce5fa4cf0412fa9c97f6fb6271d32e14aff51 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:52:08 +0100 Subject: [PATCH 221/526] add --- .github/workflows/vale.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5daa626db44..a1aecd8463d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -23,6 +23,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: reporter: github-pr-check + filter_mode: added - name: Install jq run: sudo apt-get install -y jq @@ -53,4 +54,10 @@ jobs: done echo "Vale outputs:" ls -l -a + + - name: Suggest changes + if: steps.changed-markdown-files.outputs.any_changed == 'true' + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale + filter_mode: added From c3ab1a381a0f1b462dde16b7738a1c3ae232e24e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:57:06 +0100 Subject: [PATCH 222/526] add --- .github/workflows/vale.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a1aecd8463d..a2b2b1aabe9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -23,7 +23,6 @@ jobs: uses: errata-ai/vale-action@reviewdog with: reporter: github-pr-check - filter_mode: added - name: Install jq run: sudo apt-get install -y jq @@ -54,10 +53,8 @@ jobs: done echo "Vale outputs:" ls -l - - - name: Suggest changes - if: steps.changed-markdown-files.outputs.any_changed == 'true' + + - name: Suggest changes from Vale uses: reviewdog/action-suggester@v1 with: - tool_name: vale - filter_mode: added + tool_name: vale From 2b91d736a39dede3f1d528fef1a695c436621a90 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 13:58:16 +0100 Subject: [PATCH 223/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom From cea11251770ff4d53deafba8f51099205f324fad Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:01:26 +0100 Subject: [PATCH 224/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a2b2b1aabe9..8fde6a52c3e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -53,8 +53,10 @@ jobs: done echo "Vale outputs:" ls -l + continue-on-error: true - name: Suggest changes from Vale uses: reviewdog/action-suggester@v1 with: tool_name: vale + continue-on-error: true From f40405d1123fdd94d2c49f708a0b6b09834a5ad6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:05:44 +0100 Subject: [PATCH 225/526] add --- .github/workflows/vale.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8fde6a52c3e..b9f7eb3f89e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: reporter: github-pr-check @@ -53,10 +53,5 @@ jobs: done echo "Vale outputs:" ls -l - continue-on-error: true - - name: Suggest changes from Vale - uses: reviewdog/action-suggester@v1 - with: - tool_name: vale - continue-on-error: true + \ No newline at end of file From 6330615f7129d0fe7fe37d006eb1108b99d67956 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:09:26 +0100 Subject: [PATCH 226/526] add --- .github/workflows/vale.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b9f7eb3f89e..66513e56d26 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,8 +21,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - with: - reporter: github-pr-check + - name: Install jq run: sudo apt-get install -y jq From d01a8fac60dfcbb0c5e58a402b47931faccf2f0e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:12:40 +0100 Subject: [PATCH 227/526] add --- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index d3ecf15df08..2ae49ff91ef 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: warning +level: suggestion swap: - e.g.: for example - i.e.: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..509cbc7d01a 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggestion alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index b64c47aeabf..33aabf0ae80 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization." -level: warning +level: suggestion scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 5c48a53e1fc..59cd268af8b 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Did you really mean '%s'?" -level: warning +level: suggestion action: name: replace diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 904a5a6e583..b47d7a99f1f 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: warning +level: suggestion tokens: - '\Save\b' - '\bCancel\b' From 717b58672cac1b00859c077e1ec97eca6fa039b4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:12:52 +0100 Subject: [PATCH 228/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom From 3dd8365b586c80b2712c4ced0f54badb54a7894b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:26:50 +0100 Subject: [PATCH 229/526] add --- styles/custom/Repitition.yml | 1 + styles/custom/SentenceCaseHeaders.yml | 9 +++++++-- styles/custom/Typos.yml | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 509cbc7d01a..506e88cf727 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -4,3 +4,4 @@ level: suggestion alpha: true tokens: - '[^\s]+' + diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 33aabf0ae80..3a264445005 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,8 +1,13 @@ extends: capitalization -message: "'%s' should use sentence-style capitalization." +message: "'%s' should use sentence-style capitalization. Try '%s' instead." level: suggestion scope: heading match: $sentence indicators: - ":" - +action: + name: replace + params: + # Use a transformation to convert the header to sentence case + replace: '((? Date: Tue, 18 Jun 2024 14:38:59 +0100 Subject: [PATCH 230/526] add --- styles/custom/LatinAbbreviations.yml | 6 ++++++ styles/custom/SentenceCaseHeaders.yml | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 2ae49ff91ef..2f1a4b09e0f 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -4,6 +4,7 @@ message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that i level: suggestion swap: - e.g.: for example + - eg: for example - i.e.: for example - i.e.: that is - etc.: and so on @@ -11,3 +12,8 @@ swap: action: name: replace + params: + - for example + - that is + - and so on + - Note diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 3a264445005..9223adeec45 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -5,9 +5,4 @@ scope: heading match: $sentence indicators: - ":" -action: - name: replace - params: - # Use a transformation to convert the header to sentence case - replace: '((? Date: Tue, 18 Jun 2024 14:41:20 +0100 Subject: [PATCH 231/526] add --- styles/custom/Typos.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 888c49034de..41ae95be0c8 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -2,8 +2,3 @@ extends: spelling message: "Did you really mean '%s'? Try '%s' instead." level: suggestion - -action: - name: replace - params: - suggestions: true # Automatically suggest correct spelling From e7c47ab0096f7690227d31b3329d609bd902a8fd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 18 Jun 2024 14:45:51 +0100 Subject: [PATCH 232/526] add --- styles/custom/Typos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 41ae95be0c8..dd6adb1e0c3 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,4 +1,4 @@ extends: spelling -message: "Did you really mean '%s'? Try '%s' instead." +message: "Oops there's a typo -- did you really mean '%s'? " level: suggestion From cf2c9f5b3c77a48c8604219d3e573d823ada7439 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 13:14:10 +0100 Subject: [PATCH 233/526] ignore dbt words --- styles/custom/Typos.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index dd6adb1e0c3..1b8deb77284 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -2,3 +2,16 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " level: suggestion + +--- + +extends: existence + +message: "Ignore specific patterns" +level: skip +tokens: + - '\bdbt\b' + - '\bdbt\s+Cloud\b' + - '\bdbt\s+Core\b' + - '\bdbt\s+Cloud\s+CLI\b' + - '\bdbt\s+.*?\b' From d8401983781bc6279d3bf7c6cbf66c2a99151958 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 13:34:21 +0100 Subject: [PATCH 234/526] add review --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 66513e56d26..7203254ee02 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 + with: + reporter: github-pr-review - name: Install jq From 50f8611c852f0e9804e0b896d67623edf4162f2f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 13:46:32 +0100 Subject: [PATCH 235/526] add action --- styles/custom/Typos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 1b8deb77284..5b4bc273ae5 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -3,6 +3,11 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " level: suggestion +action: + name: suggest + params: + - spellings + --- extends: existence From 2775af12ca73b23452d12f54da34d826f5d6fa8b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 13:50:51 +0100 Subject: [PATCH 236/526] add reviewdog --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7203254ee02..1e0b51418c1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: reporter: github-pr-review From 8c19c78b43e0e72798d313729009e98b4091fcbd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:01:10 +0100 Subject: [PATCH 237/526] add tengo --- .github/workflows/vale.yml | 11 +++++++---- config/actions/RemoveDuplicateWords.tengo | 7 +++++++ styles/custom/Repitition.yml | 4 ++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 config/actions/RemoveDuplicateWords.tengo diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e0b51418c1..13204159dea 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,7 +24,6 @@ jobs: with: reporter: github-pr-review - - name: Install jq run: sudo apt-get install -y jq @@ -32,7 +31,6 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns files: | **.md @@ -54,5 +52,10 @@ jobs: done echo "Vale outputs:" ls -l - - \ No newline at end of file + + - name: Suggest changes + if: steps.changed-markdown-files.outputs.any_changed == 'true' + uses: reviewdog/action-suggester@v1 + with: + tool_name: vale + level: warning diff --git a/config/actions/RemoveDuplicateWords.tengo b/config/actions/RemoveDuplicateWords.tengo new file mode 100644 index 00000000000..e6a0442fa0f --- /dev/null +++ b/config/actions/RemoveDuplicateWords.tengo @@ -0,0 +1,7 @@ +text := import("text") + +// Match is provided by Vale and represents the rule's matched text. +deduped := text.re_replace(`\b(\w+)\s+\1\b`, match, `$1`) + +// Suggestions is required by Vale and represents the script's output. +suggestions := [deduped] diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 506e88cf727..07d14a8dad2 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,10 @@ extends: repetition message: "'%s' is repeated!" level: suggestion +action: + name: suggest + params: + - RemoveDuplicateWords.tengo alpha: true tokens: - '[^\s]+' From d3fbacfe8561e23edf72871db4654527ab4ddb01 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:07:43 +0100 Subject: [PATCH 238/526] add json --- .github/workflows/vale.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 13204159dea..6a8d844c9ae 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,8 +21,6 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq @@ -34,7 +32,7 @@ jobs: files: | **.md - - name: List all changed files markdown files + - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -44,18 +42,22 @@ jobs: done - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | + mkdir -p vale_output for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done - echo "Vale outputs:" - ls -l - + + - name: Merge JSON outputs + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: jq -s '.' vale_output/vale_output_*.json > vale_report.json + - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: reviewdog/action-suggester@v1 with: tool_name: vale level: warning + json_path: vale_report.json From 1e16a028741d226fec7dd94acbfe38f97e939914 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:18:00 +0100 Subject: [PATCH 239/526] add --- .github/workflows/vale.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6a8d844c9ae..66dec9a26df 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review - name: Install jq run: sudo apt-get install -y jq @@ -30,7 +32,7 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **.md + **/*.md - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -43,13 +45,17 @@ jobs: - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done - + echo "Vale outputs:" + ls -l vale_output + - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: jq -s '.' vale_output/vale_output_*.json > vale_report.json @@ -60,4 +66,5 @@ jobs: with: tool_name: vale level: warning - json_path: vale_report.json + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + reviewdog_flags: "--jsonc < vale_report.json" From 995731c708df245b71b4b4714ad855d877df1d09 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:26:42 +0100 Subject: [PATCH 240/526] add --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 66dec9a26df..019ae0db279 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -49,9 +49,10 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output + echo "Running Vale on changed files:" for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + ./vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l vale_output @@ -66,5 +67,5 @@ jobs: with: tool_name: vale level: warning - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} reviewdog_flags: "--jsonc < vale_report.json" From 8c21f7800ab1bbe6e54d46df664598d15849bf5a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:38:24 +0100 Subject: [PATCH 241/526] add --- .github/workflows/vale.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 019ae0db279..bcd465e25d3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,8 +21,12 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-review + + - name: Print PATH and Vale Location + run: | + echo "PATH: $PATH" + which vale + vale --version - name: Install jq run: sudo apt-get install -y jq @@ -52,7 +56,7 @@ jobs: echo "Running Vale on changed files:" for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" - ./vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l vale_output From bd86fccec45d2dbd1f87caba270a0d7ca4cb3963 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 21 Jun 2024 16:38:51 +0100 Subject: [PATCH 242/526] add --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bcd465e25d3..1f158fe013f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,8 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review - name: Print PATH and Vale Location run: | @@ -71,5 +73,5 @@ jobs: with: tool_name: vale level: warning - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} reviewdog_flags: "--jsonc < vale_report.json" From da1b228c275427428ba67e4cae9754d1bd43fa66 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:00:37 +0100 Subject: [PATCH 243/526] add hyperlint --- .github/workflows/vale.yml | 46 +++++++++++++++++++------------------- .hyperlint/config.yaml | 10 +++++++++ 2 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 .hyperlint/config.yaml diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1f158fe013f..4272a61c1a4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and suggest +name: Lint and Suggest on: pull_request: @@ -10,25 +10,22 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + lint: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-review - - - name: Print PATH and Vale Location run: | - echo "PATH: $PATH" - which vale - vale --version + curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + echo "::add-path::$HOME/.local/bin" + + - name: Print Vale version + run: vale --version - name: Install jq run: sudo apt-get install -y jq @@ -38,7 +35,7 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **/*.md + **/*.md - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -55,23 +52,26 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output - echo "Running Vale on changed files:" for file in $ALL_CHANGED_FILES; do - echo "Running Vale on $file" vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done - echo "Vale outputs:" - ls -l vale_output - + - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: jq -s '.' vale_output/vale_output_*.json > vale_report.json - - name: Suggest changes + - name: Upload Vale report for Hyperlint if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: reviewdog/action-suggester@v1 + uses: actions/upload-artifact@v3 with: - tool_name: vale - level: warning - github_token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - reviewdog_flags: "--jsonc < vale_report.json" + name: vale-report + path: vale_report.json + + - name: Comment to trigger Hyperlint + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) + curl -H "Authorization: token ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}" \ + -X POST \ + -d '{"body":"hyperlint review"}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" diff --git a/.hyperlint/config.yaml b/.hyperlint/config.yaml new file mode 100644 index 00000000000..03082114ae1 --- /dev/null +++ b/.hyperlint/config.yaml @@ -0,0 +1,10 @@ +content_dir: /docs +authorized_users: + - mirnawong1 + - matthewshaver + - nghi-ly + - runleonarun + - nataliefiann + +vale: + enabled: true From 761ace896ff38a80f555eb054178ce232ce0b193 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:03:12 +0100 Subject: [PATCH 244/526] add --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4272a61c1a4..4669bbc1c19 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,9 +20,9 @@ jobs: fetch-depth: 0 - name: Install Vale - run: | - curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - echo "::add-path::$HOME/.local/bin" + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review - name: Print Vale version run: vale --version From 3ddcad052e083663116a2dd198364cf6ad5c825b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:09:55 +0100 Subject: [PATCH 245/526] add python --- .github/workflows/vale.yml | 75 +++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4669bbc1c19..c48d959a0ab 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Lint and Suggest +name: Lint and suggest on: pull_request: @@ -10,22 +10,25 @@ permissions: pull-requests: write jobs: - lint: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: - reporter: github-pr-review + version: latest - - name: Print Vale version - run: vale --version + - name: Print PATH and Vale Location + run: | + echo "PATH: $PATH" + which vale + vale --version - name: Install jq run: sudo apt-get install -y jq @@ -35,7 +38,7 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - **/*.md + **/*.md - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -52,26 +55,54 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output + echo "Running Vale on changed files:" for file in $ALL_CHANGED_FILES; do + echo "Running Vale on $file" vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done - + echo "Vale outputs:" + ls -l vale_output + - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: jq -s '.' vale_output/vale_output_*.json > vale_report.json - - name: Upload Vale report for Hyperlint - if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: actions/upload-artifact@v3 - with: - name: vale-report - path: vale_report.json + - name: Create suggestions script + run: | + echo ' + import json + import sys + from github import Github + + def suggest_changes(report_path, token, repo_name, pr_number): + with open(report_path) as f: + report = json.load(f) - - name: Comment to trigger Hyperlint + g = Github(token) + repo = g.get_repo(repo_name) + pr = repo.get_pull(pr_number) + + for file in report: + file_path = file["filename"] + suggestions = file["results"] + for suggestion in suggestions: + start_line = suggestion["line"] + end_line = suggestion["line"] + suggestion_text = suggestion["message"] + patch = f"```suggestion\n{suggestion_text}\n```" + pr.create_review_comment(patch, pr.head.sha, file_path, start_line, end_line) + + if __name__ == "__main__": + report_path = sys.argv[1] + token = sys.argv[2] + repo_name = sys.argv[3] + pr_number = int(sys.argv[4]) + suggest_changes(report_path, token, repo_name, pr_number) + ' > suggest_changes.py + + - name: Install GitHub Python library + run: pip install PyGithub + + - name: Suggest changes if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) - curl -H "Authorization: token ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}" \ - -X POST \ - -d '{"body":"hyperlint review"}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" + run: python suggest_changes.py vale_report.json ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} ${{ github.repository }} ${{ github.event.pull_request.number }} From ff6f317fffa23b29bdaaf9b4e1669a840a7aab83 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:16:24 +0100 Subject: [PATCH 246/526] add openai script --- .github/workflows/vale.yml | 47 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c48d959a0ab..5ab4d83d8b4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,12 +24,6 @@ jobs: with: version: latest - - name: Print PATH and Vale Location - run: | - echo "PATH: $PATH" - which vale - vale --version - - name: Install jq run: sudo apt-get install -y jq @@ -67,14 +61,20 @@ jobs: if: steps.changed-markdown-files.outputs.any_changed == 'true' run: jq -s '.' vale_output/vale_output_*.json > vale_report.json - - name: Create suggestions script + - name: Create suggestions using OpenAI + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | + pip install openai PyGithub echo ' import json - import sys + import openai from github import Github - def suggest_changes(report_path, token, repo_name, pr_number): + def suggest_changes(report_path, token, openai_api_key, repo_name, pr_number): + openai.api_key = openai_api_key with open(report_path) as f: report = json.load(f) @@ -88,21 +88,22 @@ jobs: for suggestion in suggestions: start_line = suggestion["line"] end_line = suggestion["line"] - suggestion_text = suggestion["message"] - patch = f"```suggestion\n{suggestion_text}\n```" + original_text = suggestion["match"] + correction = openai.Completion.create( + engine="text-davinci-003", + prompt=f"Suggest a correction for this text: {original_text}", + max_tokens=50 + ).choices[0].text.strip() + + patch = f"```suggestion\n{correction}\n```" pr.create_review_comment(patch, pr.head.sha, file_path, start_line, end_line) if __name__ == "__main__": - report_path = sys.argv[1] - token = sys.argv[2] - repo_name = sys.argv[3] - pr_number = int(sys.argv[4]) - suggest_changes(report_path, token, repo_name, pr_number) + report_path = "vale_report.json" + token = os.environ["REVIEWDOG_GITHUB_API_TOKEN"] + openai_api_key = os.environ["OPENAI_API_KEY"] + repo_name = os.environ["GITHUB_REPOSITORY"] + pr_number = os.environ["GITHUB_EVENT_NUMBER"] + suggest_changes(report_path, token, openai_api_key, repo_name, pr_number) ' > suggest_changes.py - - - name: Install GitHub Python library - run: pip install PyGithub - - - name: Suggest changes - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: python suggest_changes.py vale_report.json ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} ${{ github.repository }} ${{ github.event.pull_request.number }} + python suggest_changes.py From 26a260b5639bccf7a65b7702fa7faaf9f317fb36 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:20:00 +0100 Subject: [PATCH 247/526] fix --- .github/workflows/vale.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5ab4d83d8b4..25d96f1b691 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,18 +44,14 @@ jobs: done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - mkdir -p vale_output - echo "Running Vale on changed files:" - for file in $ALL_CHANGED_FILES; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' From 121ea5b8889935fba8f9fbb81915c32047fb9c28 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:24:02 +0100 Subject: [PATCH 248/526] add --- .github/workflows/vale.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 25d96f1b691..62f9d369e38 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,14 +44,18 @@ jobs: done - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + mkdir -p vale_output + echo "Running Vale on changed files:" + for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done echo "Vale outputs:" - ls -l + ls -l vale_output - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -66,6 +70,7 @@ jobs: pip install openai PyGithub echo ' import json + import os import openai from github import Github @@ -79,17 +84,18 @@ jobs: pr = repo.get_pull(pr_number) for file in report: - file_path = file["filename"] - suggestions = file["results"] + file_path = file["path"] + suggestions = file["matches"] for suggestion in suggestions: start_line = suggestion["line"] end_line = suggestion["line"] original_text = suggestion["match"] - correction = openai.Completion.create( + response = openai.Completion.create( engine="text-davinci-003", prompt=f"Suggest a correction for this text: {original_text}", max_tokens=50 - ).choices[0].text.strip() + ) + correction = response.choices[0].text.strip() patch = f"```suggestion\n{correction}\n```" pr.create_review_comment(patch, pr.head.sha, file_path, start_line, end_line) @@ -99,7 +105,7 @@ jobs: token = os.environ["REVIEWDOG_GITHUB_API_TOKEN"] openai_api_key = os.environ["OPENAI_API_KEY"] repo_name = os.environ["GITHUB_REPOSITORY"] - pr_number = os.environ["GITHUB_EVENT_NUMBER"] + pr_number = os.environ["GITHUB_EVENT_PULL_REQUEST_NUMBER"] suggest_changes(report_path, token, openai_api_key, repo_name, pr_number) ' > suggest_changes.py python suggest_changes.py From f964359ac2c5d0ff177c25351ccc46572615196a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:27:23 +0100 Subject: [PATCH 249/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 62f9d369e38..807f977dd29 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -52,7 +52,7 @@ jobs: echo "Running Vale on changed files:" for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + ./vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done echo "Vale outputs:" ls -l vale_output From 85081d88db8e0918edb870fe9d996c3623ce56e8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:29:00 +0100 Subject: [PATCH 250/526] add --- .github/workflows/vale.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 807f977dd29..75913f317f8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,18 +44,14 @@ jobs: done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - mkdir -p vale_output - echo "Running Vale on changed files:" - for file in $ALL_CHANGED_FILES; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - ./vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' From 366da266087822a750454e632b816bb1e7d6fff0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:32:31 +0100 Subject: [PATCH 251/526] add --- .github/workflows/vale.yml | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 75913f317f8..b72f8f40364 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,14 +10,14 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 @@ -44,18 +44,28 @@ jobs: done - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + mkdir -p vale_output + echo "Running Vale on changed files:" + for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l - + ls -l vale_output + - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: jq -s '.' vale_output/vale_output_*.json > vale_report.json + run: | + if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then + jq -s '.' vale_output/vale_output_*.json > vale_report.json + else + echo '[]' > vale_report.json + fi - name: Create suggestions using OpenAI if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -80,12 +90,11 @@ jobs: pr = repo.get_pull(pr_number) for file in report: - file_path = file["path"] - suggestions = file["matches"] + file_path = file["Path"] + suggestions = file["Matches"] for suggestion in suggestions: - start_line = suggestion["line"] - end_line = suggestion["line"] - original_text = suggestion["match"] + start_line = suggestion["Line"] + original_text = suggestion["Match"] response = openai.Completion.create( engine="text-davinci-003", prompt=f"Suggest a correction for this text: {original_text}", @@ -94,7 +103,7 @@ jobs: correction = response.choices[0].text.strip() patch = f"```suggestion\n{correction}\n```" - pr.create_review_comment(patch, pr.head.sha, file_path, start_line, end_line) + pr.create_review_comment(patch, pr.head.sha, file_path, start_line, start_line) if __name__ == "__main__": report_path = "vale_report.json" From cc998e59f8fb9f1034c7e07efec2317945f6eb9c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:34:54 +0100 Subject: [PATCH 252/526] add --- .github/workflows/vale.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b72f8f40364..b5ac96b1e7d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -44,19 +44,14 @@ jobs: done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - mkdir -p vale_output - echo "Running Vale on changed files:" - for file in $ALL_CHANGED_FILES; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' From 63b9216c37bb4246612ced4e7dd27b6371e07132 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:40:13 +0100 Subject: [PATCH 253/526] new file and script --- .github/workflows/vale.yml | 145 +++++++++++++++---------------------- 1 file changed, 58 insertions(+), 87 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b5ac96b1e7d..6410ae7a84d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,111 +1,82 @@ -name: Lint and suggest +name: Vale Lint and Suggest on: pull_request: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: + lint-and-suggest: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 with: version: latest - - name: Install jq - run: sudo apt-get install -y jq + - name: Run Vale Linter + run: vale . - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 + - name: Install Python and dependencies + uses: actions/setup-python@v2 with: - files: | - **/*.md + python-version: '3.x' + - run: pip install requests - - name: List all changed markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' + - name: Run Auto-suggestion Script env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - - name: Run Vale on changed files + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Merge JSON outputs - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then - jq -s '.' vale_output/vale_output_*.json > vale_report.json - else - echo '[]' > vale_report.json - fi - - - name: Create suggestions using OpenAI - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - GITHUB_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - pip install openai PyGithub - echo ' - import json + python3 << 'EOF' import os - import openai - from github import Github - - def suggest_changes(report_path, token, openai_api_key, repo_name, pr_number): - openai.api_key = openai_api_key - with open(report_path) as f: - report = json.load(f) - - g = Github(token) - repo = g.get_repo(repo_name) - pr = repo.get_pull(pr_number) - - for file in report: - file_path = file["Path"] - suggestions = file["Matches"] - for suggestion in suggestions: - start_line = suggestion["Line"] - original_text = suggestion["Match"] - response = openai.Completion.create( - engine="text-davinci-003", - prompt=f"Suggest a correction for this text: {original_text}", - max_tokens=50 - ) - correction = response.choices[0].text.strip() - - patch = f"```suggestion\n{correction}\n```" - pr.create_review_comment(patch, pr.head.sha, file_path, start_line, start_line) + import requests + import json - if __name__ == "__main__": - report_path = "vale_report.json" - token = os.environ["REVIEWDOG_GITHUB_API_TOKEN"] - openai_api_key = os.environ["OPENAI_API_KEY"] - repo_name = os.environ["GITHUB_REPOSITORY"] - pr_number = os.environ["GITHUB_EVENT_PULL_REQUEST_NUMBER"] - suggest_changes(report_path, token, openai_api_key, repo_name, pr_number) - ' > suggest_changes.py - python suggest_changes.py + # Example output from Vale (this should be captured dynamically) + vale_output = ''' + ./docs/example.md + 12: `teh` => `the` + ''' + + suggestions = [] + for line in vale_output.splitlines(): + if "=>" in line: + file_path, line_number, suggestion = line.split(':', 2) + suggestions.append({ + "file_path": file_path.strip(), + "line_number": int(line_number.strip()), + "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') + }) + + repo = os.getenv('GITHUB_REPOSITORY') + pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] + token = os.getenv('GITHUB_TOKEN') + + headers = { + 'Authorization': f'token {token}', + 'Accept': 'application/vnd.github.v3+json' + } + + for suggestion in suggestions: + comment = { + "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", + "path": suggestion['file_path'], + "position": suggestion['line_number'], + "side": "RIGHT", + "line": suggestion['line_number'] + } + + response = requests.post( + f"https://api.github.com/repos/{repo}/pulls/{pull_request_number}/comments", + headers=headers, + data=json.dumps(comment) + ) + + if response.status_code != 201: + print(f"Failed to create comment: {response.json()}") + + EOF From a2f6409e761bfb453bf0707734da59959f1a991e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:47:40 +0100 Subject: [PATCH 254/526] add --- .github/workflows/vale.yml | 145 ++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 58 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6410ae7a84d..352de4aaebd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,82 +1,111 @@ -name: Vale Lint and Suggest +name: Lint and suggest on: pull_request: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - lint-and-suggest: + vale: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 with: version: latest - - name: Run Vale Linter - run: vale . + - name: Install jq + run: sudo apt-get install -y jq - - name: Install Python and dependencies - uses: actions/setup-python@v2 + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 with: - python-version: '3.x' - - run: pip install requests + files: | + **/*.md - - name: Run Auto-suggestion Script + - name: List all changed markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - python3 << 'EOF' - import os - import requests + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + + - name: Run Vale on changed files + run: | + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l + + - name: Merge JSON outputs + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then + jq -s '.' vale_output/vale_output_*.json > vale_report.json + else + echo '[]' > vale_report.json + fi + + - name: Create suggestions using OpenAI + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + run: | + pip install openai PyGithub + echo ' import json + import os + import openai + from github import Github + + def suggest_changes(report_path, token, openai_api_key, repo_name, pr_number): + openai.api_key = openai_api_key + with open(report_path) as f: + report = json.load(f) + + g = Github(token) + repo = g.get_repo(repo_name) + pr = repo.get_pull(pr_number) + + for file in report: + file_path = file["Path"] + suggestions = file["Matches"] + for suggestion in suggestions: + start_line = suggestion["Line"] + original_text = suggestion["Match"] + response = openai.Completion.create( + engine="text-davinci-003", + prompt=f"Suggest a correction for this text: {original_text}", + max_tokens=50 + ) + correction = response.choices[0].text.strip() + + patch = f"```suggestion\n{correction}\n```" + pr.create_review_comment(patch, pr.head.sha, file_path, start_line, start_line) - # Example output from Vale (this should be captured dynamically) - vale_output = ''' - ./docs/example.md - 12: `teh` => `the` - ''' - - suggestions = [] - for line in vale_output.splitlines(): - if "=>" in line: - file_path, line_number, suggestion = line.split(':', 2) - suggestions.append({ - "file_path": file_path.strip(), - "line_number": int(line_number.strip()), - "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') - }) - - repo = os.getenv('GITHUB_REPOSITORY') - pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] - token = os.getenv('GITHUB_TOKEN') - - headers = { - 'Authorization': f'token {token}', - 'Accept': 'application/vnd.github.v3+json' - } - - for suggestion in suggestions: - comment = { - "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", - "path": suggestion['file_path'], - "position": suggestion['line_number'], - "side": "RIGHT", - "line": suggestion['line_number'] - } - - response = requests.post( - f"https://api.github.com/repos/{repo}/pulls/{pull_request_number}/comments", - headers=headers, - data=json.dumps(comment) - ) - - if response.status_code != 201: - print(f"Failed to create comment: {response.json()}") - - EOF + if __name__ == "__main__": + report_path = "vale_report.json" + token = os.environ["VALE_GITHUB_TOKEN"] + openai_api_key = os.environ["OPENAI_API_KEY"] + repo_name = os.environ["GITHUB_REPOSITORY"] + pr_number = os.environ["GITHUB_EVENT_PULL_REQUEST_NUMBER"] + suggest_changes(report_path, token, openai_api_key, repo_name, pr_number) + ' > suggest_changes.py + python suggest_changes.py From 9c6cb4bb1a13de10d7bc731efdaad4b0986d85a2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:51:30 +0100 Subject: [PATCH 255/526] add --- .github/workflows/vale.yml | 145 +++++++++++++++---------------------- 1 file changed, 58 insertions(+), 87 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 352de4aaebd..6410ae7a84d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,111 +1,82 @@ -name: Lint and suggest +name: Vale Lint and Suggest on: pull_request: paths: - '**/*.md' -permissions: - contents: read - pull-requests: write - jobs: - vale: + lint-and-suggest: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@v2 with: version: latest - - name: Install jq - run: sudo apt-get install -y jq + - name: Run Vale Linter + run: vale . - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 + - name: Install Python and dependencies + uses: actions/setup-python@v2 with: - files: | - **/*.md + python-version: '3.x' + - run: pip install requests - - name: List all changed markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' + - name: Run Auto-suggestion Script env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - - name: Run Vale on changed files + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - - - name: Merge JSON outputs - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then - jq -s '.' vale_output/vale_output_*.json > vale_report.json - else - echo '[]' > vale_report.json - fi - - - name: Create suggestions using OpenAI - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - pip install openai PyGithub - echo ' - import json + python3 << 'EOF' import os - import openai - from github import Github - - def suggest_changes(report_path, token, openai_api_key, repo_name, pr_number): - openai.api_key = openai_api_key - with open(report_path) as f: - report = json.load(f) - - g = Github(token) - repo = g.get_repo(repo_name) - pr = repo.get_pull(pr_number) - - for file in report: - file_path = file["Path"] - suggestions = file["Matches"] - for suggestion in suggestions: - start_line = suggestion["Line"] - original_text = suggestion["Match"] - response = openai.Completion.create( - engine="text-davinci-003", - prompt=f"Suggest a correction for this text: {original_text}", - max_tokens=50 - ) - correction = response.choices[0].text.strip() - - patch = f"```suggestion\n{correction}\n```" - pr.create_review_comment(patch, pr.head.sha, file_path, start_line, start_line) + import requests + import json - if __name__ == "__main__": - report_path = "vale_report.json" - token = os.environ["VALE_GITHUB_TOKEN"] - openai_api_key = os.environ["OPENAI_API_KEY"] - repo_name = os.environ["GITHUB_REPOSITORY"] - pr_number = os.environ["GITHUB_EVENT_PULL_REQUEST_NUMBER"] - suggest_changes(report_path, token, openai_api_key, repo_name, pr_number) - ' > suggest_changes.py - python suggest_changes.py + # Example output from Vale (this should be captured dynamically) + vale_output = ''' + ./docs/example.md + 12: `teh` => `the` + ''' + + suggestions = [] + for line in vale_output.splitlines(): + if "=>" in line: + file_path, line_number, suggestion = line.split(':', 2) + suggestions.append({ + "file_path": file_path.strip(), + "line_number": int(line_number.strip()), + "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') + }) + + repo = os.getenv('GITHUB_REPOSITORY') + pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] + token = os.getenv('GITHUB_TOKEN') + + headers = { + 'Authorization': f'token {token}', + 'Accept': 'application/vnd.github.v3+json' + } + + for suggestion in suggestions: + comment = { + "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", + "path": suggestion['file_path'], + "position": suggestion['line_number'], + "side": "RIGHT", + "line": suggestion['line_number'] + } + + response = requests.post( + f"https://api.github.com/repos/{repo}/pulls/{pull_request_number}/comments", + headers=headers, + data=json.dumps(comment) + ) + + if response.status_code != 201: + print(f"Failed to create comment: {response.json()}") + + EOF From ba258323b142e3f26b04318387fe3886a508e66a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 16:54:24 +0100 Subject: [PATCH 256/526] add --- .github/workflows/vale.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6410ae7a84d..b0f19a42811 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,8 +18,32 @@ jobs: with: version: latest - - name: Run Vale Linter - run: vale . + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + files: | + **/*.md + + - name: List all changed markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + + - name: Run Vale on changed files + run: | + mkdir -p vale_output + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l vale_output - name: Install Python and dependencies uses: actions/setup-python@v2 From 3bb7a7e41bc3719b0faa658b9264552bed1f9add Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:02:11 +0100 Subject: [PATCH 257/526] add --- .github/workflows/vale.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b0f19a42811..97ffbb46f10 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,9 +35,12 @@ jobs: done - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" @@ -60,21 +63,25 @@ jobs: import requests import json + def parse_vale_output(output): + suggestions = [] + for line in output.splitlines(): + parts = line.split(':', 2) + if len(parts) == 3 and "=>" in parts[2]: + file_path, line_number, suggestion = parts + suggestions.append({ + "file_path": file_path.strip(), + "line_number": int(line_number.strip()), + "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') + }) + return suggestions + # Example output from Vale (this should be captured dynamically) vale_output = ''' - ./docs/example.md - 12: `teh` => `the` + ./docs/example.md: 12: `teh` => `the` ''' - suggestions = [] - for line in vale_output.splitlines(): - if "=>" in line: - file_path, line_number, suggestion = line.split(':', 2) - suggestions.append({ - "file_path": file_path.strip(), - "line_number": int(line_number.strip()), - "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') - }) + suggestions = parse_vale_output(vale_output) repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] From 3039291afd4af86fec91a2a6a22b85c82286dde5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:04:34 +0100 Subject: [PATCH 258/526] add --- .github/workflows/vale.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 97ffbb46f10..ea0ec9e3386 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 with: - version: latest + reporter: github-pr-review - name: Get all changed markdown files id: changed-markdown-files @@ -35,18 +35,14 @@ jobs: done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - mkdir -p vale_output - for file in $ALL_CHANGED_FILES; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Install Python and dependencies uses: actions/setup-python@v2 From bb2833ad23fde2ba47b7383ba2e34fce96b37c71 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:13:08 +0100 Subject: [PATCH 259/526] add --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ea0ec9e3386..75a31754844 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -52,7 +52,7 @@ jobs: - name: Run Auto-suggestion Script env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} run: | python3 << 'EOF' import os @@ -82,6 +82,7 @@ jobs: repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] token = os.getenv('GITHUB_TOKEN') + commit_id = os.getenv('GITHUB_SHA' headers = { 'Authorization': f'token {token}', @@ -94,6 +95,7 @@ jobs: "path": suggestion['file_path'], "position": suggestion['line_number'], "side": "RIGHT", + "commit_id": commit_id, "line": suggestion['line_number'] } From c71721f60901ee8940399736eff227f38a93f50c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:17:35 +0100 Subject: [PATCH 260/526] add ) --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 75a31754844..12f22012c58 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -82,7 +82,7 @@ jobs: repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] token = os.getenv('GITHUB_TOKEN') - commit_id = os.getenv('GITHUB_SHA' + commit_id = os.getenv('GITHUB_SHA') headers = { 'Authorization': f'token {token}', From 986e29ab54adc434d0c1c94bdbf5845af7b753e2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:27:27 +0100 Subject: [PATCH 261/526] add --- .github/workflows/vale.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 12f22012c58..8dc91f896bb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,13 +36,14 @@ jobs: - name: Run Vale on changed files run: | + mkdir -p vale_output for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l + ls -l vale_output - name: Install Python and dependencies uses: actions/setup-python@v2 @@ -52,7 +53,7 @@ jobs: - name: Run Auto-suggestion Script env: - GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | python3 << 'EOF' import os @@ -90,13 +91,14 @@ jobs: } for suggestion in suggestions: + diff_hunk = f"@@ -1 +1 @@\n-{suggestion['suggestion']}" comment = { "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", "path": suggestion['file_path'], - "position": suggestion['line_number'], - "side": "RIGHT", "commit_id": commit_id, - "line": suggestion['line_number'] + "side": "RIGHT", + "line": suggestion['line_number'], + "diff_hunk": diff_hunk } response = requests.post( From 65e569cebc5035e18aa4409af4d3396f197c37d9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:42:51 +0100 Subject: [PATCH 262/526] add --- .github/workflows/vale.yml | 63 ++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8dc91f896bb..9aaa0e39583 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 with: - reporter: github-pr-review + reporter: github-pr-check - name: Get all changed markdown files id: changed-markdown-files @@ -24,7 +24,7 @@ jobs: with: files: | **/*.md - + - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: @@ -33,18 +33,30 @@ jobs: for file in ${ALL_CHANGED_FILES}; do echo "$file was changed" done - + - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | mkdir -p vale_output - for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on changed files:" + for file in $ALL_CHANGED_FILES; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output/vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l vale_output + - name: Merge JSON outputs + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: | + if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then + jq -s '.' vale_output/vale_output_*.json > vale_report.json + else + echo '[]' > vale_report.json + fi + - name: Install Python and dependencies uses: actions/setup-python@v2 with: @@ -60,25 +72,26 @@ jobs: import requests import json - def parse_vale_output(output): + def parse_vale_output(vale_report_path): + with open(vale_report_path, 'r') as file: + data = json.load(file) suggestions = [] - for line in output.splitlines(): - parts = line.split(':', 2) - if len(parts) == 3 and "=>" in parts[2]: - file_path, line_number, suggestion = parts - suggestions.append({ - "file_path": file_path.strip(), - "line_number": int(line_number.strip()), - "suggestion": suggestion.strip().split('=>')[1].strip().strip('`') - }) + for item in data: + file_path = item['Path'] + for match in item['Matches']: + line_number = match['Line'] + message = match['Message'] + suggestion = message.split('=>')[1].strip('`') if '=>' in message else None + if suggestion: + suggestions.append({ + "file_path": file_path, + "line_number": line_number, + "suggestion": suggestion + }) return suggestions - # Example output from Vale (this should be captured dynamically) - vale_output = ''' - ./docs/example.md: 12: `teh` => `the` - ''' - - suggestions = parse_vale_output(vale_output) + vale_report_path = 'vale_report.json' + suggestions = parse_vale_output(vale_report_path) repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] @@ -91,14 +104,12 @@ jobs: } for suggestion in suggestions: - diff_hunk = f"@@ -1 +1 @@\n-{suggestion['suggestion']}" comment = { "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", - "path": suggestion['file_path'], "commit_id": commit_id, - "side": "RIGHT", - "line": suggestion['line_number'], - "diff_hunk": diff_hunk + "path": suggestion['file_path'], + "position": suggestion['line_number'], + "side": "RIGHT" } response = requests.post( From 5c2451b1e179bfa27ab3d3fae658325848411ded Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:44:59 +0100 Subject: [PATCH 263/526] add --- .github/workflows/vale.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9aaa0e39583..a7381ecb636 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,18 +35,14 @@ jobs: done - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - mkdir -p vale_output - echo "Running Vale on changed files:" - for file in $ALL_CHANGED_FILES; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' From fba7fd058316c5584bbd98264bb3a609c35341c9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 1 Jul 2024 17:52:51 +0100 Subject: [PATCH 264/526] add --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a7381ecb636..38588365a44 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -61,7 +61,7 @@ jobs: - name: Run Auto-suggestion Script env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} run: | python3 << 'EOF' import os @@ -91,7 +91,7 @@ jobs: repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] - token = os.getenv('GITHUB_TOKEN') + token = os.getenv('VALE_GITHUB_TOKEN') commit_id = os.getenv('GITHUB_SHA') headers = { From 3dfc9b08107776adeaa034da1eee0ee03d6f6893 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 12:53:41 +0100 Subject: [PATCH 265/526] add --- .github/workflows/vale.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 38588365a44..ffd9a681449 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,8 +15,6 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@v2 - with: - reporter: github-pr-check - name: Get all changed markdown files id: changed-markdown-files @@ -36,19 +34,19 @@ jobs: - name: Run Vale on changed files run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + mkdir -p vale_output + for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/${file//\//_}.json" done echo "Vale outputs:" - ls -l + ls -l vale_output - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - if ls vale_output/vale_output_*.json 1> /dev/null 2>&1; then - jq -s '.' vale_output/vale_output_*.json > vale_report.json + if ls vale_output/*.json 1> /dev/null 2>&1; then + jq -s '.' vale_output/*.json > vale_report.json else echo '[]' > vale_report.json fi @@ -90,7 +88,7 @@ jobs: suggestions = parse_vale_output(vale_report_path) repo = os.getenv('GITHUB_REPOSITORY') - pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] + pull_request_number = os.getenv('GITHUB_REF').split('/')[-1] token = os.getenv('VALE_GITHUB_TOKEN') commit_id = os.getenv('GITHUB_SHA') From 2828e12d798f1aba9d6368c25a7f00760b1725e1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:00:05 +0100 Subject: [PATCH 266/526] add --- .github/workflows/vale.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ffd9a681449..2d69e7bd233 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,19 +34,18 @@ jobs: - name: Run Vale on changed files run: | - mkdir -p vale_output for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - if ls vale_output/*.json 1> /dev/null 2>&1; then - jq -s '.' vale_output/*.json > vale_report.json + if ls vale_output_*.json 1> /dev/null 2>&1; then + jq -s '.' vale_output_*.json > vale_report.json else echo '[]' > vale_report.json fi @@ -88,8 +87,8 @@ jobs: suggestions = parse_vale_output(vale_report_path) repo = os.getenv('GITHUB_REPOSITORY') - pull_request_number = os.getenv('GITHUB_REF').split('/')[-1] - token = os.getenv('VALE_GITHUB_TOKEN') + pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] # Correct extraction of PR number + token = os.getenv('VALE_GITHUB_TOKEN') # Correct token environment variable commit_id = os.getenv('GITHUB_SHA') headers = { From b794d60f39593ef98101fffa3561102aa64714ed Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:02:46 +0100 Subject: [PATCH 267/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2d69e7bd233..fe7d6334851 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,9 +34,10 @@ jobs: - name: Run Vale on changed files run: | - for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l From 79accc3bb5f1fd783d466eb60da7fa34298d5428 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:06:25 +0100 Subject: [PATCH 268/526] add --- .github/workflows/vale.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index fe7d6334851..749c5f21f6a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,13 +34,15 @@ jobs: - name: Run Vale on changed files run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do + dir=$(dirname "$file") + filename=$(basename "$file") echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + (cd "$dir" && vale --output=JSON "$filename" > "../vale_output_${file//\//_}.json") + (cd "$dir" && vale --output=edit "$filename" > "../vale_output_${file//\//_}_edit.md") done echo "Vale outputs:" - ls -l + ls -l vale_output - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -55,16 +57,18 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' - - run: pip install requests + - run: pip install requests openai - name: Run Auto-suggestion Script env: - GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + VALE_GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | python3 << 'EOF' import os import requests import json + import openai def parse_vale_output(vale_report_path): with open(vale_report_path, 'r') as file: @@ -84,13 +88,24 @@ jobs: }) return suggestions + def get_openai_suggestions(text, api_key): + openai.api_key = api_key + response = openai.Completion.create( + engine="text-davinci-002", + prompt=f"Provide suggestions for the following text: {text}", + max_tokens=100 + ) + suggestions = response.choices[0].text.strip() + return suggestions + vale_report_path = 'vale_report.json' suggestions = parse_vale_output(vale_report_path) repo = os.getenv('GITHUB_REPOSITORY') - pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] # Correct extraction of PR number - token = os.getenv('VALE_GITHUB_TOKEN') # Correct token environment variable + pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] + token = os.getenv('VALE_GITHUB_TOKEN') commit_id = os.getenv('GITHUB_SHA') + openai_api_key = os.getenv('OPENAI_API_KEY') headers = { 'Authorization': f'token {token}', @@ -98,8 +113,11 @@ jobs: } for suggestion in suggestions: + text_to_correct = suggestion['suggestion'] + openai_suggestion = get_openai_suggestions(text_to_correct, openai_api_key) + comment = { - "body": f"Suggestion: Change `{suggestion['suggestion']}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", + "body": f"Suggestion: Change `{text_to_correct}` to `{openai_suggestion}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", "commit_id": commit_id, "path": suggestion['file_path'], "position": suggestion['line_number'], From 585eec8b4ce2f421acc740bb0cd161b549268b6f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:09:07 +0100 Subject: [PATCH 269/526] add --- .github/workflows/vale.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 749c5f21f6a..d323a3dadb2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,15 +34,13 @@ jobs: - name: Run Vale on changed files run: | - for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do - dir=$(dirname "$file") - filename=$(basename "$file") + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - (cd "$dir" && vale --output=JSON "$filename" > "../vale_output_${file//\//_}.json") - (cd "$dir" && vale --output=edit "$filename" > "../vale_output_${file//\//_}_edit.md") + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output + ls -l - name: Merge JSON outputs if: steps.changed-markdown-files.outputs.any_changed == 'true' From 1f7844fc49ab601f1b37fd407d6dcaaec807817f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:28:55 +0100 Subject: [PATCH 270/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom From 75cfc490035048726308f2a9f7131569d9902056 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:38:31 +0100 Subject: [PATCH 271/526] add --- .github/workflows/vale.yml | 58 ++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d323a3dadb2..e069985e319 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,19 +14,19 @@ jobs: uses: actions/checkout@v3 - name: Install Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 with: files: | - **/*.md + **/*.md - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + ALL_CHANGED_FILES: ${{ steps.changed-markown-files.outputs.all_changed_files }} run: | for file in ${ALL_CHANGED_FILES}; do echo "$file was changed" @@ -42,14 +42,12 @@ jobs: echo "Vale outputs:" ls -l - - name: Merge JSON outputs - if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: | - if ls vale_output_*.json 1> /dev/null 2>&1; then - jq -s '.' vale_output_*.json > vale_report.json - else - echo '[]' > vale_report.json - fi + - name: Upload Vale output for processing + if: steps.changed-markown-files.outputs.any_changed == 'true' + uses: actions/upload-artifact@v2 + with: + name: vale-output + path: vale_output - name: Install Python and dependencies uses: actions/setup-python@v2 @@ -59,7 +57,7 @@ jobs: - name: Run Auto-suggestion Script env: - VALE_GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | python3 << 'EOF' @@ -77,26 +75,31 @@ jobs: for match in item['Matches']: line_number = match['Line'] message = match['Message'] - suggestion = message.split('=>')[1].strip('`') if '=>' in message else None - if suggestion: - suggestions.append({ - "file_path": file_path, - "line_number": line_number, - "suggestion": suggestion - }) + context = match['Context'] + suggestions.append({ + "file_path": file_path, + "line_number": line_number, + "message": message, + "context": context + }) return suggestions - def get_openai_suggestions(text, api_key): + def get_openai_suggestions(context, message, api_key): openai.api_key = api_key + prompt = ( + f"Here is a piece of text: \"{context}\"\n" + f"There is an issue: \"{message}\"\n" + f"Please provide a suggestion to fix this issue." + ) response = openai.Completion.create( engine="text-davinci-002", - prompt=f"Provide suggestions for the following text: {text}", + prompt=prompt, max_tokens=100 ) - suggestions = response.choices[0].text.strip() - return suggestions + suggestion = response.choices[0].text.strip() + return suggestion - vale_report_path = 'vale_report.json' + vale_report_path = 'vale_output/vale_report.json' suggestions = parse_vale_output(vale_report_path) repo = os.getenv('GITHUB_REPOSITORY') @@ -111,11 +114,12 @@ jobs: } for suggestion in suggestions: - text_to_correct = suggestion['suggestion'] - openai_suggestion = get_openai_suggestions(text_to_correct, openai_api_key) + context = suggestion['context'] + message = suggestion['message'] + openai_suggestion = get_openai_suggestions(context, message, openai_api_key) comment = { - "body": f"Suggestion: Change `{text_to_correct}` to `{openai_suggestion}` on line {suggestion['line_number']} in `{suggestion['file_path']}`", + "body": f"Suggestion: {openai_suggestion}\n\nContext:\n{context}\n\nMessage:\n{message}", "commit_id": commit_id, "path": suggestion['file_path'], "position": suggestion['line_number'], From a6ecafa6bf47cb43878bef62ef98ffa7e033bb74 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:46:07 +0100 Subject: [PATCH 272/526] add --- .github/workflows/vale.yml | 54 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e069985e319..75cd272c0aa 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,8 @@ jobs: uses: actions/checkout@v3 - name: Install Vale - uses: errata-ai/vale-action@reviewdog + run: | + curl -fsSL https://install.vale.sh | sh - name: Get all changed markdown files id: changed-markdown-files @@ -26,7 +27,7 @@ jobs: - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: - ALL_CHANGED_FILES: ${{ steps.changed-markown-files.outputs.all_changed_files }} + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | for file in ${ALL_CHANGED_FILES}; do echo "$file was changed" @@ -34,16 +35,16 @@ jobs: - name: Run Vale on changed files run: | + mkdir -p vale_output for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" done echo "Vale outputs:" - ls -l + ls -l vale_output - name: Upload Vale output for processing - if: steps.changed-markown-files.outputs.any_changed == 'true' + if: steps.changed-markdown-files.outputs.any_changed == 'true' uses: actions/upload-artifact@v2 with: name: vale-output @@ -57,7 +58,7 @@ jobs: - name: Run Auto-suggestion Script env: - GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | python3 << 'EOF' @@ -66,22 +67,25 @@ jobs: import json import openai - def parse_vale_output(vale_report_path): - with open(vale_report_path, 'r') as file: - data = json.load(file) + def parse_vale_output(vale_output_dir): suggestions = [] - for item in data: - file_path = item['Path'] - for match in item['Matches']: - line_number = match['Line'] - message = match['Message'] - context = match['Context'] - suggestions.append({ - "file_path": file_path, - "line_number": line_number, - "message": message, - "context": context - }) + for file_name in os.listdir(vale_output_dir): + if file_name.endswith(".json"): + file_path = os.path.join(vale_output_dir, file_name) + with open(file_path, 'r') as file: + data = json.load(file) + for item in data: + file_path = item['Path'] + for match in item['Matches']: + line_number = match['Line'] + message = match['Message'] + context = match['Context'] + suggestions.append({ + "file_path": file_path, + "line_number": line_number, + "message": message, + "context": context + }) return suggestions def get_openai_suggestions(context, message, api_key): @@ -99,12 +103,12 @@ jobs: suggestion = response.choices[0].text.strip() return suggestion - vale_report_path = 'vale_output/vale_report.json' - suggestions = parse_vale_output(vale_report_path) + vale_output_dir = 'vale_output' + suggestions = parse_vale_output(vale_output_dir) repo = os.getenv('GITHUB_REPOSITORY') pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] - token = os.getenv('VALE_GITHUB_TOKEN') + token = os.getenv('GITHUB_TOKEN') commit_id = os.getenv('GITHUB_SHA') openai_api_key = os.getenv('OPENAI_API_KEY') From d88a69ee70276dd116e5a1628fd7ec21aafe9dcf Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:48:57 +0100 Subject: [PATCH 273/526] add --- .github/workflows/vale.yml | 130 +++++++------------------------------ 1 file changed, 23 insertions(+), 107 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 75cd272c0aa..1e0b51418c1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,30 +1,42 @@ -name: Vale Lint and Suggest +name: Lint and suggest on: pull_request: paths: - '**/*.md' +permissions: + contents: read + pull-requests: write + jobs: - lint-and-suggest: + vale: # Vale linting job runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale - run: | - curl -fsSL https://install.vale.sh | sh + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-review + + + - name: Install jq + run: sudo apt-get install -y jq - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 with: + # Avoid using single or double quotes for multiline patterns files: | - **/*.md + **.md - - name: List all changed markdown files + - name: List all changed files markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -35,108 +47,12 @@ jobs: - name: Run Vale on changed files run: | - mkdir -p vale_output for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output/vale_output_${file//\//_}.json" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" - ls -l vale_output - - - name: Upload Vale output for processing - if: steps.changed-markdown-files.outputs.any_changed == 'true' - uses: actions/upload-artifact@v2 - with: - name: vale-output - path: vale_output - - - name: Install Python and dependencies - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - run: pip install requests openai - - - name: Run Auto-suggestion Script - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - python3 << 'EOF' - import os - import requests - import json - import openai - - def parse_vale_output(vale_output_dir): - suggestions = [] - for file_name in os.listdir(vale_output_dir): - if file_name.endswith(".json"): - file_path = os.path.join(vale_output_dir, file_name) - with open(file_path, 'r') as file: - data = json.load(file) - for item in data: - file_path = item['Path'] - for match in item['Matches']: - line_number = match['Line'] - message = match['Message'] - context = match['Context'] - suggestions.append({ - "file_path": file_path, - "line_number": line_number, - "message": message, - "context": context - }) - return suggestions - - def get_openai_suggestions(context, message, api_key): - openai.api_key = api_key - prompt = ( - f"Here is a piece of text: \"{context}\"\n" - f"There is an issue: \"{message}\"\n" - f"Please provide a suggestion to fix this issue." - ) - response = openai.Completion.create( - engine="text-davinci-002", - prompt=prompt, - max_tokens=100 - ) - suggestion = response.choices[0].text.strip() - return suggestion - - vale_output_dir = 'vale_output' - suggestions = parse_vale_output(vale_output_dir) - - repo = os.getenv('GITHUB_REPOSITORY') - pull_request_number = os.getenv('GITHUB_REF').split('/')[-2] - token = os.getenv('GITHUB_TOKEN') - commit_id = os.getenv('GITHUB_SHA') - openai_api_key = os.getenv('OPENAI_API_KEY') - - headers = { - 'Authorization': f'token {token}', - 'Accept': 'application/vnd.github.v3+json' - } - - for suggestion in suggestions: - context = suggestion['context'] - message = suggestion['message'] - openai_suggestion = get_openai_suggestions(context, message, openai_api_key) - - comment = { - "body": f"Suggestion: {openai_suggestion}\n\nContext:\n{context}\n\nMessage:\n{message}", - "commit_id": commit_id, - "path": suggestion['file_path'], - "position": suggestion['line_number'], - "side": "RIGHT" - } - - response = requests.post( - f"https://api.github.com/repos/{repo}/pulls/{pull_request_number}/comments", - headers=headers, - data=json.dumps(comment) - ) - - if response.status_code != 201: - print(f"Failed to create comment: {response.json()}") + ls -l - EOF + \ No newline at end of file From 10779f5f98c58d818b3f99a74417098eb8252cad Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 13:58:46 +0100 Subject: [PATCH 274/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom From 4e44e913390c1e04f88716c8da54f0b64884f2d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:03:11 +0100 Subject: [PATCH 275/526] reporter --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e0b51418c1..c57bfc4166d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq From c7bc501e3614ade68f054c435155553720957ca9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:04:07 +0100 Subject: [PATCH 276/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom From 930266cc8a7527c9bab86e61cdc279fe6def9965 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:06:27 +0100 Subject: [PATCH 277/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom From 2e9020e9b112153fc771e531843ef8793c413f4b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:07:07 +0100 Subject: [PATCH 278/526] add --- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 2f1a4b09e0f..cf61420ddd6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggestion +level: warning swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 07d14a8dad2..454a62f279c 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggestion +level: warning action: name: suggest params: diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 9223adeec45..263b9eeafe8 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggestion +level: warning scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 5b4bc273ae5..4c3dd6ea157 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " -level: suggestion +level: warning action: name: suggest diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index b47d7a99f1f..904a5a6e583 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggestion +level: warning tokens: - '\Save\b' - '\bCancel\b' From b6cfb2e4f2afeeb3bbd9caaaa398ab41f702e0d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:07:18 +0100 Subject: [PATCH 279/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom From 2c351ec7fe90b006914a9f960297495e6f53a4e3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:09:44 +0100 Subject: [PATCH 280/526] add --- styles/custom/Typos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 4c3dd6ea157..e26729197b4 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " -level: warning +level: suggest action: name: suggest From a2600bacfd6fb47c62fbcb538bc9cc94882da928 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:12:10 +0100 Subject: [PATCH 281/526] add --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/UIElements.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index cf61420ddd6..702f97aa9d6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: warning +level: suggest swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 454a62f279c..962309c91f2 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggest action: name: suggest params: diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 263b9eeafe8..05b0a96beca 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: warning +level: suggest scope: heading match: $sentence indicators: diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 904a5a6e583..8550d1e5d7c 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: warning +level: suggest tokens: - '\Save\b' - '\bCancel\b' From 6d405393c34957e7a5ebb058d4fc912efdf79b9a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:21:37 +0100 Subject: [PATCH 282/526] add --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 7 +------ styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 8 +++----- styles/custom/UIElements.yml | 2 +- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 702f97aa9d6..cf61420ddd6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggest +level: warning swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 962309c91f2..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,11 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggest -action: - name: suggest - params: - - RemoveDuplicateWords.tengo +level: warning alpha: true tokens: - '[^\s]+' - diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 05b0a96beca..263b9eeafe8 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggest +level: warning scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index e26729197b4..c0778664f59 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,12 +1,10 @@ extends: spelling -message: "Oops there's a typo -- did you really mean '%s'? " -level: suggest +message: "Oops there's a typo -- did you really mean '%s'?" +level: warning action: - name: suggest - params: - - spellings + name: replace --- diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 8550d1e5d7c..904a5a6e583 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggest +level: warning tokens: - '\Save\b' - '\bCancel\b' From 34ed9222a8f3c8d196dcac877353f54dd494230d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:24:43 +0100 Subject: [PATCH 283/526] add --- styles/custom/Typos.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index c0778664f59..99fe28edec8 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -3,9 +3,6 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" level: warning -action: - name: replace - --- extends: existence From f9aa8efa0b623e7349c5a22b4a08766d758d46cb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:31:52 +0100 Subject: [PATCH 284/526] add --- styles/custom/Typos.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 99fe28edec8..d0d0c6a952f 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -3,13 +3,8 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" level: warning ---- - -extends: existence - -message: "Ignore specific patterns" -level: skip -tokens: +custom: true +filters: - '\bdbt\b' - '\bdbt\s+Cloud\b' - '\bdbt\s+Core\b' From 40e7b1909158d2c62482d15c77d2da66ac0284fd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:33:45 +0100 Subject: [PATCH 285/526] add --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index cf61420ddd6..702f97aa9d6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: warning +level: suggest swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..7d9a98f3ca6 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggest alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 263b9eeafe8..05b0a96beca 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: warning +level: suggest scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index d0d0c6a952f..05fca95f0f2 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: warning +level: suggest custom: true filters: From ad316c3d3935df352dd84a5cd48ea1a8cab3c5fb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:34:01 +0100 Subject: [PATCH 286/526] add --- styles/custom/UIElements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 904a5a6e583..8550d1e5d7c 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: warning +level: suggest tokens: - '\Save\b' - '\bCancel\b' From f075a50045e1a38610907c60197701be11f387b9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:36:06 +0100 Subject: [PATCH 287/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c57bfc4166d..1e0b51418c1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-check + reporter: github-pr-review - name: Install jq From 38cde2d8e8c80be37a8be803d307e9713e36c7dc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:38:52 +0100 Subject: [PATCH 288/526] add --- .github/workflows/vale.yml | 2 +- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e0b51418c1..c57bfc4166d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 702f97aa9d6..cf61420ddd6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggest +level: warning swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 7d9a98f3ca6..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggest +level: warning alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 05b0a96beca..263b9eeafe8 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggest +level: warning scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 05fca95f0f2..d0d0c6a952f 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: suggest +level: warning custom: true filters: From 24fc4ef345bef4007378b6d7b7909584038bd371 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:38:58 +0100 Subject: [PATCH 289/526] add --- styles/custom/UIElements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 8550d1e5d7c..904a5a6e583 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggest +level: warning tokens: - '\Save\b' - '\bCancel\b' From 2a0d4e3333a512ebe550ef84c39a89f8a9dab1b6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:40:42 +0100 Subject: [PATCH 290/526] add --- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index cf61420ddd6..702f97aa9d6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: warning +level: suggest swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..7d9a98f3ca6 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggest alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 263b9eeafe8..05b0a96beca 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: warning +level: suggest scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index d0d0c6a952f..05fca95f0f2 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: warning +level: suggest custom: true filters: diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 904a5a6e583..8550d1e5d7c 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: warning +level: suggest tokens: - '\Save\b' - '\bCancel\b' From 378b6013d337a5dd66b5b82f7996f0cc266c1365 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:40:58 +0100 Subject: [PATCH 291/526] add --- .vale.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..b6064b233b8 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,6 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion +[*] [*.md] BasedOnStyles = custom From 77113e756512245e83338df77acab970518ef877 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:42:35 +0100 Subject: [PATCH 292/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c57bfc4166d..1e0b51418c1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-check + reporter: github-pr-review - name: Install jq From 9a7153d8553d668df9137f97115ad079f2f5080f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 2 Jul 2024 14:48:38 +0100 Subject: [PATCH 293/526] add --- .vale.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index b6064b233b8..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,6 +1,5 @@ StylesPath = styles MinAlertLevel = suggestion -[*] [*.md] BasedOnStyles = custom From efca0728738aa2f2e78535855557d05eb82e7862 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 3 Jul 2024 15:19:19 +0100 Subject: [PATCH 294/526] add --- .github/workflows/vale.yml | 2 +- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e0b51418c1..c57bfc4166d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review + reporter: github-pr-check - name: Install jq diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 702f97aa9d6..cf61420ddd6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggest +level: warning swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 7d9a98f3ca6..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggest +level: warning alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 05b0a96beca..263b9eeafe8 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggest +level: warning scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 05fca95f0f2..d0d0c6a952f 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: suggest +level: warning custom: true filters: diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 8550d1e5d7c..904a5a6e583 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggest +level: warning tokens: - '\Save\b' - '\bCancel\b' From 9a9368692374a81a5d7b7adb42ba44f631f3b091 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 3 Jul 2024 16:08:18 +0100 Subject: [PATCH 295/526] add --- .github/workflows/vale.yml | 2 +- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c57bfc4166d..1e0b51418c1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,7 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-check + reporter: github-pr-review - name: Install jq diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..edbd97348c0 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index cf61420ddd6..702f97aa9d6 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: warning +level: suggest swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..7d9a98f3ca6 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggest alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 263b9eeafe8..05b0a96beca 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: warning +level: suggest scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index d0d0c6a952f..05fca95f0f2 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: warning +level: suggest custom: true filters: diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 904a5a6e583..8550d1e5d7c 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: warning +level: suggest tokens: - '\Save\b' - '\bCancel\b' From ac19b3742bc644808f4e5a12d88e7d417b1297cd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 3 Jul 2024 16:11:20 +0100 Subject: [PATCH 296/526] add --- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 702f97aa9d6..2f1a4b09e0f 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,7 @@ extends: substitution message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggest +level: suggestion swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 7d9a98f3ca6..509cbc7d01a 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggest +level: suggestion alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 05b0a96beca..9223adeec45 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggest +level: suggestion scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 05fca95f0f2..4035b2ecb28 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'?" -level: suggest +level: suggestion custom: true filters: diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 8550d1e5d7c..b47d7a99f1f 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggest +level: suggestion tokens: - '\Save\b' - '\bCancel\b' From 40ba4746747881b76668c2dcabe0c2452498a080 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 4 Jul 2024 10:16:33 +0100 Subject: [PATCH 297/526] add --- styles/custom/your-dictionary.dic | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 styles/custom/your-dictionary.dic diff --git a/styles/custom/your-dictionary.dic b/styles/custom/your-dictionary.dic deleted file mode 100644 index 9c4e9af5908..00000000000 --- a/styles/custom/your-dictionary.dic +++ /dev/null @@ -1,15 +0,0 @@ -colour color -favour favor -organisation organization -licence license -defence defense -neighbour neighbor -organise organize -recognise recognize -analyse analyze -analogue analog -centre centre -grey gray -labour labor -pretence pretence -standardise standardize From 8a139fc43676ba712ed56ac899791044b98e4b5c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 4 Jul 2024 13:49:33 +0100 Subject: [PATCH 298/526] add ignore filters --- styles/custom/SentenceCaseHeaders.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 9223adeec45..96e2741a760 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -6,3 +6,10 @@ match: $sentence indicators: - ":" +custom: true +filters: + - '\bdbt\b' + - '\bdbt\s+Cloud\b' + - '\bdbt\s+Core\b' + - '\bdbt\s+Cloud\s+CLI\b' + - '\bdbt\s+.*?\b' From c886e0cd7ce60d393a35ca91f750f1a51a8b4fb8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 4 Jul 2024 13:59:59 +0100 Subject: [PATCH 299/526] add actions --- .github/workflows/vale.yml | 5 +---- styles/custom/Typos.yml | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1e0b51418c1..382f7a2488d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,8 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - reporter: github-pr-review - + reporter: github-pr-check - name: Install jq run: sudo apt-get install -y jq @@ -54,5 +53,3 @@ jobs: done echo "Vale outputs:" ls -l - - \ No newline at end of file diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 4035b2ecb28..04f02f36c96 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,8 +1,13 @@ extends: spelling -message: "Oops there's a typo -- did you really mean '%s'?" +message: "Oops there's a typo -- did you really mean '%s'? " level: suggestion +action: + name: suggest + params: + - spellings + custom: true filters: - '\bdbt\b' @@ -10,3 +15,16 @@ filters: - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - '\bdbt\s+.*?\b' + +--- + +extends: existence + +message: "Ignore specific patterns" +level: skip +tokens: + - '\bdbt\b' + - '\bdbt\s+Cloud\b' + - '\bdbt\s+Core\b' + - '\bdbt\s+Cloud\s+CLI\b' + - '\bdbt\s+.*?\b' From 664eb2423bee5454cfd9e6e09eaae7a2d656b352 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:34:14 +0100 Subject: [PATCH 300/526] update --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 5 +++-- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 6 ++---- styles/custom/Typos.yml | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.vale.ini b/.vale.ini index edbd97348c0..3e129d38b19 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning [*.md] BasedOnStyles = custom diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 2f1a4b09e0f..402ac42252b 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,7 +1,8 @@ extends: substitution +message: "Avoid latin abbreviations: '%s'. Consider using '%s' instead." +level: warning +ignorecase: false -message: "Avoid Latin abbreviations: '%s'. Consider using 'for example', 'that is', 'and so forth', or 'such as'." -level: suggestion swap: - e.g.: for example - eg: for example diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 509cbc7d01a..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggestion +level: warning alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 96e2741a760..d44d2fae7a2 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,13 +1,11 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggestion +level: warning scope: heading match: $sentence indicators: - ":" - -custom: true -filters: +exceptions: - '\bdbt\b' - '\bdbt\s+Cloud\b' - '\bdbt\s+Core\b' diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 04f02f36c96..56d8738155a 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " -level: suggestion +level: warning action: name: suggest From cc68109d1676419456e493a5f0c20deaa07e449f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:41:22 +0100 Subject: [PATCH 301/526] add --- .github/workflows/vale.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 382f7a2488d..fb64120dae8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,34 +22,12 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: + version: 2.17.0 reporter: github-pr-check - name: Install jq run: sudo apt-get install -y jq - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md - - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - - name: Run Vale on changed files + - name: Run Vale on all markdown files run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l + vale --output=JSON '**/*.md' > vale_output.json From 78c132a8162c9db333f1ec8e7581df3b52f13ace Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:43:25 +0100 Subject: [PATCH 302/526] add --- .github/workflows/vale.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index fb64120dae8..98e700837ce 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,4 +30,10 @@ jobs: - name: Run Vale on all markdown files run: | - vale --output=JSON '**/*.md' > vale_output.json + files=$(git diff --name-only --diff-filter=AM origin/main | grep -E '\.md$') + for file in $files; do + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + done + echo "Vale outputs:" + ls -l From 2ea9894e91b3afc98e3c4c5631e7d41d535677fa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:45:44 +0100 Subject: [PATCH 303/526] add --- .github/workflows/vale.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 98e700837ce..4ec2ac87b8b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,14 +10,17 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 + + - name: Fetch all branches + run: git fetch --all - name: Install Vale uses: errata-ai/vale-action@reviewdog @@ -28,6 +31,9 @@ jobs: - name: Install jq run: sudo apt-get install -y jq + - name: Add Vale to PATH + run: echo "/home/runner/vale" >> $GITHUB_PATH + - name: Run Vale on all markdown files run: | files=$(git diff --name-only --diff-filter=AM origin/main | grep -E '\.md$') From 1dc472d555117792d3a2fbd28631ecf39b6b0bb1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:47:56 +0100 Subject: [PATCH 304/526] add --- .github/workflows/vale.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4ec2ac87b8b..c57bfc4166d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,36 +10,49 @@ permissions: pull-requests: write jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 - - - name: Fetch all branches - run: git fetch --all + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - version: 2.17.0 reporter: github-pr-check + - name: Install jq run: sudo apt-get install -y jq - - name: Add Vale to PATH - run: echo "/home/runner/vale" >> $GITHUB_PATH + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done - - name: Run Vale on all markdown files + - name: Run Vale on changed files run: | - files=$(git diff --name-only --diff-filter=AM origin/main | grep -E '\.md$') - for file in $files; do + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l + + \ No newline at end of file From 3469194b198b48f2b573172ddb0cb6a27b44f424 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:50:57 +0100 Subject: [PATCH 305/526] add --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c57bfc4166d..a10f725595e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,6 +22,7 @@ jobs: - name: Install Vale uses: errata-ai/vale-action@reviewdog with: + version: 2.17.0 reporter: github-pr-check From db31c04203ba5125dda97d6696a6dbeae2eee88e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 12:56:26 +0100 Subject: [PATCH 306/526] add --- .github/workflows/vale.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a10f725595e..625ca17b0e2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,14 +10,17 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Fetch all history so we can access all commits + fetch-depth: 0 + + - name: Set HOME environment variable + run: echo "HOME=/home/runner" >> $GITHUB_ENV - name: Install Vale uses: errata-ai/vale-action@reviewdog @@ -25,7 +28,6 @@ jobs: version: 2.17.0 reporter: github-pr-check - - name: Install jq run: sudo apt-get install -y jq @@ -33,11 +35,10 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns files: | **.md - - name: List all changed files markdown files + - name: List all changed markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -55,5 +56,3 @@ jobs: done echo "Vale outputs:" ls -l - - \ No newline at end of file From 504384da8766832cb9ba38084f4a438d38da8617 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:00:14 +0100 Subject: [PATCH 307/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 625ca17b0e2..d241cfdab38 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -48,6 +48,8 @@ jobs: done - name: Run Vale on changed files + env: + HOME: /home/runner run: | for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" From 813ed4b4f0a0741a4f5a7bd73526dd3f04acccb5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:04:28 +0100 Subject: [PATCH 308/526] add --- .github/workflows/vale.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d241cfdab38..f352236bb15 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,6 +22,28 @@ jobs: - name: Set HOME environment variable run: echo "HOME=/home/runner" >> $GITHUB_ENV + - name: Verify Vale Configuration + run: | + echo "HOME is set to $HOME" + if [ -z "$HOME" ]; then + echo "HOME is not set. Setting it manually." + export HOME=/home/runner + echo "HOME is now set to $HOME" + fi + ls -la + if [ -f "./vale.ini" ]; then + echo "vale.ini found in the root directory." + else + echo "vale.ini not found in the root directory." + exit 1 + fi + if [ -d "./styles/custom" ]; then + echo "Custom styles directory found." + else + echo "Custom styles directory not found." + exit 1 + fi + - name: Install Vale uses: errata-ai/vale-action@reviewdog with: @@ -51,6 +73,7 @@ jobs: env: HOME: /home/runner run: | + echo "Running Vale with HOME set to $HOME" for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" From 9237b87ef6798de956915c579a657a49774d2a8a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:10:02 +0100 Subject: [PATCH 309/526] add --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f352236bb15..267ee6fea84 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,10 +31,10 @@ jobs: echo "HOME is now set to $HOME" fi ls -la - if [ -f "./vale.ini" ]; then - echo "vale.ini found in the root directory." + if [ -f "./.vale.ini" ]; then + echo ".vale.ini found in the root directory." else - echo "vale.ini not found in the root directory." + echo ".vale.ini not found in the root directory." exit 1 fi if [ -d "./styles/custom" ]; then From d0dc5e563977886ba5636a712898ae08574bb497 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:19:20 +0100 Subject: [PATCH 310/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 267ee6fea84..de5c52b4c4d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -70,11 +70,12 @@ jobs: done - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' env: HOME: /home/runner run: | echo "Running Vale with HOME set to $HOME" - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" From 93eec78b5041e1dc6b39de5529b4c46981c9f931 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:22:54 +0100 Subject: [PATCH 311/526] add --- .github/workflows/vale.yml | 41 ++++++++------------------------------ 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index de5c52b4c4d..b7cd5d4dc1f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,46 +10,21 @@ permissions: pull-requests: write jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 - - - name: Set HOME environment variable - run: echo "HOME=/home/runner" >> $GITHUB_ENV - - - name: Verify Vale Configuration - run: | - echo "HOME is set to $HOME" - if [ -z "$HOME" ]; then - echo "HOME is not set. Setting it manually." - export HOME=/home/runner - echo "HOME is now set to $HOME" - fi - ls -la - if [ -f "./.vale.ini" ]; then - echo ".vale.ini found in the root directory." - else - echo ".vale.ini not found in the root directory." - exit 1 - fi - if [ -d "./styles/custom" ]; then - echo "Custom styles directory found." - else - echo "Custom styles directory not found." - exit 1 - fi + fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@reviewdog with: - version: 2.17.0 reporter: github-pr-check + - name: Install jq run: sudo apt-get install -y jq @@ -57,10 +32,11 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: + # Avoid using single or double quotes for multiline patterns files: | **.md - - name: List all changed markdown files + - name: List all changed files markdown files if: steps.changed-markdown-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} @@ -71,14 +47,13 @@ jobs: - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - HOME: /home/runner run: | - echo "Running Vale with HOME set to $HOME" - for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do + for file in ${{ env.ALL_CHANGED_FILES }}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done echo "Vale outputs:" ls -l + + \ No newline at end of file From de6e5bb318af8018d73b16e73cee0587218ac058 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:27:34 +0100 Subject: [PATCH 312/526] add --- .github/workflows/vale.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b7cd5d4dc1f..e407e33a409 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,50 +10,28 @@ permissions: pull-requests: write jobs: - vale: # Vale linting job + vale: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - name: Install Vale uses: errata-ai/vale-action@reviewdog with: reporter: github-pr-check - - - name: Install jq - run: sudo apt-get install -y jq - - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md - - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done + files: '**/*.md' - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" + vale $file done - echo "Vale outputs:" - ls -l - - \ No newline at end of file From 73945fedde9dfd7ee661786d3e5493e1d759bad4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:33:27 +0100 Subject: [PATCH 313/526] add --- .github/workflows/vale.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e407e33a409..a9e6a2bcc7d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,9 +18,9 @@ jobs: uses: actions/checkout@v3 - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-check + run: | + curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + echo "::add-path::${HOME}/bin" - name: Get all changed markdown files id: changed-markdown-files @@ -31,6 +31,7 @@ jobs: - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | + cd website/docs/docs for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" vale $file From d8c73c99d6f5c58e18a80d1edd7aac615a5468ac Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:34:15 +0100 Subject: [PATCH 314/526] add --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a9e6a2bcc7d..781725ffc48 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,9 +18,9 @@ jobs: uses: actions/checkout@v3 - name: Install Vale - run: | - curl -sfL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - echo "::add-path::${HOME}/bin" + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-check - name: Get all changed markdown files id: changed-markdown-files From 477e93c5dc2c56be2670b72527ca9d9ea51cf7f1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:36:08 +0100 Subject: [PATCH 315/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 781725ffc48..e20fffe8512 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,7 +31,7 @@ jobs: - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - cd website/docs/docs + cd website for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do echo "Running Vale on $file" vale $file From 39c707f20ccd5d366c1dc11fa2a111cbb645acf9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:40:18 +0100 Subject: [PATCH 316/526] add --- .github/workflows/vale.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e20fffe8512..5b04a5e1dbd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -33,6 +33,7 @@ jobs: run: | cd website for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do - echo "Running Vale on $file" - vale $file + basefile=$(basename $file) + echo "Running Vale on $basefile" + vale $basefile done From baae60ca5959b69dd9eb38c615125d22c873ca13 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:44:02 +0100 Subject: [PATCH 317/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5b04a5e1dbd..56b7031de9e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -26,7 +26,8 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - files: '**/*.md' + files: | + **.md - name: Run Vale on changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' From 01d7fd092ac1a7f0acab79374864d4f0c4f0f63d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:53:05 +0100 Subject: [PATCH 318/526] add --- .github/workflows/vale.yml | 60 ++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 56b7031de9e..ca4c14f6340 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,11 +30,61 @@ jobs: **.md - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' run: | - cd website for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do - basefile=$(basename $file) - echo "Running Vale on $basefile" - vale $basefile + ```yaml +name: Lint and suggest + +on: + pull_request: + paths: + - '**/*.md' + +permissions: + contents: read + pull-requests: write + +jobs: + vale: # Vale linting job + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history so we can access all commits + + - name: Install Vale + uses: errata-ai/vale-action@reviewdog + with: + reporter: github-pr-check + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + + - name: List all changed files markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + + - name: Run Vale on changed files + run: | + for file in ${{ env.ALL_CHANGED_FILES }}; do + echo "Running Vale on $file" + vale --output=JSON $file > "vale_output_${file//\//_}.json" + vale --output=edit $file > "vale_output_${file//\//_}_edit.md" done + echo "Vale outputs:" + ls -l From c2673fb9e9fc18b706b2ed74464b266d6182ee19 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 13:58:50 +0100 Subject: [PATCH 319/526] add --- .github/workflows/vale.yml | 53 +++----------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ca4c14f6340..28dbc6f36ab 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,56 +29,6 @@ jobs: files: | **.md - - name: Run Vale on changed files - run: | - for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do - ```yaml -name: Lint and suggest - -on: - pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - pull-requests: write - -jobs: - vale: # Vale linting job - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history so we can access all commits - - - name: Install Vale - uses: errata-ai/vale-action@reviewdog - with: - reporter: github-pr-check - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - # Avoid using single or double quotes for multiline patterns - files: | - **.md - - - name: List all changed files markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - - name: Run Vale on changed files run: | for file in ${{ env.ALL_CHANGED_FILES }}; do @@ -88,3 +38,6 @@ jobs: done echo "Vale outputs:" ls -l + + - name: Print PATH for debugging + run: echo $PATH From b784e64a1767699eb41a81b3906608cefa9f4931 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:13:18 +0100 Subject: [PATCH 320/526] add --- .github/workflows/vale.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 28dbc6f36ab..ec849cf18dd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install Vale uses: errata-ai/vale-action@reviewdog @@ -29,9 +31,22 @@ jobs: files: | **.md + - name: List all changed markdown files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} + run: | + echo "Changed Markdown files:" + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + done + - name: Run Vale on changed files + if: steps.changed-markdown-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${{ env.ALL_CHANGED_FILES }}; do + for file in ${ALL_CHANGED_FILES}; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" From 4aedae21ca1e8b5bf4657308a5da0a543306f7a6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:14:32 +0100 Subject: [PATCH 321/526] add --- .github/workflows/vale.yml | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ec849cf18dd..3b21e9e57f4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -10,43 +10,30 @@ permissions: pull-requests: write jobs: - vale: + vale: # Vale linting job runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Install Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: reporter: github-pr-check - - name: Get all changed markdown files - id: changed-markdown-files - uses: tj-actions/changed-files@v44 - with: - files: | - **.md + - name: Install jq + run: sudo apt-get install -y jq - - name: List all changed markdown files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} - run: | - echo "Changed Markdown files:" - for file in ${ALL_CHANGED_FILES}; do - echo "$file" - done - - name: Run Vale on changed files - if: steps.changed-markdown-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }} run: | - for file in ${ALL_CHANGED_FILES}; do + changed_files=$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD -- '*.md') + if [ -z "$changed_files" ]; then + echo "No changed markdown files." + exit 0 + fi + + for file in $changed_files; do echo "Running Vale on $file" vale --output=JSON $file > "vale_output_${file//\//_}.json" vale --output=edit $file > "vale_output_${file//\//_}_edit.md" @@ -54,5 +41,3 @@ jobs: echo "Vale outputs:" ls -l - - name: Print PATH for debugging - run: echo $PATH From 29d989b746aeececea20a7199ada3db9d317675a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:22:02 +0100 Subject: [PATCH 322/526] add --- .github/workflows/vale.yml | 57 +++++++++++++++----------------------- 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3b21e9e57f4..04a4cce6b50 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,43 +1,30 @@ -name: Lint and suggest +name: Vale Lint on: pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - pull-requests: write + branches: + - '**' jobs: - vale: # Vale linting job + lint: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Vale - uses: errata-ai/vale-action@v2 - with: - reporter: github-pr-check - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Run Vale on changed files - run: | - changed_files=$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD -- '*.md') - if [ -z "$changed_files" ]; then - echo "No changed markdown files." - exit 0 - fi - - for file in $changed_files; do - echo "Running Vale on $file" - vale --output=JSON $file > "vale_output_${file//\//_}.json" - vale --output=edit $file > "vale_output_${file//\//_}_edit.md" - done - echo "Vale outputs:" - ls -l - + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Vale + uses: errata-ai/vale-action@v2 + with: + files: website/docs/docs + + - name: Get changed files + id: changed-files + run: | + echo "::set-output name=files::$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ')" + + - name: Run Vale + run: | + for file in ${{ steps.changed-files.outputs.files }}; do + vale "$file" + done From 0afa79525efa93821db213155ea818675a964f1f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:24:14 +0100 Subject: [PATCH 323/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 04a4cce6b50..65585ec750e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Vale linting check on: pull_request: From 645d9e0946beee6827dd998c506a27694b95417a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:26:14 +0100 Subject: [PATCH 324/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 65585ec750e..c7791a49feb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: website/docs/docs + files: website/docs - name: Get changed files id: changed-files From 02b17a98ce93ceb6943bfd791509e777002d0797 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:28:02 +0100 Subject: [PATCH 325/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c7791a49feb..65585ec750e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: website/docs + files: website/docs/docs - name: Get changed files id: changed-files From 65bfa2f29d1a2408c7f9820d987cec5da0698f26 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:29:28 +0100 Subject: [PATCH 326/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 65585ec750e..ec876a4293a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: website/docs/docs + files: all - name: Get changed files id: changed-files From 11545bb2b9fef02188c5e8ae7c0ffbaa3ae7c13a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:35:18 +0100 Subject: [PATCH 327/526] add --- .github/workflows/vale.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ec876a4293a..bdf2eb39e54 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -8,15 +8,17 @@ on: jobs: lint: runs-on: ubuntu-latest + steps: + - name: Checkout code uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: - files: all + files: website/docs - name: Get changed files id: changed-files From d7616db4d0bbe5534263cca3b13e910ec83da52b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:37:11 +0100 Subject: [PATCH 328/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bdf2eb39e54..542d2fb51c4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@reviewdog with: - files: website/docs + files: website/docs/ - name: Get changed files id: changed-files From dd71fca9d77bf4e5898810daee0f2bee3feae79a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:38:17 +0100 Subject: [PATCH 329/526] add --- .github/workflows/vale.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 542d2fb51c4..b572347a630 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -17,8 +17,6 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@reviewdog - with: - files: website/docs/ - name: Get changed files id: changed-files From e42c220d4028cd4151d29098865c9480a95fcddd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:41:21 +0100 Subject: [PATCH 330/526] add --- .github/workflows/vale.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b572347a630..d3c02ec1561 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,10 +21,11 @@ jobs: - name: Get changed files id: changed-files run: | - echo "::set-output name=files::$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ')" - + CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep -E '^website/docs/(docs|reference|guides)/.*\.(md|txt|rst)$' | tr '\n' ' ') + echo "files=$CHANGED_FILES" >> $GITHUB_ENV + - name: Run Vale run: | - for file in ${{ steps.changed-files.outputs.files }}; do + for file in ${{ env.files }}; do vale "$file" done From c1fdf6948ead9e58027336f376167ad2076ea81e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:42:21 +0100 Subject: [PATCH 331/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d3c02ec1561..a9dd82562c6 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -26,6 +26,6 @@ jobs: - name: Run Vale run: | - for file in ${{ env.files }}; do + for file in ${{ steps.changed-files.outputs.files }}; do vale "$file" done From 71d0f897be50e9ef2a021d9bb5e2568217739b04 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:44:39 +0100 Subject: [PATCH 332/526] add --- .github/workflows/vale.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a9dd82562c6..320d27929bb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale linting check +name: Vale Lint on: pull_request: @@ -8,24 +8,28 @@ on: jobs: lint: runs-on: ubuntu-latest - steps: - - name: Checkout code uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 + with: + config: .vale.ini + files: | + website/docs/docs + website/docs/reference + website/docs/guides - name: Get changed files id: changed-files run: | CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep -E '^website/docs/(docs|reference|guides)/.*\.(md|txt|rst)$' | tr '\n' ' ') - echo "files=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Run Vale run: | - for file in ${{ steps.changed-files.outputs.files }}; do + for file in ${{ env.CHANGED_FILES }}; do vale "$file" done From 8b304f6c517aa46a1eb92c27f5e1223f7b3e31d1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:44:58 +0100 Subject: [PATCH 333/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 320d27929bb..9f0a09d9b8e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,6 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - config: .vale.ini files: | website/docs/docs website/docs/reference From 538c65c021b6a2bfc2982bf58a3b7061925fb814 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:47:28 +0100 Subject: [PATCH 334/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9f0a09d9b8e..b7b57279bce 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,7 +24,7 @@ jobs: - name: Get changed files id: changed-files run: | - CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep -E '^website/docs/(docs|reference|guides)/.*\.(md|txt|rst)$' | tr '\n' ' ') + CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ' echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Run Vale From 84d6e5cf4617220bb389b9e0e1f1fedea4d02a95 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:49:51 +0100 Subject: [PATCH 335/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b7b57279bce..5967df675c3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,7 +24,7 @@ jobs: - name: Get changed files id: changed-files run: | - CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ' + CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Run Vale From 02a880b43286d4624c71421c50c427a0fcf2a649 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:53:19 +0100 Subject: [PATCH 336/526] add --- .github/workflows/vale.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5967df675c3..f78948735e8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,10 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: | - website/docs/docs - website/docs/reference - website/docs/guides + files: '["website/docs/docs","website/docs/reference","website/docs/guides"]' - name: Get changed files id: changed-files From 8d28924f0a82f77590cd2941520f52bc0cc6f7f9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:53:30 +0100 Subject: [PATCH 337/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f78948735e8..69223203324 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: '["website/docs/docs","website/docs/reference","website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - name: Get changed files id: changed-files From e462a29356f48c48524e1f7e77db16b013dc18a7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 14:56:51 +0100 Subject: [PATCH 338/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 69223203324..4fca4fa1212 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From 1fd77bb1328eb3a34fff2849de8c975832b172b0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:07:58 +0100 Subject: [PATCH 339/526] add --- .github/workflows/vale.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4fca4fa1212..11ef39c29af 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -17,6 +17,10 @@ jobs: uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + reporter: github-pr-review + level: warning + fail_on_error: true + filter_mode: added - name: Get changed files id: changed-files @@ -29,3 +33,5 @@ jobs: for file in ${{ env.CHANGED_FILES }}; do vale "$file" done + + From d5af1f34ed8a1b884cf110a60172f030c0294e83 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:08:18 +0100 Subject: [PATCH 340/526] add --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 11ef39c29af..29e1f1e3341 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,6 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@reviewdog with: + version: 2.17.0 files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' reporter: github-pr-review level: warning From 6dde6d1e2da8daea73bb46f22b8d50a24609a9e7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:11:21 +0100 Subject: [PATCH 341/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 29e1f1e3341..2781fd7c672 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,7 +21,6 @@ jobs: reporter: github-pr-review level: warning fail_on_error: true - filter_mode: added - name: Get changed files id: changed-files From 853373ca8ffae51c6b821c7017ba7ffa27d379b1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:14:12 +0100 Subject: [PATCH 342/526] add --- .github/workflows/vale.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2781fd7c672..a0b63611f97 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,8 +18,6 @@ jobs: with: version: 2.17.0 files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - reporter: github-pr-review - level: warning fail_on_error: true - name: Get changed files From a13132bcbe2b818e2c16d0d912de1e4c9b3dc9fd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:16:43 +0100 Subject: [PATCH 343/526] add --- .github/workflows/vale.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a0b63611f97..8d645818483 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,9 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@reviewdog with: - version: 2.17.0 files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - fail_on_error: true - name: Get changed files id: changed-files From 9a1d4a177faee1864a183f7f54524b61af48a81f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:36:58 +0100 Subject: [PATCH 344/526] add --- .github/workflows/vale.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8d645818483..70eced20fb5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,9 +14,12 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + files: | + website/docs/docs + website/docs/reference + website/docs/guides - name: Get changed files id: changed-files @@ -24,10 +27,11 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Run Vale + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do - vale "$file" + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done - - From ccc447d3efbdd702ee4f4f7b0a33fc2062aa52e0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 15:39:58 +0100 Subject: [PATCH 345/526] add --- .github/workflows/vale.yml | 5 +---- website/docs/guides/adapter-creation.md | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 70eced20fb5..a6b1f9d343e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,10 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: | - website/docs/docs - website/docs/reference - website/docs/guides + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - name: Get changed files id: changed-files diff --git a/website/docs/guides/adapter-creation.md b/website/docs/guides/adapter-creation.md index 20d7bae26e2..a7b88aca94f 100644 --- a/website/docs/guides/adapter-creation.md +++ b/website/docs/guides/adapter-creation.md @@ -1346,4 +1346,4 @@ The approval workflow is as follows: Ask your question in #adapter-ecosystem channel of the dbt community Slack. - \ No newline at end of file + From 9bd92b5f7d68cf49330c413e5a4d182e89410bc8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 8 Jul 2024 16:42:22 +0100 Subject: [PATCH 346/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a6b1f9d343e..5d8782c7548 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From 6a069742a946eb369bb7d30e6b87b5800243830b Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:09:57 +0100 Subject: [PATCH 347/526] Update vale.yml --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5d8782c7548..b3175930cde 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,9 +14,9 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - name: Get changed files id: changed-files From 06e66c739ec72e9b4dfd88342b7ae84dfeb69912 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 10 Jul 2024 16:13:44 +0100 Subject: [PATCH 348/526] add --- .github/workflows/vale.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b3175930cde..69223203324 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Vale uses: errata-ai/vale-action@v2 with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - name: Get changed files id: changed-files @@ -24,11 +24,8 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run Vale with Reviewdog + - name: Run Vale run: | for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + vale "$file" done From ad002e3ccd319b01fc265c0589a218a1b1517194 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 10 Jul 2024 16:16:35 +0100 Subject: [PATCH 349/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 69223203324..4fca4fa1212 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From 31af5bbce8412dd8b963c4aef5472ec22f28e03a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:09:45 +0100 Subject: [PATCH 350/526] add --- .vale.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index 3e129d38b19..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning +Vocab = EN + [*.md] BasedOnStyles = custom - -Vocab = EN From ae13dc53718919fc778b471b67717a12b1600eb0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:13:15 +0100 Subject: [PATCH 351/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4fca4fa1212..69223203324 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From 57b68fcea639cab4b22c8247414d57c1b208a9d6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:16:09 +0100 Subject: [PATCH 352/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 69223203324..4fca4fa1212 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From dad9e3b7e937a025d9a180a24f2dfa2ece574f10 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:18:00 +0100 Subject: [PATCH 353/526] w/o json --- .github/workflows/vale.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4fca4fa1212..54b36d4506b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,8 +24,10 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Run Vale + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do - vale "$file" done From 509513132d8e07fce22132fddc5463ffa3297357 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:19:04 +0100 Subject: [PATCH 354/526] add --- .github/workflows/vale.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 54b36d4506b..23434c064ff 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Vale lint checker on: pull_request: @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Vale + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -24,10 +24,11 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Set up Reviewdog + - name: Set up reviewdog uses: reviewdog/action-setup@v1 - - name: Run Vale with Reviewdog + - name: Run vale with reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done From 9281348fe3c9c898bdd0d9d2b571b8d33adc9a93 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:20:38 +0100 Subject: [PATCH 355/526] add --- .github/workflows/vale.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 23434c064ff..a6b1f9d343e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale lint checker +name: Vale Lint on: pull_request: @@ -13,8 +13,8 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up vale - uses: errata-ai/vale-action@reviewdog + - name: Set up Vale + uses: errata-ai/vale-action@v2 with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -24,10 +24,10 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Set up reviewdog + - name: Set up Reviewdog uses: reviewdog/action-setup@v1 - - name: Run vale with reviewdog + - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee From eb9f8d83da0aaa6933cec84c9b749fe8b802eba3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:24:27 +0100 Subject: [PATCH 356/526] add --- .github/workflows/vale.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a6b1f9d343e..b7a37da5a8d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,11 +24,8 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done From fc2ba3885975524649d0527ddbbc396a803b674a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:34:34 +0100 Subject: [PATCH 357/526] add --- styles/custom/config/RepetitionFix.tengo | 10 ---------- styles/custom/config/vocabularies/EN/accept.txt | 10 ++++++++++ styles/custom/config/vocabularies/EN/reject.txt | 7 +++++++ 3 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 styles/custom/config/RepetitionFix.tengo create mode 100644 styles/custom/config/vocabularies/EN/accept.txt create mode 100644 styles/custom/config/vocabularies/EN/reject.txt diff --git a/styles/custom/config/RepetitionFix.tengo b/styles/custom/config/RepetitionFix.tengo deleted file mode 100644 index 26139db0fce..00000000000 --- a/styles/custom/config/RepetitionFix.tengo +++ /dev/null @@ -1,10 +0,0 @@ -text := import("text") - -// The regex pattern for detecting repetitive words. -pattern := `\b(\w+)\s+\1\b` - -// Replace repetitive words with a single instance of the word. -correct := text.re_replace(pattern, match, `$1`) - -// `suggestions` is required by Vale and represents the script's output. -suggestions := [correct] diff --git a/styles/custom/config/vocabularies/EN/accept.txt b/styles/custom/config/vocabularies/EN/accept.txt new file mode 100644 index 00000000000..f4549b7866b --- /dev/null +++ b/styles/custom/config/vocabularies/EN/accept.txt @@ -0,0 +1,10 @@ +dbt Cloud +dbt Core +dbt Semantic Layer +dbt Explorer +dbt +dbt-tonic +dbtonic +IDE +CLI + diff --git a/styles/custom/config/vocabularies/EN/reject.txt b/styles/custom/config/vocabularies/EN/reject.txt new file mode 100644 index 00000000000..5c45f52bad4 --- /dev/null +++ b/styles/custom/config/vocabularies/EN/reject.txt @@ -0,0 +1,7 @@ +DBT Cloud +DBT Core +DBT Semantic Layer +DBT Explorer +DBT +DBT-tonic +DBTonic From 1f4b1962857e5a62f47092932854b30706a8143e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:34:51 +0100 Subject: [PATCH 358/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b7a37da5a8d..1171f8d80b4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' From 8fa869ab15b12d190d87cf7c4b4142e9fe27018a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:38:58 +0100 Subject: [PATCH 359/526] add --- .github/workflows/vale.yml | 7 +++++-- .vale.ini | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1171f8d80b4..a6b1f9d343e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -24,8 +24,11 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do - /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done diff --git a/.vale.ini b/.vale.ini index 58aff923afe..de6ce77b0d3 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,4 +4,4 @@ MinAlertLevel = warning Vocab = EN [*.md] -BasedOnStyles = custom +BasedOnStyles = custom, Vale From 21f20841a49f3e2413521e49e2e4eb1a55428b0f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:41:48 +0100 Subject: [PATCH 360/526] add --- .github/workflows/vale.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a6b1f9d343e..7107ea515dd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Vale - uses: errata-ai/vale-action@v2 + uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -24,9 +24,6 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - name: Run Vale with Reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do From caa98dc1adaac44dbc51d8ee46810ef5968f2328 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:41:57 +0100 Subject: [PATCH 361/526] add --- .vale.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index de6ce77b0d3..cee01243955 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,5 @@ StylesPath = styles MinAlertLevel = warning -Vocab = EN - [*.md] BasedOnStyles = custom, Vale From 7bee65f6bea5f5f7cb2b17cb32440998a56a016d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:46:14 +0100 Subject: [PATCH 362/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7107ea515dd..8688a91d9ac 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Vale uses: errata-ai/vale-action@reviewdog From b3e89a50becf42674b054b54fb37cc3dc59f3c6c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:49:23 +0100 Subject: [PATCH 363/526] add --- .vale.ini | 2 ++ config/actions/RemoveDuplicateWords.tengo | 7 ------- .../custom/config => config}/vocabularies/EN/accept.txt | 0 .../custom/config => config}/vocabularies/EN/reject.txt | 0 4 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 config/actions/RemoveDuplicateWords.tengo rename {styles/custom/config => config}/vocabularies/EN/accept.txt (100%) rename {styles/custom/config => config}/vocabularies/EN/reject.txt (100%) diff --git a/.vale.ini b/.vale.ini index cee01243955..de6ce77b0d3 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,7 @@ StylesPath = styles MinAlertLevel = warning +Vocab = EN + [*.md] BasedOnStyles = custom, Vale diff --git a/config/actions/RemoveDuplicateWords.tengo b/config/actions/RemoveDuplicateWords.tengo deleted file mode 100644 index e6a0442fa0f..00000000000 --- a/config/actions/RemoveDuplicateWords.tengo +++ /dev/null @@ -1,7 +0,0 @@ -text := import("text") - -// Match is provided by Vale and represents the rule's matched text. -deduped := text.re_replace(`\b(\w+)\s+\1\b`, match, `$1`) - -// Suggestions is required by Vale and represents the script's output. -suggestions := [deduped] diff --git a/styles/custom/config/vocabularies/EN/accept.txt b/config/vocabularies/EN/accept.txt similarity index 100% rename from styles/custom/config/vocabularies/EN/accept.txt rename to config/vocabularies/EN/accept.txt diff --git a/styles/custom/config/vocabularies/EN/reject.txt b/config/vocabularies/EN/reject.txt similarity index 100% rename from styles/custom/config/vocabularies/EN/reject.txt rename to config/vocabularies/EN/reject.txt From 3bb7eef7b9be570ef705b87d130f60f3eb806d87 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:53:42 +0100 Subject: [PATCH 364/526] dd --- .github/workflows/vale.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8688a91d9ac..2741fb86b9b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: 0 # Ensure the full history is fetched - name: Set up Vale uses: errata-ai/vale-action@reviewdog @@ -23,11 +23,20 @@ jobs: - name: Get changed files id: changed-files run: | - CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep '\.md\|\.txt\|\.rst' | tr '\n' ' ') + git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + - name: Debug CHANGED_FILES + run: | + echo "Changed files: ${{ env.CHANGED_FILES }}" + - name: Run Vale with Reviewdog run: | - for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee - done + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No changed files to lint." + else + for file in ${{ env.CHANGED_FILES }}; do + /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + done + fi From 09a9a8963ad6e38254b553d01415030c8562e83b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 12:58:49 +0100 Subject: [PATCH 365/526] add --- .github/workflows/vale.yml | 2 ++ {config => styles/config}/vocabularies/EN/accept.txt | 0 {config => styles/config}/vocabularies/EN/reject.txt | 0 3 files changed, 2 insertions(+) rename {config => styles/config}/vocabularies/EN/accept.txt (100%) rename {config => styles/config}/vocabularies/EN/reject.txt (100%) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2741fb86b9b..25300458bd9 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -19,6 +19,8 @@ jobs: uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + reporter: github-pr-check + token: ${{ secrets.VALE_GITHUB_TOKEN }} - name: Get changed files id: changed-files diff --git a/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt similarity index 100% rename from config/vocabularies/EN/accept.txt rename to styles/config/vocabularies/EN/accept.txt diff --git a/config/vocabularies/EN/reject.txt b/styles/config/vocabularies/EN/reject.txt similarity index 100% rename from config/vocabularies/EN/reject.txt rename to styles/config/vocabularies/EN/reject.txt From d43186113a6a30abe96c7b04e94be55dc0b529de Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:00:45 +0100 Subject: [PATCH 366/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 25300458bd9..5bc56cbd085 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -19,7 +19,6 @@ jobs: uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - reporter: github-pr-check token: ${{ secrets.VALE_GITHUB_TOKEN }} - name: Get changed files From 52777d287188048aed9d0cb27a9ae8e4f82494bf Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:04:12 +0100 Subject: [PATCH 367/526] add --- .github/workflows/vale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5bc56cbd085..2cac844be78 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint +name: Vale lint checker on: pull_request: @@ -15,7 +15,7 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched - - name: Set up Vale + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -32,12 +32,12 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with Reviewdog + - name: Run Vale with reviewdog run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + done fi From 152a47158f8200daa539a8a8b3f639ab20a354e9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:04:42 +0100 Subject: [PATCH 368/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index de6ce77b0d3..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,4 +4,4 @@ MinAlertLevel = warning Vocab = EN [*.md] -BasedOnStyles = custom, Vale +BasedOnStyles = custom From 809b87d0a8ee359af89f071445825d09dadd1687 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:11:13 +0100 Subject: [PATCH 369/526] add --- .github/workflows/vale.yml | 2 +- styles/config/vocabularies/EN/accept.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 2cac844be78..7c939323f45 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -38,6 +38,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done fi diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt index f4549b7866b..34027668bd2 100644 --- a/styles/config/vocabularies/EN/accept.txt +++ b/styles/config/vocabularies/EN/accept.txt @@ -7,4 +7,17 @@ dbt-tonic dbtonic IDE CLI +Config +config +configs +info +docs +doc +yaml +YAML +SQL +sql +bash +shell +MetricFlow From 61ef5acbefd747f83d50a41f4d977ebde08e525f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:13:04 +0100 Subject: [PATCH 370/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7c939323f45..b3a8977fa75 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,6 +20,7 @@ jobs: with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} + version: 2.17.0 - name: Get changed files id: changed-files @@ -38,6 +39,5 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 8b3f1accf417ce4684822614938e161cc895b635 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:14:06 +0100 Subject: [PATCH 371/526] add --- styles/config/vocabularies/EN/accept.txt | 7 +++++++ styles/config/vocabularies/EN/reject.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt index 34027668bd2..9cf64852218 100644 --- a/styles/config/vocabularies/EN/accept.txt +++ b/styles/config/vocabularies/EN/accept.txt @@ -20,4 +20,11 @@ sql bash shell MetricFlow +jinja +jinja2 +sqlmesh +Snowflake +dbt Mesh +dbt mesh +mesh diff --git a/styles/config/vocabularies/EN/reject.txt b/styles/config/vocabularies/EN/reject.txt index 5c45f52bad4..bc8d1020ec2 100644 --- a/styles/config/vocabularies/EN/reject.txt +++ b/styles/config/vocabularies/EN/reject.txt @@ -5,3 +5,4 @@ DBT Explorer DBT DBT-tonic DBTonic +DBT Mesh From 21a0dda38757c1c098e57fdf801bec86dc8a818c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:20:35 +0100 Subject: [PATCH 372/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b3a8977fa75..847085eb621 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} version: 2.17.0 + reporter: github-pr-check - name: Get changed files id: changed-files @@ -39,5 +40,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 4572707a51b0a8d9dfbe540d628562e88c825fd9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:23:32 +0100 Subject: [PATCH 373/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 847085eb621..b101c5ca8d4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -40,6 +40,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee || true done fi From 6858ae50f7dc93f2d581ead2a93856610b6ddf12 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:24:18 +0100 Subject: [PATCH 374/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b101c5ca8d4..c6310e82a62 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -40,6 +40,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee || true + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee || true done fi From fea73f6d60161b000dcbf36ab0ce01e0c0a5028d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:29:05 +0100 Subject: [PATCH 375/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c6310e82a62..eb1c384982b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,6 @@ jobs: with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} - version: 2.17.0 reporter: github-pr-check - name: Get changed files From f1f89129114ef9bf08740d1ea99111b12e0a44b6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:30:11 +0100 Subject: [PATCH 376/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index eb1c384982b..9b64dbfc3f3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,6 +39,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee || true + /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee || true done fi From 45fb6c374d387abb4a29bf92df08f2489a59ad17 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:39:33 +0100 Subject: [PATCH 377/526] add --- .github/workflows/vale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9b64dbfc3f3..874e4882a1f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,9 +18,9 @@ jobs: - name: Set up vale uses: errata-ai/vale-action@reviewdog with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} - reporter: github-pr-check + version: 2.17.0 - name: Get changed files id: changed-files @@ -39,6 +39,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - /home/runner/vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee || true + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done fi From fe73787d9704c185faa90add99f42dcff4c507c9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:39:55 +0100 Subject: [PATCH 378/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 874e4882a1f..c6a59eb644b 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,6 +39,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee -annotate done fi From e34a9a58abe800d220e95633ff3335804b9b2afe Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:44:16 +0100 Subject: [PATCH 379/526] add --- .github/workflows/vale.yml | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c6a59eb644b..cf7beadda21 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,6 +39,48 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee -annotate + ```yaml +name: Vale lint checker + +on: + pull_request: + branches: + - '**' + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Ensure the full history is fetched + + - name: Set up vale + uses: errata-ai/vale-action@reviewdog + with: + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + token: ${{ secrets.VALE_GITHUB_TOKEN }} + version: 2.17.0 + + - name: Get changed files + id: changed-files + run: | + git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + + - name: Debug CHANGED_FILES + run: | + echo "Changed files: ${{ env.CHANGED_FILES }}" + + - name: Run Vale with reviewdog + run: | + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No changed files to lint." + else + for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee -efm="%f:%l:%c: %m %traw_output:%m" done fi From 4c67db2a029739e22b6ad852b0de40dce0053ddb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:45:30 +0100 Subject: [PATCH 380/526] add --- .github/workflows/vale.yml | 42 -------------------------------------- 1 file changed, 42 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cf7beadda21..b23cf0a53ca 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -33,48 +33,6 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with reviewdog - run: | - if [ -z "${{ env.CHANGED_FILES }}" ]; then - echo "No changed files to lint." - else - for file in ${{ env.CHANGED_FILES }}; do - ```yaml -name: Vale lint checker - -on: - pull_request: - branches: - - '**' - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Ensure the full history is fetched - - - name: Set up vale - uses: errata-ai/vale-action@reviewdog - with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} - version: 2.17.0 - - - name: Get changed files - id: changed-files - run: | - git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - - name: Debug CHANGED_FILES - run: | - echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with reviewdog run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then From c92dda5b313012b057630d7c990a38d7fa50e95b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:49:20 +0100 Subject: [PATCH 381/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b23cf0a53ca..d0e10a788da 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,6 +39,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee -efm="%f:%l:%c: %m %traw_output:%m" + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From b630a6bc6d037bd88b5b66018d6570b05ebea1d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:52:53 +0100 Subject: [PATCH 382/526] add --- .github/workflows/vale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d0e10a788da..b878d460038 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} version: 2.17.0 + reporter: github-pr-check - name: Get changed files id: changed-files @@ -39,6 +40,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 13e6a6a9acb6169d8b6b4fc5fc0265e3bb29b3a3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 13:58:25 +0100 Subject: [PATCH 383/526] add --- .github/workflows/vale.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b878d460038..420c62c859a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -34,7 +34,10 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with reviewdog + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run vale with reviewdog run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." From 0017276d8ac81c85c010cb678ee44a532d16b0a0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:01:54 +0100 Subject: [PATCH 384/526] add --- .github/workflows/vale.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 420c62c859a..49848584d3d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,6 @@ jobs: with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} - version: 2.17.0 reporter: github-pr-check - name: Get changed files From 6724969cf9667af9e637d99d15a740e30a10fd43 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:18:22 +0100 Subject: [PATCH 385/526] add --- .github/workflows/vale.yml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 49848584d3d..e14f9992126 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,13 +15,6 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched - - name: Set up vale - uses: errata-ai/vale-action@reviewdog - with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} - reporter: github-pr-check - - name: Get changed files id: changed-files run: | @@ -33,15 +26,10 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run vale with reviewdog - run: | - if [ -z "${{ env.CHANGED_FILES }}" ]; then - echo "No changed files to lint." - else - for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee - done - fi + - name: Run Vale with Reviewdog + if: env.CHANGED_FILES != '' + uses: errata-ai/vale-action@reviewdog + with: + files: ${{ env.CHANGED_FILES }} + token: ${{ secrets.VALE_GITHUB_TOKEN }} + reporter: github-pr-check From 4f17617c04f6c8153dbb08b3b5bb2ea1aa2104b7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:22:00 +0100 Subject: [PATCH 386/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e14f9992126..7fe3daadb26 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -30,6 +30,6 @@ jobs: if: env.CHANGED_FILES != '' uses: errata-ai/vale-action@reviewdog with: - files: ${{ env.CHANGED_FILES }} + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check From 4c9aae9f903312e37476b11aa0fcc6b430ef92c4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:23:43 +0100 Subject: [PATCH 387/526] add --- .github/workflows/vale.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7fe3daadb26..5cbdb156ddb 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,16 +20,19 @@ jobs: run: | git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') + CHANGED_FILES_JSON=$(echo $CHANGED_FILES | jq -R -s -c 'split(" ")') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES_JSON=$CHANGED_FILES_JSON" >> $GITHUB_ENV - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" + echo "Changed files JSON: ${{ env.CHANGED_FILES_JSON }}" - name: Run Vale with Reviewdog if: env.CHANGED_FILES != '' uses: errata-ai/vale-action@reviewdog with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' + files: ${{ env.CHANGED_FILES }} token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check From 4f0041ca15da9e5c96be66809493d0c5457c2a5d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:28:34 +0100 Subject: [PATCH 388/526] add --- .github/workflows/vale.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 5cbdb156ddb..49848584d3d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,24 +15,33 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched + - name: Set up vale + uses: errata-ai/vale-action@reviewdog + with: + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' + token: ${{ secrets.VALE_GITHUB_TOKEN }} + reporter: github-pr-check + - name: Get changed files id: changed-files run: | git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') - CHANGED_FILES_JSON=$(echo $CHANGED_FILES | jq -R -s -c 'split(" ")') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "CHANGED_FILES_JSON=$CHANGED_FILES_JSON" >> $GITHUB_ENV - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - echo "Changed files JSON: ${{ env.CHANGED_FILES_JSON }}" - - name: Run Vale with Reviewdog - if: env.CHANGED_FILES != '' - uses: errata-ai/vale-action@reviewdog - with: - files: ${{ env.CHANGED_FILES }} - token: ${{ secrets.VALE_GITHUB_TOKEN }} - reporter: github-pr-check + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run vale with reviewdog + run: | + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No changed files to lint." + else + for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + done + fi From bb12cef44de37b1c102cb157c9c966e98f7bf0ac Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 12 Jul 2024 14:32:51 +0100 Subject: [PATCH 389/526] add --- .github/workflows/vale.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 49848584d3d..339f1099437 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,6 +15,14 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched + - name: Cache Vale binary + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: From 123aa27e19fd0db5fde2bd79dfadd2cc6943750b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:10:35 +0100 Subject: [PATCH 390/526] add --- .github/workflows/vale.yml | 44 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 339f1099437..907e9f251b7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,39 +1,25 @@ -name: Vale lint checker +name: reviewdog -on: +on: pull_request: - branches: - - '**' jobs: - lint: + vale: + name: runner / vale runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Ensure the full history is fetched - - - name: Cache Vale binary - uses: actions/cache@v3 - with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- + - uses: actions/checkout@v3 - - name: Set up vale + - name: Set up Reviewdog with Vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check + token: ${{ secrets.VALE_GITHUB_TOKEN }} - name: Get changed files id: changed-files run: | - git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV @@ -41,15 +27,9 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run vale with reviewdog + - name: Run Vale with Reviewdog on Changed Files + if: env.CHANGED_FILES != '' run: | - if [ -z "${{ env.CHANGED_FILES }}" ]; then - echo "No changed files to lint." - else - for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee - done - fi + for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + done From f18b30a51fe0c8466cac202d2f90fc201ba6bbda Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:17:17 +0100 Subject: [PATCH 391/526] add --- .github/workflows/vale.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 907e9f251b7..9aa6899ba37 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,25 +1,39 @@ -name: reviewdog +name: Vale lint checker -on: +on: pull_request: + branches: + - '**' jobs: - vale: - name: runner / vale + lint: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Ensure the full history is fetched + + - name: Cache Vale binary + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- - - name: Set up Reviewdog with Vale + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - reporter: github-pr-check token: ${{ secrets.VALE_GITHUB_TOKEN }} + reporter: github-pr-check - name: Get changed files id: changed-files run: | + git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV @@ -27,8 +41,10 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with Reviewdog on Changed Files - if: env.CHANGED_FILES != '' + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run vale with reviewdog run: | for file in ${{ env.CHANGED_FILES }}; do vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee From b6a61914932a82ae09e6d7047351fb099896a8fa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:27:00 +0100 Subject: [PATCH 392/526] add --- .github/workflows/vale.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9aa6899ba37..cbed57fab7d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,6 +29,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check + debug: true - name: Get changed files id: changed-files @@ -44,8 +45,14 @@ jobs: - name: Set up Reviewdog uses: reviewdog/action-setup@v1 - - name: Run vale with reviewdog + - name: Run Vale with Reviewdog on Changed Files run: | - for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee - done + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No changed files to lint." + else + for file in ${{ env.CHANGED_FILES }}; do + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + done + fi + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} From 3de14d7b2336f22a0845dced23e0cbe3693a2d8b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:35:04 +0100 Subject: [PATCH 393/526] add --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cbed57fab7d..13eb2e89973 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -47,6 +47,7 @@ jobs: - name: Run Vale with Reviewdog on Changed Files run: | + export PATH=$PATH:/home/runner/vale # Ensure Vale is in the PATH if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else From 72e899aff9f43a92e7a1aa28de17484afc126320 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:41:05 +0100 Subject: [PATCH 394/526] add --- .github/workflows/vale.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 13eb2e89973..3667eb3148e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,19 +15,12 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched - - name: Cache Vale binary - uses: actions/cache@v3 - with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - - name: Set up vale uses: errata-ai/vale-action@reviewdog with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} + version: 2.17.0 reporter: github-pr-check debug: true @@ -42,18 +35,12 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - - name: Run Vale with Reviewdog on Changed Files + - name: Run Vale with reviewdog run: | - export PATH=$PATH:/home/runner/vale # Ensure Vale is in the PATH if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee done fi - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} From a86e3833340097e82d2b872db1d1dec28dd51eaf Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 22 Aug 2024 16:51:53 +0100 Subject: [PATCH 395/526] add --- .github/workflows/vale.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 3667eb3148e..ce10f7858e8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -35,12 +35,16 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with reviewdog + - name: Run Vale with Reviewdog on Changed Files run: | + export PATH=$PATH:/home/runner/vale # Add Vale to the PATH if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | /home/runner/reviewdog -f=vale -name="vale" -reporter=github-pr-review -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + \ No newline at end of file From a3d538ad043503903cfdb3354f939f3b3522ecee Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:18:43 +0100 Subject: [PATCH 396/526] Update vale.yml --- .github/workflows/vale.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ce10f7858e8..339f1099437 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,14 +15,20 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched + - name: Cache Vale binary + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} - version: 2.17.0 reporter: github-pr-check - debug: true - name: Get changed files id: changed-files @@ -35,9 +41,11 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run Vale with Reviewdog on Changed Files + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + + - name: Run vale with reviewdog run: | - export PATH=$PATH:/home/runner/vale # Add Vale to the PATH if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else @@ -45,6 +53,3 @@ jobs: vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} - \ No newline at end of file From 859df6ebdbe19210386ae62bc3b2b0bea6787083 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:20:34 +0100 Subject: [PATCH 397/526] Update vale.yml --- .github/workflows/vale.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 339f1099437..49848584d3d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,14 +15,6 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched - - name: Cache Vale binary - uses: actions/cache@v3 - with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - - name: Set up vale uses: errata-ai/vale-action@reviewdog with: From c44ab4bdc3db42531de3c8eaa99726ee8aa2613c Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:38:24 +0100 Subject: [PATCH 398/526] Update vale.yml --- .github/workflows/vale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 49848584d3d..f135eb7217d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -19,7 +19,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} + token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} reporter: github-pr-check - name: Get changed files @@ -35,6 +35,8 @@ jobs: - name: Set up Reviewdog uses: reviewdog/action-setup@v1 + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run vale with reviewdog run: | From f8a7de2636d97a0adf99a7ba6f2c41786a610e7c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 11:33:28 +0100 Subject: [PATCH 399/526] update --- .github/workflows/vale.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f135eb7217d..339f1099437 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,11 +15,19 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched + - name: Cache Vale binary + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- + - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} + token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check - name: Get changed files @@ -35,8 +43,6 @@ jobs: - name: Set up Reviewdog uses: reviewdog/action-setup@v1 - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }} - name: Run vale with reviewdog run: | From 72347d5ec7f941c7a212c165045401772d913f85 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 13:40:24 +0100 Subject: [PATCH 400/526] add --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 339f1099437..ed329f43657 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,6 +29,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.VALE_GITHUB_TOKEN }} reporter: github-pr-check + version: 2.17.0 - name: Get changed files id: changed-files From 162f220e1784a3082b6ccd35a42a32f5b5cfa4b9 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:57:16 +0100 Subject: [PATCH 401/526] Update vale.yml --- .github/workflows/vale.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ed329f43657..24e52d67bea 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 # Ensure the full history is fetched @@ -20,14 +20,12 @@ jobs: with: path: ~/.vale key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} + token: ${{secrets.VALE_GITHUB_TOKEN}} reporter: github-pr-check version: 2.17.0 From f64c43ec58098558ed132bc24cc4e3581a5762d0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 15:09:13 +0100 Subject: [PATCH 402/526] add --- .github/workflows/vale.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ed329f43657..24fb4aa83e1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 # Ensure the full history is fetched @@ -20,14 +20,12 @@ jobs: with: path: ~/.vale key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} + token: ${{secrets.GITHUB_TOKEN}} reporter: github-pr-check version: 2.17.0 From 08b855f40c573ffb0394cf9ae54d651c6239a179 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 16:45:21 +0100 Subject: [PATCH 403/526] add --- .github/workflows/vale.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 24e52d67bea..951fc7ef121 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,20 +15,21 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched - - name: Cache Vale binary - uses: actions/cache@v3 - with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - - - name: Set up vale + - name: Set up Vale uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{secrets.VALE_GITHUB_TOKEN}} + token: ${{secrets.REVIEWDOG_GITHUB_API_TOKEN}} reporter: github-pr-check version: 2.17.0 + - name: Check if Vale is installed + run: | + if ! command -v vale &> /dev/null; then + echo "Vale is not installed." + exit 1 + fi + - name: Get changed files id: changed-files run: | @@ -40,9 +41,6 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - - name: Run vale with reviewdog run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then From cd9307ec18de6904a154ae608ea8475e85fd2371 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 16:53:08 +0100 Subject: [PATCH 404/526] add --- .github/workflows/vale.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 951fc7ef121..1421dcc4993 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -13,20 +13,36 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Ensure the full history is fetched + fetch-depth: 0 - - name: Set up Vale - uses: errata-ai/vale-action@reviewdog + - name: Set up Python + uses: actions/setup-python@v5.1.0 with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' - token: ${{secrets.REVIEWDOG_GITHUB_API_TOKEN}} - reporter: github-pr-check - version: 2.17.0 + python-version: '3.11' + + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Vale + run: pip install vale + + - name: Cache Vale + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- - name: Check if Vale is installed run: | if ! command -v vale &> /dev/null; then - echo "Vale is not installed." + echo "Vale is not installed correctly." exit 1 fi From c93122eee52a34d594eee27e708b9f4c4bdec9f0 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 17:01:54 +0100 Subject: [PATCH 405/526] add --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1421dcc4993..0747f05d3b4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -46,6 +46,11 @@ jobs: exit 1 fi + - name: Install Reviewdog + uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest + - name: Get changed files id: changed-files run: | From ecdc351ae1297cdd02a4e58cf02479bc3efc47fb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 17:07:17 +0100 Subject: [PATCH 406/526] add --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0747f05d3b4..68e66f1765f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -63,6 +63,8 @@ jobs: echo "Changed files: ${{ env.CHANGED_FILES }}" - name: Run vale with reviewdog + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." From 8f20eca734ef27d55ca1815ede6b8d0be6c92b06 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 10 Sep 2024 17:19:15 +0100 Subject: [PATCH 407/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 68e66f1765f..c2a851ef81f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -70,6 +70,6 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=checkstyle "$file" | reviewdog -f=checkstyle -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From bbe8bf0543759116f70e7735e3387d9578902cb4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 16:49:36 +0100 Subject: [PATCH 408/526] add --- .github/workflows/vale.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c2a851ef81f..9280c4abb05 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,22 +15,6 @@ jobs: with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5.1.0 - with: - python-version: '3.11' - - - name: Cache Python dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install Vale - run: pip install vale - - name: Cache Vale uses: actions/cache@v3 with: @@ -39,6 +23,12 @@ jobs: restore-keys: | ${{ runner.os }}-vale- + - name: Download Vale + run: | + curl -L https://github.com/errata-ai/vale/releases/download/v3.7.1/vale_3.7.1_Linux_64-bit.tar.gz --output vale.tar.gz + tar -xzf vale.tar.gz + sudo mv ./vale /usr/local/bin/ + - name: Check if Vale is installed run: | if ! command -v vale &> /dev/null; then From e053cd3da960938ea8220955db87537f6554119f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:03:01 +0100 Subject: [PATCH 409/526] add --- .vale.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index 58aff923afe..5b70859f224 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning -Vocab = EN +Vocab = config/vocabularies/EN [*.md] -BasedOnStyles = custom +BasedOnStyles = custom, vocabularies/EN From 94df9e2a6aa4aed3b357fdd6dd3ffb0e1600e917 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:08:44 +0100 Subject: [PATCH 410/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 5b70859f224..edcccdbd852 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,4 +4,4 @@ MinAlertLevel = warning Vocab = config/vocabularies/EN [*.md] -BasedOnStyles = custom, vocabularies/EN +BasedOnStyles = custom From 5b9123db039ed7af4da3eaef171116543a7ed38e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:10:44 +0100 Subject: [PATCH 411/526] Add --- .vale.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index edcccdbd852..448eaf2ad11 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning -Vocab = config/vocabularies/EN +Vocab = vocabularies/EN [*.md] -BasedOnStyles = custom +BasedOnStyles = custom, vocabularies/EN From 06ef5b74cd88bcd14cc84772274ce95752d4c902 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:13:08 +0100 Subject: [PATCH 412/526] add --- .vale.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index 448eaf2ad11..25890c4c2dd 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning -Vocab = vocabularies/EN +Vocab = EN [*.md] -BasedOnStyles = custom, vocabularies/EN +BasedOnStyles = custom, EN From e97ecd9cdd950f93f330e9228f29fd97432a52d7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:18:04 +0100 Subject: [PATCH 413/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 25890c4c2dd..a5caa012505 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,4 +4,4 @@ MinAlertLevel = warning Vocab = EN [*.md] -BasedOnStyles = custom, EN +BasedOnStyles = custom, styles From 5d0050c9c5c0aff1a7ba80982d9c2af177374fc6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:21:14 +0100 Subject: [PATCH 414/526] add --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index a5caa012505..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -4,4 +4,4 @@ MinAlertLevel = warning Vocab = EN [*.md] -BasedOnStyles = custom, styles +BasedOnStyles = custom From 3badf8d20ee9dbb37d4e86e66973d10dbea4af66 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:31:48 +0100 Subject: [PATCH 415/526] add --- .github/workflows/vale.yml | 42 ++++++++++++-------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9280c4abb05..83d25d4256a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,35 +11,16 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: 0 # Ensure the full history is fetched - - name: Cache Vale - uses: actions/cache@v3 + - name: Set up vale + uses: errata-ai/vale-action@reviewdog with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - - - name: Download Vale - run: | - curl -L https://github.com/errata-ai/vale/releases/download/v3.7.1/vale_3.7.1_Linux_64-bit.tar.gz --output vale.tar.gz - tar -xzf vale.tar.gz - sudo mv ./vale /usr/local/bin/ - - - name: Check if Vale is installed - run: | - if ! command -v vale &> /dev/null; then - echo "Vale is not installed correctly." - exit 1 - fi - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 - with: - reviewdog_version: latest + files: '["docs/docs", "docs/reference", "docs/guides", "docs/best-practices"]' + token: ${{ secrets.VALE_GITHUB_TOKEN }} + reporter: github-pr-check - name: Get changed files id: changed-files @@ -52,14 +33,17 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run vale with reviewdog + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALE_GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} + + - name: Run vale with reviewdog run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=checkstyle "$file" | reviewdog -f=checkstyle -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 78e61dbade200c1bb8432b41830da50e5e1e1b9b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:38:59 +0100 Subject: [PATCH 416/526] add --- .github/workflows/vale.yml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 83d25d4256a..9dcfca61f01 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,17 +11,37 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: - fetch-depth: 0 # Ensure the full history is fetched + fetch-depth: 0 + + - name: Cache Vale + uses: actions/cache@v3 + with: + path: ~/.vale + key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} + restore-keys: | + ${{ runner.os }}-vale- - name: Set up vale uses: errata-ai/vale-action@reviewdog with: files: '["docs/docs", "docs/reference", "docs/guides", "docs/best-practices"]' - token: ${{ secrets.VALE_GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check + - name: Check if Vale is installed + run: | + if ! command -v vale &> /dev/null; then + echo "Vale is not installed correctly." + exit 1 + fi + + - name: Install Reviewdog + uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest + - name: Get changed files id: changed-files run: | @@ -33,17 +53,14 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - env: - VALE_GITHUB_TOKEN: ${{ secrets.VALE_GITHUB_TOKEN }} - - name: Run vale with reviewdog + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=checkstyle "$file" | reviewdog -f=checkstyle -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 215912f890e942f3366ae90349b36e7b99810d09 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:41:54 +0100 Subject: [PATCH 417/526] add --- .github/workflows/vale.yml | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9dcfca61f01..b60c036b635 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,56 +11,34 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Cache Vale - uses: actions/cache@v3 - with: - path: ~/.vale - key: ${{ runner.os }}-vale-${{ hashFiles('**/.vale.ini') }} - restore-keys: | - ${{ runner.os }}-vale- - - - name: Set up vale + - name: Set up Vale and Reviewdog uses: errata-ai/vale-action@reviewdog with: - files: '["docs/docs", "docs/reference", "docs/guides", "docs/best-practices"]' + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - - name: Check if Vale is installed - run: | - if ! command -v vale &> /dev/null; then - echo "Vale is not installed correctly." - exit 1 - fi - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 - with: - reviewdog_version: latest - - name: Get changed files id: changed-files run: | git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ' | xargs) echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Run vale with reviewdog - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run Vale on changed files run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale --output=checkstyle "$file" | reviewdog -f=checkstyle -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee + vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi From 29fd79f38e1c9a1f0000f1d3df4684cfc167a437 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:46:17 +0100 Subject: [PATCH 418/526] add --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b60c036b635..000937bf4e1 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Vale and Reviewdog uses: errata-ai/vale-action@reviewdog with: - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides"]' + files: '["docs/docs", "docs/reference", "docs/guides", "docs/best-practices"]' token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check From 5422da43f4cd6d665923ce6610f0ba5f09f793f7 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:52:26 +0100 Subject: [PATCH 419/526] add --- .github/workflows/vale.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 000937bf4e1..8a550cff2dd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,16 +11,22 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Vale and Reviewdog - uses: errata-ai/vale-action@reviewdog - with: - files: '["docs/docs", "docs/reference", "docs/guides", "docs/best-practices"]' - token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check + - name: Install Vale + run: | + curl -L https://github.com/errata-ai/vale/releases/download/v2.28.0/vale_2.28.0_Linux_64-bit.tar.gz -o vale.tar.gz + tar -xvzf vale.tar.gz + sudo mv vale /usr/local/bin/ + + - name: Check if Vale is installed + run: | + if ! command -v vale &> /dev/null; then + echo "Vale is not installed correctly." + exit 1 + fi - name: Get changed files id: changed-files @@ -34,6 +40,8 @@ jobs: echo "Changed files: ${{ env.CHANGED_FILES }}" - name: Run Vale on changed files + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No changed files to lint." From 27cb655d6b3293e6f360b47aef4ea10bb42f0e91 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 11 Sep 2024 17:58:55 +0100 Subject: [PATCH 420/526] add --- .github/workflows/vale.yml | 5 +++++ .vale.ini | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8a550cff2dd..439d13bc554 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -28,6 +28,11 @@ jobs: exit 1 fi + - name: Install Reviewdog + uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest + - name: Get changed files id: changed-files run: | diff --git a/.vale.ini b/.vale.ini index 58aff923afe..edcccdbd852 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning -Vocab = EN +Vocab = config/vocabularies/EN [*.md] BasedOnStyles = custom From d460304ed83ab9899d03270de45840c515ce241d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 14:49:25 +0100 Subject: [PATCH 421/526] update --- .github/workflows/vale.yml | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 439d13bc554..e32615e90de 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,47 +11,24 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Install Vale - run: | - curl -L https://github.com/errata-ai/vale/releases/download/v2.28.0/vale_2.28.0_Linux_64-bit.tar.gz -o vale.tar.gz - tar -xvzf vale.tar.gz - sudo mv vale /usr/local/bin/ - - - name: Check if Vale is installed - run: | - if ! command -v vale &> /dev/null; then - echo "Vale is not installed correctly." - exit 1 - fi - - - name: Install Reviewdog - uses: reviewdog/action-setup@v1 + - name: Set up Vale + uses: errata-ai/vale-action@reviewdog with: - reviewdog_version: latest + files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' + token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub's built-in token + version: 2.17.0 - name: Get changed files id: changed-files run: | git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ' | xargs) + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - - name: Run Vale on changed files - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - if [ -z "${{ env.CHANGED_FILES }}" ]; then - echo "No changed files to lint." - else - for file in ${{ env.CHANGED_FILES }}; do - vale --output=JSON "$file" | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee - done - fi From e0422eb003487447266d60fcabcdff09f61fd96f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 14:52:07 +0100 Subject: [PATCH 422/526] update --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e32615e90de..a8f3f552b7c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub's built-in token version: 2.17.0 + reporter: github-pr-check - name: Get changed files id: changed-files From 7a96d03a965a5c5fa62977e296028f0345299988 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 15:15:32 +0100 Subject: [PATCH 423/526] update --- .github/workflows/vale.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index a8f3f552b7c..33db1dc09e5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -19,9 +19,11 @@ jobs: uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub's built-in token + token: ${{ secrets.GITHUB_TOKEN }} version: 2.17.0 - reporter: github-pr-check + + - name: Set $HOME environment variable + run: echo "HOME=/home/runner" >> $GITHUB_ENV - name: Get changed files id: changed-files From eb35a7b6d442d04e594b28c59f59714980cf76fa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 15:46:57 +0100 Subject: [PATCH 424/526] upate --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 33db1dc09e5..cae2e4d81f0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -22,8 +22,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} version: 2.17.0 - - name: Set $HOME environment variable - run: echo "HOME=/home/runner" >> $GITHUB_ENV + - name: Set VALE_CONFIG_PATH + run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - name: Get changed files id: changed-files From 64ed73dd9a63c3fce46d83764270f13591ac8477 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 15:47:49 +0100 Subject: [PATCH 425/526] add pr check --- .github/workflows/vale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cae2e4d81f0..449a7bd85a7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,6 +21,7 @@ jobs: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' token: ${{ secrets.GITHUB_TOKEN }} version: 2.17.0 + reporter: github-pr-check - name: Set VALE_CONFIG_PATH run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV From 1b470db4e8c9f08035f96bcad286346fbb1c00fb Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 15:54:26 +0100 Subject: [PATCH 426/526] update --- .github/workflows/vale.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 449a7bd85a7..1ff82974ce5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -36,3 +36,14 @@ jobs: - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" + + - name: Run Vale with reviewdog + run: | + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No changed files to lint." + else + for file in ${{ env.CHANGED_FILES }}; do + vale "$file" || true # Log Vale output + done + fi + \ No newline at end of file From 0ba9c8923582fcde8150ab318a76a4283d0e9677 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 16:05:19 +0100 Subject: [PATCH 427/526] udpate --- .github/workflows/vale.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 1ff82974ce5..0625ed944b2 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,6 +15,11 @@ jobs: with: fetch-depth: 0 + - name: Set environment variables + run: | + echo "HOME=/home/runner" >> $GITHUB_ENV + echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV + - name: Set up Vale uses: errata-ai/vale-action@reviewdog with: @@ -23,9 +28,6 @@ jobs: version: 2.17.0 reporter: github-pr-check - - name: Set VALE_CONFIG_PATH - run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - - name: Get changed files id: changed-files run: | From 8fd371ea60e0921d2c66541c72d57271675c55ae Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 16:13:54 +0100 Subject: [PATCH 428/526] update --- .github/workflows/vale.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0625ed944b2..bf6d63a9e8c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -38,6 +38,11 @@ jobs: - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" + + - name: Set up Reviewdog + uses: reviewdog/action-setup@v1 + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run Vale with reviewdog run: | @@ -45,7 +50,7 @@ jobs: echo "No changed files to lint." else for file in ${{ env.CHANGED_FILES }}; do - vale "$file" || true # Log Vale output + vale "$file" --output=JSON | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee done fi \ No newline at end of file From af81e6624e9fed295576f55a689e45cf98087fb6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 16:28:46 +0100 Subject: [PATCH 429/526] update --- .github/workflows/vale.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index bf6d63a9e8c..d7a0a54b77d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -39,10 +39,9 @@ jobs: run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - name: Set up Reviewdog - uses: reviewdog/action-setup@v1 - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set REVIEWDOG_GITHUB_API_TOKEN + run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: Run Vale with reviewdog run: | From 167ecb57c0313c4114fa396fdced021a85887d5c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 16:32:30 +0100 Subject: [PATCH 430/526] update --- .github/workflows/vale.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d7a0a54b77d..94bc1d17ee7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -20,7 +20,7 @@ jobs: echo "HOME=/home/runner" >> $GITHUB_ENV echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - - name: Set up Vale + - name: Set up Vale with Reviewdog uses: errata-ai/vale-action@reviewdog with: files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' @@ -38,18 +38,3 @@ jobs: - name: Debug CHANGED_FILES run: | echo "Changed files: ${{ env.CHANGED_FILES }}" - - - name: Set REVIEWDOG_GITHUB_API_TOKEN - run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - - - name: Run Vale with reviewdog - run: | - if [ -z "${{ env.CHANGED_FILES }}" ]; then - echo "No changed files to lint." - else - for file in ${{ env.CHANGED_FILES }}; do - vale "$file" --output=JSON | reviewdog -f=vale -name="vale" -reporter=github-pr-check -level=warning -filter-mode=added -fail-on-error=true -tee - done - fi - \ No newline at end of file From c87b9d84a63f2320666f0e4ad8ea0eb29260e60d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 16:42:41 +0100 Subject: [PATCH 431/526] update --- .github/workflows/vale.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 94bc1d17ee7..491035a9d1f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,10 +15,14 @@ jobs: with: fetch-depth: 0 - - name: Set environment variables + - name: Install Vale run: | - echo "HOME=/home/runner" >> $GITHUB_ENV - echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV + curl -L https://github.com/errata-ai/vale/releases/download/v2.17.0/vale_2.17.0_Linux_64-bit.tar.gz -o vale.tar.gz + tar -xvzf vale.tar.gz + sudo mv vale /usr/local/bin/ + + - name: Set VALE_CONFIG_PATH + run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - name: Set up Vale with Reviewdog uses: errata-ai/vale-action@reviewdog From ab9f83071cdd844d0b9d68c6888afaa0597dd169 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 10:10:05 +0100 Subject: [PATCH 432/526] update --- .github/workflows/vale.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 491035a9d1f..e64a1f237bd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,8 +21,10 @@ jobs: tar -xvzf vale.tar.gz sudo mv vale /usr/local/bin/ - - name: Set VALE_CONFIG_PATH - run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV + - name: Set environment variables + run: | + echo "HOME=/home/runner" >> $GITHUB_ENV + echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - name: Set up Vale with Reviewdog uses: errata-ai/vale-action@reviewdog @@ -31,6 +33,9 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} version: 2.17.0 reporter: github-pr-check + env: + HOME: /home/runner + VALE_CONFIG_PATH: $(pwd)/.vale.ini - name: Get changed files id: changed-files From d74553de06be587649c0f0853795edcb066d5091 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 14:48:44 +0100 Subject: [PATCH 433/526] udpate --- .github/workflows/vale.yml | 46 ++++++++++++++------------------------ 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e64a1f237bd..429f8b4292c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale lint checker +name: Vale Lint Checker on: pull_request: @@ -11,39 +11,27 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install Vale - run: | - curl -L https://github.com/errata-ai/vale/releases/download/v2.17.0/vale_2.17.0_Linux_64-bit.tar.gz -o vale.tar.gz - tar -xvzf vale.tar.gz - sudo mv vale /usr/local/bin/ + - name: Set VALE_CONFIG_PATH + run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - - name: Set environment variables + - name: Get Changed Files + id: changed-files run: | - echo "HOME=/home/runner" >> $GITHUB_ENV - echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - - - name: Set up Vale with Reviewdog - uses: errata-ai/vale-action@reviewdog + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst') + echo "changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT + echo "Changed files:" + echo "${CHANGED_FILES}" + + - name: Run Vale with Reviewdog + if: steps.changed-files.outputs.changed_files != '' + uses: reviewdog/action-vale@v1 with: - files: '["website/docs/docs", "website/docs/reference","website/docs/guides"]' - token: ${{ secrets.GITHUB_TOKEN }} - version: 2.17.0 + github_token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check + args: '${{ steps.changed-files.outputs.changed_files }}' env: - HOME: /home/runner - VALE_CONFIG_PATH: $(pwd)/.vale.ini - - - name: Get changed files - id: changed-files - run: | - git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst' | tr '\n' ' ') - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - - - name: Debug CHANGED_FILES - run: | - echo "Changed files: ${{ env.CHANGED_FILES }}" + VALE_CONFIG_PATH: ${{ env.VALE_CONFIG_PATH }} From a42b11cafa217b2592d0ab3029c59c867d563d1e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 14:50:35 +0100 Subject: [PATCH 434/526] udpate --- .github/workflows/vale.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 429f8b4292c..b20a390edd0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Lint Checker +name: Vale lint checker on: pull_request: @@ -15,23 +15,20 @@ jobs: with: fetch-depth: 0 - - name: Set VALE_CONFIG_PATH - run: echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - - - name: Get Changed Files - id: changed-files + - name: Set environment variables run: | - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- '*.md' '*.txt' '*.rst') - echo "changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT - echo "Changed files:" - echo "${CHANGED_FILES}" + echo "HOME=/home/runner" >> $GITHUB_ENV + echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV - name: Run Vale with Reviewdog - if: steps.changed-files.outputs.changed_files != '' - uses: reviewdog/action-vale@v1 + uses: errata-ai/vale-action@reviewdog with: - github_token: ${{ secrets.GITHUB_TOKEN }} + files: '**/*.md' + token: ${{ secrets.GITHUB_TOKEN }} + version: '2.17.0' reporter: github-pr-check - args: '${{ steps.changed-files.outputs.changed_files }}' + level: error + filter_mode: diff_context env: - VALE_CONFIG_PATH: ${{ env.VALE_CONFIG_PATH }} + HOME: /home/runner + VALE_CONFIG_PATH: $(pwd)/.vale.ini From 68f1e4213d053ae201d2abc2fa7de6116c62801d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 14:57:08 +0100 Subject: [PATCH 435/526] add --- .github/workflows/vale.yml | 41 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index b20a390edd0..36652903ca3 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -12,23 +12,36 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set environment variables + - name: Install Vale + run: | + curl -L https://github.com/errata-ai/vale/releases/download/v2.17.0/vale_2.17.0_Linux_64-bit.tar.gz -o vale.tar.gz + tar -xvzf vale.tar.gz + sudo mv vale /usr/local/bin/ + + - name: Get changed files + id: changed-files + run: | + git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} + CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- 'website/docs/docs/**/*.md' 'website/docs/reference/**/*.md' 'website/docs/guides/**/*.md') + echo "changed_files=$(echo $CHANGED_FILES)" >> $GITHUB_OUTPUT + echo "Changed files: $CHANGED_FILES" + + - name: Run Vale Lint + if: steps.changed-files.outputs.changed_files != '' run: | - echo "HOME=/home/runner" >> $GITHUB_ENV - echo "VALE_CONFIG_PATH=$(pwd)/.vale.ini" >> $GITHUB_ENV + echo "${{ steps.changed-files.outputs.changed_files }}" | xargs vale --output=JSON > vale_report.json + env: + VALE_CONFIG_PATH: $(pwd)/.vale.ini - - name: Run Vale with Reviewdog - uses: errata-ai/vale-action@reviewdog + - name: Run reviewdog + uses: reviewdog/reviewdog@v0.14.1 with: - files: '**/*.md' - token: ${{ secrets.GITHUB_TOKEN }} - version: '2.17.0' + name: vale reporter: github-pr-check - level: error - filter_mode: diff_context + fail_on_error: true + filter_mode: added + format: vale + github_token: ${{ secrets.GITHUB_TOKEN }} env: - HOME: /home/runner - VALE_CONFIG_PATH: $(pwd)/.vale.ini + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2bfafa228f3dcff480d4885bba7528fba6ed4fe1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 15:42:50 +0100 Subject: [PATCH 436/526] update --- .github/workflows/vale.yml | 59 ++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 36652903ca3..9c714277297 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,47 +1,44 @@ -name: Vale lint checker +name: Vale Linting on: pull_request: - branches: - - '**' + types: [opened, synchronize, reopened] jobs: lint: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v3 - - name: Install Vale - run: | - curl -L https://github.com/errata-ai/vale/releases/download/v2.17.0/vale_2.17.0_Linux_64-bit.tar.gz -o vale.tar.gz - tar -xvzf vale.tar.gz - sudo mv vale /usr/local/bin/ - - name: Get changed files id: changed-files - run: | - git fetch origin ${{ github.base_ref }} ${{ github.head_ref }} - CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- 'website/docs/docs/**/*.md' 'website/docs/reference/**/*.md' 'website/docs/guides/**/*.md') - echo "changed_files=$(echo $CHANGED_FILES)" >> $GITHUB_OUTPUT - echo "Changed files: $CHANGED_FILES" + uses: tj-actions/changed-files@v34 + with: + files: | + **/*.md + **/*.txt + **/*.rst - - name: Run Vale Lint - if: steps.changed-files.outputs.changed_files != '' + - name: Install Vale run: | - echo "${{ steps.changed-files.outputs.changed_files }}" | xargs vale --output=JSON > vale_report.json - env: - VALE_CONFIG_PATH: $(pwd)/.vale.ini + curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + vale sync - - name: Run reviewdog - uses: reviewdog/reviewdog@v0.14.1 - with: - name: vale - reporter: github-pr-check - fail_on_error: true - filter_mode: added - format: vale - github_token: ${{ secrets.GITHUB_TOKEN }} - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run Vale on changed files + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Changed files:" + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + # Convert the comma-separated list to space-separated + files=$(echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | tr ',' ' ') + # Ensure files exist (they might have been deleted) + existing_files=$(echo "$files" | xargs ls 2>/dev/null || true) + if [ -n "$existing_files" ]; then + echo "Running Vale on the following files:" + echo "$existing_files" + vale $existing_files + else + echo "No files to lint." + fi From 29c472b065dcbd5840679e534592ea96a50a098e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 15:54:56 +0100 Subject: [PATCH 437/526] update --- .github/workflows/vale.yml | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9c714277297..c01663f40a7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,7 +5,8 @@ on: types: [opened, synchronize, reopened] jobs: - lint: + vale: + name: Vale Linting runs-on: ubuntu-latest steps: - name: Checkout code @@ -15,30 +16,16 @@ jobs: id: changed-files uses: tj-actions/changed-files@v34 with: + separator: ' ' files: | **/*.md **/*.txt **/*.rst - - name: Install Vale - run: | - curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - echo "$HOME/.local/bin" >> $GITHUB_PATH - vale sync + - name: Set VALE_FILES environment variable + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: echo "VALE_FILES=${{ steps.changed-files.outputs.all_changed_and_modified_files }}" >> $GITHUB_ENV - - name: Run Vale on changed files + - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: | - echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - # Convert the comma-separated list to space-separated - files=$(echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | tr ',' ' ') - # Ensure files exist (they might have been deleted) - existing_files=$(echo "$files" | xargs ls 2>/dev/null || true) - if [ -n "$existing_files" ]; then - echo "Running Vale on the following files:" - echo "$existing_files" - vale $existing_files - else - echo "No files to lint." - fi + uses: errata-ai/vale-action@reviewdog From 149bf3006387e7ad2c2fe6833e98e28b7d750e40 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 16:39:21 +0100 Subject: [PATCH 438/526] update --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index edcccdbd852..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,7 @@ StylesPath = styles MinAlertLevel = warning -Vocab = config/vocabularies/EN +Vocab = EN [*.md] BasedOnStyles = custom From 722dcc2f4aab48cf0800a6b4ec543ecdb757c8ed Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 16:44:57 +0100 Subject: [PATCH 439/526] udpate --- .github/workflows/vale.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c01663f40a7..ecb6e18bbce 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,3 +29,7 @@ jobs: - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog + with: + token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check + files: ${{ env.VALE_FILES }} From ded33812a9281ab41acdf137feca99c89730b896 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 17:09:27 +0100 Subject: [PATCH 440/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index ecb6e18bbce..135b8e47039 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,4 +32,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: ${{ env.VALE_FILES }} + files: '["website/docs/docs", "website/docs/reference", "website/docs/guides", "website/docs/best-practices"]' From 38d35e467745e0b3478a7311f85c80c801bafc08 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 17:13:04 +0100 Subject: [PATCH 441/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 135b8e47039..8a9605c6ad0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -32,4 +32,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: '["website/docs/docs", "website/docs/reference", "website/docs/guides", "website/docs/best-practices"]' + From d0f3137ae571c40ecb4aff2148dec3cbf6e1bd29 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 10:33:21 +0100 Subject: [PATCH 442/526] add --- .github/workflows/vale.yml | 43 +++++++++++++++++++++++++++++++------- styles/custom/Typos.yml | 4 ++++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 8a9605c6ad0..c30e131b905 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,8 +5,7 @@ on: types: [opened, synchronize, reopened] jobs: - vale: - name: Vale Linting + lint: runs-on: ubuntu-latest steps: - name: Checkout code @@ -22,14 +21,42 @@ jobs: **/*.txt **/*.rst - - name: Set VALE_FILES environment variable - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: echo "VALE_FILES=${{ steps.changed-files.outputs.all_changed_and_modified_files }}" >> $GITHUB_ENV + - name: Install Vale + env: + VALE_VERSION: v2.27.0 # Use a stable version + run: | + curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + vale sync - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - uses: errata-ai/vale-action@reviewdog + continue-on-error: true # Prevent the job from failing if Vale exits with an error + run: | + echo "Changed files:" + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + files="${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + # Ensure files exist and are accessible + existing_files=$(echo "$files" | xargs ls 2>/dev/null || true) + if [ -n "$existing_files" ]; then + echo "Running Vale on the following files:" + echo "$existing_files" + # Run Vale and save output to a file + vale --output=JSON $existing_files > vale_output.json + else + echo "No files to lint." + fi + + - name: Annotate with Reviewdog + if: ${{ steps.changed-files.outputs.any_changed == 'true' && always() }} + uses: reviewdog/action-reviewdog@v1 with: + name: Vale + reporter: github-pr-review + filter_mode: diff_context + fail_on_error: false + level: warning token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check - + tool_name: vale + format: vale + input: vale_output.json diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 56d8738155a..2ac0e75f271 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -15,6 +15,8 @@ filters: - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - '\bdbt\s+.*?\b' + - '<[^>]+>' # Ignore all HTML-like components starting with < and ending with > + - '<[^>]+>.*<\/[^>]+>' --- @@ -28,3 +30,5 @@ tokens: - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - '\bdbt\s+.*?\b' + - '<[^>]+>' # Ignore all HTML-like components starting with < and ending with > + - '<[^>]+>.*<\/[^>]+>' From 2728f68878b57319380f36e9ba6a64913cd2018b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 10:38:24 +0100 Subject: [PATCH 443/526] update --- .github/workflows/vale.yml | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index c30e131b905..6c4a0b16d84 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,34 +29,13 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH vale sync + - name: Set VALE_FILES environment variable + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: echo "VALE_FILES=${{ steps.changed-files.outputs.all_changed_and_modified_files }}" >> $GITHUB_ENV + - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - continue-on-error: true # Prevent the job from failing if Vale exits with an error - run: | - echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - files="${{ steps.changed-files.outputs.all_changed_and_modified_files }}" - # Ensure files exist and are accessible - existing_files=$(echo "$files" | xargs ls 2>/dev/null || true) - if [ -n "$existing_files" ]; then - echo "Running Vale on the following files:" - echo "$existing_files" - # Run Vale and save output to a file - vale --output=JSON $existing_files > vale_output.json - else - echo "No files to lint." - fi - - - name: Annotate with Reviewdog - if: ${{ steps.changed-files.outputs.any_changed == 'true' && always() }} - uses: reviewdog/action-reviewdog@v1 + uses: errata-ai/vale-action@reviewdog with: - name: Vale - reporter: github-pr-review - filter_mode: diff_context - fail_on_error: false - level: warning token: ${{ secrets.GITHUB_TOKEN }} - tool_name: vale - format: vale - input: vale_output.json + reporter: github-pr-check From 0ba5595d09cec22f07bf3cf257a0ff9dc6f418b8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 10:40:34 +0100 Subject: [PATCH 444/526] update --- .github/workflows/vale.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 6c4a0b16d84..f3a477dd8d7 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,7 +15,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v34 with: - separator: ' ' + separator: ',' files: | **/*.md **/*.txt @@ -29,13 +29,10 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH vale sync - - name: Set VALE_FILES environment variable - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - run: echo "VALE_FILES=${{ steps.changed-files.outputs.all_changed_and_modified_files }}" >> $GITHUB_ENV - - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check + files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} From cfc8c3c99f8bb4eb0ab1d29a1e9d5c219d47596a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 10:42:20 +0100 Subject: [PATCH 445/526] update --- .github/workflows/vale.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f3a477dd8d7..9fb885d3c6d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -21,14 +21,6 @@ jobs: **/*.txt **/*.rst - - name: Install Vale - env: - VALE_VERSION: v2.27.0 # Use a stable version - run: | - curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh - echo "$HOME/.local/bin" >> $GITHUB_PATH - vale sync - - name: Run Vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog From ca11a4456ac82ace753ab9a26220a7bcac6f37a8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 10:56:09 +0100 Subject: [PATCH 446/526] update --- .github/workflows/vale.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9fb885d3c6d..0bcc8ee4115 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize, reopened] jobs: - lint: + vale: runs-on: ubuntu-latest steps: - name: Checkout code @@ -15,16 +15,16 @@ jobs: id: changed-files uses: tj-actions/changed-files@v34 with: - separator: ',' files: | **/*.md **/*.txt **/*.rst + separator: '\n' - name: Run Vale - if: ${{ steps.changed-files.outputs.any_changed == 'true' }} - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check - files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + wrapper_script: | + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" > file_list.txt + cat file_list.txt | xargs vale From e62d9a6e276a24f2d380426357a8b7a9d54fc8a2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 11:12:34 +0100 Subject: [PATCH 447/526] update --- .github/workflows/vale.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 0bcc8ee4115..9f7ad92b807 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -3,28 +3,40 @@ name: Vale Linting on: pull_request: types: [opened, synchronize, reopened] + paths: + - 'website/docs/**/*' + - 'website/blog/**/*' + - 'website/**/*' jobs: vale: + name: Vale Linting runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v34 + - name: Set up Python + uses: actions/setup-python@v5 with: - files: | - **/*.md - **/*.txt - **/*.rst - separator: '\n' + python-version: '3.x' + + - name: Install Vale + run: pip install vale + + - name: Find changed lines adn files + id: changed-files + uses: hestonhoffman/changed-lines@v1 + with: + file_filter: '.md' + + - name: Set VALE_FILES environment variable + if: ${{ steps.changed_lines.outputs.changed_files != '' }} + run: echo "VALE_FILES=${{ steps.changed_lines.outputs.changed_files }}" >> $GITHUB_ENV - name: Run Vale - uses: errata-ai/vale-action@v2 + if: ${{ steps.changed_lines.outputs.changed_files == 'true' }} + uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - wrapper_script: | - echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" > file_list.txt - cat file_list.txt | xargs vale + reporter: github-pr-check From 2c62a751946253dce47f02264edae3109d984aca Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 11:21:06 +0100 Subject: [PATCH 448/526] update --- .github/workflows/vale.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9f7ad92b807..d624488afc8 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -24,19 +24,31 @@ jobs: - name: Install Vale run: pip install vale - - name: Find changed lines adn files - id: changed-files + - name: Find changed lines and files + id: changed_lines uses: hestonhoffman/changed-lines@v1 - with: + with: file_filter: '.md' + # Ensure the output is newline-separated + delimiter: ',' - - name: Set VALE_FILES environment variable + - name: Prepare files for Vale if: ${{ steps.changed_lines.outputs.changed_files != '' }} - run: echo "VALE_FILES=${{ steps.changed_lines.outputs.changed_files }}" >> $GITHUB_ENV + run: | + echo "Formatting changed files for Vale" + # Remove any empty lines + echo "${{ steps.changed_lines.outputs.changed_files }}" | awk 'NF' > changed_files.txt + # Create a comma-separated list + files_list=$(paste -sd ',' changed_files.txt) + echo "Formatted files as comma-separated list:" + echo "$files_list" + echo "VALE_FILES=$files_list" >> $GITHUB_ENV - name: Run Vale - if: ${{ steps.changed_lines.outputs.changed_files == 'true' }} + if: ${{ steps.changed_lines.outputs.changed_files != '' }} uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check + files: ${{ env.VALE_FILES }} + separator: ',' From e6b5f40d6a24663d8711a330f416d93fef9fb956 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 11:22:45 +0100 Subject: [PATCH 449/526] update --- .github/workflows/vale.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d624488afc8..49ed3fbf0ff 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -29,26 +29,13 @@ jobs: uses: hestonhoffman/changed-lines@v1 with: file_filter: '.md' - # Ensure the output is newline-separated - delimiter: ',' - - - name: Prepare files for Vale - if: ${{ steps.changed_lines.outputs.changed_files != '' }} - run: | - echo "Formatting changed files for Vale" - # Remove any empty lines - echo "${{ steps.changed_lines.outputs.changed_files }}" | awk 'NF' > changed_files.txt - # Create a comma-separated list - files_list=$(paste -sd ',' changed_files.txt) - echo "Formatted files as comma-separated list:" - echo "$files_list" - echo "VALE_FILES=$files_list" >> $GITHUB_ENV + delimiter: ',' # Use comma as the delimiter - name: Run Vale if: ${{ steps.changed_lines.outputs.changed_files != '' }} - uses: errata-ai/vale-action@reviewdog + uses: errata-ai/vale-action@v2 # Use a valid version tag with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: ${{ env.VALE_FILES }} + files: ${{ steps.changed_lines.outputs.changed_files }} separator: ',' From 753f349673cc73c42d4f81b69c63038e8a3bf76c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 11:37:11 +0100 Subject: [PATCH 450/526] update --- .github/workflows/vale.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 49ed3fbf0ff..7fa9d78bbfd 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -31,11 +31,24 @@ jobs: file_filter: '.md' delimiter: ',' # Use comma as the delimiter - - name: Run Vale + - name: Adjust file paths if: ${{ steps.changed_lines.outputs.changed_files != '' }} - uses: errata-ai/vale-action@v2 # Use a valid version tag + id: adjust_paths + run: | + echo "Adjusting file paths" + echo "${{ steps.changed_lines.outputs.changed_files }}" > changed_files_raw.txt + # Remove 'website/' prefix from each file path + adjusted_files=$(cat changed_files_raw.txt | sed 's|website/||g') + echo "Adjusted files:" + echo "$adjusted_files" + echo "ADJUSTED_FILES=$adjusted_files" >> $GITHUB_ENV + + - name: Run Vale + if: ${{ env.ADJUSTED_FILES != '' }} + uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: ${{ steps.changed_lines.outputs.changed_files }} + files: ${{ env.ADJUSTED_FILES }} separator: ',' + version: '3.7.1' From 5517d3eb7594555a63e3d6584ecb97eb2b6f8d5f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 11:50:11 +0100 Subject: [PATCH 451/526] update --- .github/workflows/vale.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 7fa9d78bbfd..9eac517372c 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -16,6 +16,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: List repository contents + run: | + pwd + ls -R + - name: Set up Python uses: actions/setup-python@v5 with: @@ -29,26 +34,20 @@ jobs: uses: hestonhoffman/changed-lines@v1 with: file_filter: '.md' - delimiter: ',' # Use comma as the delimiter + delimiter: ',' - - name: Adjust file paths + - name: Debugging - Print changed files if: ${{ steps.changed_lines.outputs.changed_files != '' }} - id: adjust_paths run: | - echo "Adjusting file paths" - echo "${{ steps.changed_lines.outputs.changed_files }}" > changed_files_raw.txt - # Remove 'website/' prefix from each file path - adjusted_files=$(cat changed_files_raw.txt | sed 's|website/||g') - echo "Adjusted files:" - echo "$adjusted_files" - echo "ADJUSTED_FILES=$adjusted_files" >> $GITHUB_ENV + echo "Changed files:" + echo "${{ steps.changed_lines.outputs.changed_files }}" - name: Run Vale - if: ${{ env.ADJUSTED_FILES != '' }} - uses: errata-ai/vale-action@reviewdog + if: ${{ steps.changed_lines.outputs.changed_files != '' }} + uses: errata-ai/vale-action@v2 with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: ${{ env.ADJUSTED_FILES }} + files: ${{ steps.changed_lines.outputs.changed_files }} separator: ',' version: '3.7.1' From a175defd17183936d7cd0459f0bf4c81de10b86a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:02:28 +0100 Subject: [PATCH 452/526] update --- .github/workflows/vale.yml | 40 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9eac517372c..e481dd686e4 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,27 +27,41 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale + run: pip install vale==2.27.0 - - name: Find changed lines and files - id: changed_lines - uses: hestonhoffman/changed-lines@v1 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 with: - file_filter: '.md' - delimiter: ',' - + files: | + website/**/*.md + separator: ',' + - name: Debugging - Print changed files - if: ${{ steps.changed_lines.outputs.changed_files != '' }} + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | echo "Changed files:" - echo "${{ steps.changed_lines.outputs.changed_files }}" + echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" + + - name: Confirm files exist + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + echo "Checking if files exist..." + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + if [ -f "$file" ]; then + echo "Found: $file" + else + echo "File not found: $file" + exit 1 + fi + done - name: Run Vale - if: ${{ steps.changed_lines.outputs.changed_files != '' }} - uses: errata-ai/vale-action@v2 + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check - files: ${{ steps.changed_lines.outputs.changed_files }} + files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ',' - version: '3.7.1' + version: '2.27.0' From 92f736390fe827b4d80c47755f031adce2e0e7f8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:08:54 +0100 Subject: [PATCH 453/526] update --- .github/workflows/vale.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index e481dd686e4..9413039ae04 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -25,9 +25,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.x' - + - name: Install Vale - run: pip install vale==2.27.0 + run: pip install vale==2.27.0 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -35,8 +35,8 @@ jobs: with: files: | website/**/*.md - separator: ',' - + separator: ' ' + - name: Debugging - Print changed files if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | @@ -63,5 +63,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} - separator: ',' + separator: ' ' version: '2.27.0' From 663e62b2467773fa01783ba7992369ce590a7d24 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:12:11 +0100 Subject: [PATCH 454/526] update --- .vale.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index 58aff923afe..b126adba863 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,5 @@ StylesPath = styles MinAlertLevel = warning -Vocab = EN - [*.md] BasedOnStyles = custom From da73c5a24b86ff4f0e30fdc54c8959e0441ce202 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:23:17 +0100 Subject: [PATCH 455/526] update --- .github/workflows/vale.yml | 4 +--- .vale.ini | 2 ++ styles/config/vocabularies/EN/accept.txt | 22 +++++++++++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9413039ae04..84d7886f1d5 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened] paths: - 'website/docs/**/*' - - 'website/blog/**/*' - 'website/**/*' jobs: @@ -27,7 +26,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale==2.27.0 # Install a stable version of Vale + run: pip install vale # Install a stable version of Vale - name: Get changed files id: changed-files @@ -64,4 +63,3 @@ jobs: reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' - version: '2.27.0' diff --git a/.vale.ini b/.vale.ini index b126adba863..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,7 @@ StylesPath = styles MinAlertLevel = warning +Vocab = EN + [*.md] BasedOnStyles = custom diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt index 9cf64852218..720a70b5f87 100644 --- a/styles/config/vocabularies/EN/accept.txt +++ b/styles/config/vocabularies/EN/accept.txt @@ -27,4 +27,24 @@ Snowflake dbt Mesh dbt mesh mesh - +Snowflake +Databricks +Fabric +ETL +ETL +Redshift +Azure +DevOps +Athena +Amazon +UI +CSV +S3 +SCD +repo +YAML +YML +pseudocolumn + Date: Mon, 16 Sep 2024 12:31:37 +0100 Subject: [PATCH 456/526] update --- .github/workflows/vale.yml | 4 +++- styles/custom/UIElements.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 84d7886f1d5..4cdce8df4db 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -5,6 +5,7 @@ on: types: [opened, synchronize, reopened] paths: - 'website/docs/**/*' + - 'website/blog/**/*' - 'website/**/*' jobs: @@ -26,7 +27,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale # Install a stable version of Vale + run: pip install vale==3.7.1 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -63,3 +64,4 @@ jobs: reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' + version: '3.7.1' diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index b47d7a99f1f..01930a99ca3 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -3,7 +3,7 @@ extends: existence message: "UI elements should be bold: '%s'." level: suggestion tokens: - - '\Save\b' + - '\bSave\b' - '\bCancel\b' - '\bSubmit\b' - '\bEdit\b' From 523a10ff5d612de09d97407c110064a4874d7eac Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:39:31 +0100 Subject: [PATCH 457/526] update --- styles/config/vocabularies/EN/accept.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt index 720a70b5f87..46c097109a0 100644 --- a/styles/config/vocabularies/EN/accept.txt +++ b/styles/config/vocabularies/EN/accept.txt @@ -45,6 +45,6 @@ repo YAML YML pseudocolumn - Date: Mon, 16 Sep 2024 12:44:43 +0100 Subject: [PATCH 458/526] update --- styles/config/vocabularies/EN/accept.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/vocabularies/EN/accept.txt index 46c097109a0..dc2d868219c 100644 --- a/styles/config/vocabularies/EN/accept.txt +++ b/styles/config/vocabularies/EN/accept.txt @@ -45,6 +45,7 @@ repo YAML YML pseudocolumn -\Q]+> From 8d155e5a2607c04bbf8b250e2ba808e2dbea8ddd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:46:36 +0100 Subject: [PATCH 459/526] update --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 4cdce8df4db..9413039ae04 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,7 +27,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale==3.7.1 # Install a stable version of Vale + run: pip install vale==2.27.0 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -64,4 +64,4 @@ jobs: reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' - version: '3.7.1' + version: '2.27.0' From 828219690f2ffaaa8c9076482400ec81ba52c3f4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:47:46 +0100 Subject: [PATCH 460/526] update --- .vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vale.ini b/.vale.ini index 58aff923afe..c605522b38f 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion Vocab = EN From 4d7b881d961f84ff316e16451ab3c28c58c4531c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 12:59:11 +0100 Subject: [PATCH 461/526] update --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9413039ae04..223ff7cffe0 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,7 +27,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale==2.27.0 # Install a stable version of Vale + run: pip install vale==3.0.0 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -64,4 +64,4 @@ jobs: reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' - version: '2.27.0' + version: '3.0.0' From 490d01a8bad05bc15642a2d7a3baf3c202e2e315 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:03:54 +0100 Subject: [PATCH 462/526] update --- .github/workflows/vale.yml | 4 ++-- styles/config/{vocabularies => Vocab}/EN/accept.txt | 0 styles/config/{vocabularies => Vocab}/EN/reject.txt | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename styles/config/{vocabularies => Vocab}/EN/accept.txt (100%) rename styles/config/{vocabularies => Vocab}/EN/reject.txt (100%) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 223ff7cffe0..9413039ae04 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -27,7 +27,7 @@ jobs: python-version: '3.x' - name: Install Vale - run: pip install vale==3.0.0 # Install a stable version of Vale + run: pip install vale==2.27.0 # Install a stable version of Vale - name: Get changed files id: changed-files @@ -64,4 +64,4 @@ jobs: reporter: github-pr-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' - version: '3.0.0' + version: '2.27.0' diff --git a/styles/config/vocabularies/EN/accept.txt b/styles/config/Vocab/EN/accept.txt similarity index 100% rename from styles/config/vocabularies/EN/accept.txt rename to styles/config/Vocab/EN/accept.txt diff --git a/styles/config/vocabularies/EN/reject.txt b/styles/config/Vocab/EN/reject.txt similarity index 100% rename from styles/config/vocabularies/EN/reject.txt rename to styles/config/Vocab/EN/reject.txt From 0a8c60021b97557b94572e5dd6ce114289db6e56 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:06:25 +0100 Subject: [PATCH 463/526] update --- styles/{config => }/Vocab/EN/accept.txt | 0 styles/{config => }/Vocab/EN/reject.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename styles/{config => }/Vocab/EN/accept.txt (100%) rename styles/{config => }/Vocab/EN/reject.txt (100%) diff --git a/styles/config/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt similarity index 100% rename from styles/config/Vocab/EN/accept.txt rename to styles/Vocab/EN/accept.txt diff --git a/styles/config/Vocab/EN/reject.txt b/styles/Vocab/EN/reject.txt similarity index 100% rename from styles/config/Vocab/EN/reject.txt rename to styles/Vocab/EN/reject.txt From f8de4cc410206ec36177b4707867306db6c13d0c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:20:34 +0100 Subject: [PATCH 464/526] update --- .vale.ini | 2 +- styles/Vocab/EN/accept.txt | 6 ++++++ styles/custom/SentenceCaseHeaders.yml | 3 ++- styles/custom/Typos.yml | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index c605522b38f..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning Vocab = EN diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index dc2d868219c..542f90346c2 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -49,3 +49,9 @@ pseudocolumn values= dbt_project.yml <[^>]+> +\w+-\w+ +\w+/\w+ +n/a +N/A +\w+/\w+|\w+-\w+|n/a +boolean diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index d44d2fae7a2..0a87e5a12c9 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -3,6 +3,7 @@ message: "'%s' should use sentence-style capitalization. Try '%s' instead." level: warning scope: heading match: $sentence +transform: sentence indicators: - ":" exceptions: @@ -10,4 +11,4 @@ exceptions: - '\bdbt\s+Cloud\b' - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - - '\bdbt\s+.*?\b' + - '\bdbt\s+.*?\b' diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 2ac0e75f271..456517950a9 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -32,3 +32,8 @@ tokens: - '\bdbt\s+.*?\b' - '<[^>]+>' # Ignore all HTML-like components starting with < and ending with > - '<[^>]+>.*<\/[^>]+>' + - '\w+-\w+' + - '\w+/\w+' + - '\w+/\w+|\w+-\w+|n/a' + - 'n/a' + - 'N/A' From 8f3b0be5160b368d60122421b6bd39781d6b558b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:23:03 +0100 Subject: [PATCH 465/526] update --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 3 +-- styles/custom/Typos.yml | 2 +- styles/custom/UIElements.yml | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.vale.ini b/.vale.ini index 58aff923afe..c605522b38f 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = warning +MinAlertLevel = suggestion Vocab = EN diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 402ac42252b..7de8ab44c78 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,6 +1,6 @@ extends: substitution message: "Avoid latin abbreviations: '%s'. Consider using '%s' instead." -level: warning +level: suggestion ignorecase: false swap: diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 4cd620146cf..509cbc7d01a 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: warning +level: suggestion alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index 0a87e5a12c9..fa84685cd8a 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,9 +1,8 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: warning +level: suggestion scope: heading match: $sentence -transform: sentence indicators: - ":" exceptions: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 456517950a9..2d23e2fc0ad 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " -level: warning +level: suggestion action: name: suggest diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 01930a99ca3..4204a631575 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,7 +1,7 @@ extends: existence message: "UI elements should be bold: '%s'." -level: suggestion +level: warning tokens: - '\bSave\b' - '\bCancel\b' From 18170e7f698257711735715dfefb957e21e39eb3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:30:17 +0100 Subject: [PATCH 466/526] update --- .vale.ini | 2 +- styles/custom/LatinAbbreviations.yml | 2 +- styles/custom/Repitition.yml | 2 +- styles/custom/SentenceCaseHeaders.yml | 2 +- styles/custom/Typos.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vale.ini b/.vale.ini index c605522b38f..58aff923afe 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,5 +1,5 @@ StylesPath = styles -MinAlertLevel = suggestion +MinAlertLevel = warning Vocab = EN diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 7de8ab44c78..402ac42252b 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -1,6 +1,6 @@ extends: substitution message: "Avoid latin abbreviations: '%s'. Consider using '%s' instead." -level: suggestion +level: warning ignorecase: false swap: diff --git a/styles/custom/Repitition.yml b/styles/custom/Repitition.yml index 509cbc7d01a..4cd620146cf 100644 --- a/styles/custom/Repitition.yml +++ b/styles/custom/Repitition.yml @@ -1,6 +1,6 @@ extends: repetition message: "'%s' is repeated!" -level: suggestion +level: warning alpha: true tokens: - '[^\s]+' diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index fa84685cd8a..b98d307fd6f 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." -level: suggestion +level: warning scope: heading match: $sentence indicators: diff --git a/styles/custom/Typos.yml b/styles/custom/Typos.yml index 2d23e2fc0ad..456517950a9 100644 --- a/styles/custom/Typos.yml +++ b/styles/custom/Typos.yml @@ -1,7 +1,7 @@ extends: spelling message: "Oops there's a typo -- did you really mean '%s'? " -level: suggestion +level: warning action: name: suggest From a9efc4a591fc6214ff7fec70f21e7e9f0b8ce2bd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 13:30:33 +0100 Subject: [PATCH 467/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 9413039ae04..d8204e04921 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -61,7 +61,7 @@ jobs: uses: errata-ai/vale-action@reviewdog with: token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check + reporter: github-check files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' From d3e6fd9f4fae52a56bd3c797dc0a3594007dc067 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 14:55:12 +0100 Subject: [PATCH 468/526] update --- .github/workflows/vale.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index d8204e04921..22434dd16ba 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -65,3 +65,15 @@ jobs: files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} separator: ' ' version: '2.27.0' + + - name: Post Summary Comment + if: ${{ steps.changed-files.outputs.any_changed == 'true' }} + run: | + COMMENT="Vale linting found issues. Please check the 'Checks' tab for detailed results." + COMMENT+=$'\n' + COMMENT+="Warnings: ${{ steps.reviewdog.outputs.warning }} | Errors: ${{ steps.reviewdog.outputs.error }} | Total: ${{ steps.reviewdog.outputs.total }}" + COMMENT+=$'\n\n' + COMMENT+="Link to detailed report: [Check results](${{ github.event.pull_request.html_url }}/checks)" + gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ebc33f3ea08caef760bfea64a7d1ffcd0ef3a931 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 15:08:55 +0100 Subject: [PATCH 469/526] update --- .github/workflows/vale.yml | 5 ++--- styles/Vocab/EN/accept.txt | 3 +++ styles/custom/UIElements.yml | 17 +++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 22434dd16ba..57c16efc49d 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -69,11 +69,10 @@ jobs: - name: Post Summary Comment if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - COMMENT="Vale linting found issues. Please check the 'Checks' tab for detailed results." + COMMENT="Vale linting found issues. Please check the 'Files change' tab for detailed results." COMMENT+=$'\n' - COMMENT+="Warnings: ${{ steps.reviewdog.outputs.warning }} | Errors: ${{ steps.reviewdog.outputs.error }} | Total: ${{ steps.reviewdog.outputs.total }}" COMMENT+=$'\n\n' - COMMENT+="Link to detailed report: [Check results](${{ github.event.pull_request.html_url }}/checks)" + COMMENT+="Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 542f90346c2..9524611ec63 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -55,3 +55,6 @@ n/a N/A \w+/\w+|\w+-\w+|n/a boolean +defaultValue= +DWH +BQ diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 4204a631575..8b59bd1474b 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -3,11 +3,12 @@ extends: existence message: "UI elements should be bold: '%s'." level: warning tokens: - - '\bSave\b' - - '\bCancel\b' - - '\bSubmit\b' - - '\bEdit\b' - - '\bAccount settings\b' - - '\bProject details\b' - - '\bProfile settings\b' - - '\bPersonal profile\b' + # Match if the UI element is not already surrounded by ** + - '(? Date: Mon, 16 Sep 2024 15:18:26 +0100 Subject: [PATCH 470/526] update --- .github/workflows/vale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 57c16efc49d..12a00e83d38 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 1 - name: List repository contents run: | From f3f6e423f59e4ddc24953e238f8e5f6a203a14af Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 15:49:17 +0100 Subject: [PATCH 471/526] update --- styles/custom/UIElements.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index 8b59bd1474b..2f9a22206f0 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -1,14 +1,17 @@ +# styles/custom/BoldUIElements.yml extends: existence - -message: "UI elements should be bold: '%s'." +message: "UI elements like '%s' should be bold." level: warning tokens: - # Match if the UI element is not already surrounded by ** - - '(? Date: Mon, 16 Sep 2024 15:55:51 +0100 Subject: [PATCH 472/526] update --- styles/Vocab/EN/accept.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 9524611ec63..3cad2eae559 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -57,4 +57,10 @@ N/A boolean defaultValue= DWH +DWHs +ADF BQ +gcloud +MSFT +shoutout +DDL From 870939cff6caeb38b6a504ab462b50b37774a3cc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 16:02:59 +0100 Subject: [PATCH 473/526] update --- .github/workflows/vale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 12a00e83d38..cff592d858e 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -71,10 +71,10 @@ jobs: - name: Post Summary Comment if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - COMMENT="Vale linting found issues. Please check the 'Files change' tab for detailed results." + COMMENT="❗️Oh no, some Vale linting found issues! Please check the 'Files change' tab for detailed results and make the necessary updates ✨." COMMENT+=$'\n' COMMENT+=$'\n\n' - COMMENT+="Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" + COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 78b5a628883405eb749f39916ca1c1c9f3d7d7ab Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 16 Sep 2024 16:24:42 +0100 Subject: [PATCH 474/526] update --- .github/workflows/vale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index cff592d858e..f91f33ce03a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -71,7 +71,7 @@ jobs: - name: Post Summary Comment if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | - COMMENT="❗️Oh no, some Vale linting found issues! Please check the 'Files change' tab for detailed results and make the necessary updates ✨." + COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files change** tab for detailed results and make the necessary updates." COMMENT+=$'\n' COMMENT+=$'\n\n' COMMENT+="➡️ Link to detailed report: [Files changed](${{ github.event.pull_request.html_url }}/files)" From 93e07646882de2b6b0c9b5a626a47d7498cc13d8 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 12:36:10 +0100 Subject: [PATCH 475/526] add yaml for preview link --- .github/workflows/preview-link.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/preview-link.yml diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml new file mode 100644 index 00000000000..1505329c220 --- /dev/null +++ b/.github/workflows/preview-link.yml @@ -0,0 +1,38 @@ +name: Vercel deployment preview link generator + +on: + pull_request: + types: [opened, synchronize] + +jobs: + comment-deployment-link: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get vercel deployment URL + id: vercel + run: | + # Fetch the Vercel URL using API or extract from a known pattern + DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" + echo "::set-output name=deployment_url::${DEPLOYMENT_URL}" + + - name: Get changed files + id: files + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'website/docs/docs/') + echo "::set-output name=changed_files::${CHANGED_FILES}" + + - name: Post comment with deployment link + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + 🚀 Deployment available: ${{ steps.vercel.outputs.deployment_url }} + Here are the direct links to the updated files: + + ${{ steps.files.outputs.changed_files }} + + You can review the changes directly in the deployed environment! From 1e3e67a0c9757dc9f80c1837201115c791c7ad6c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 12:41:51 +0100 Subject: [PATCH 476/526] add 120 secs --- .github/workflows/preview-link.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 1505329c220..9cb08a45bd0 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -7,14 +7,19 @@ on: jobs: comment-deployment-link: runs-on: ubuntu-latest + steps: + - name: Wait for Vercel deployment + run: | + echo "Waiting for Vercel deployment to complete..." + sleep 120 # Adjust this based on your deployment time + - name: Checkout code uses: actions/checkout@v3 - name: Get vercel deployment URL id: vercel run: | - # Fetch the Vercel URL using API or extract from a known pattern DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" echo "::set-output name=deployment_url::${DEPLOYMENT_URL}" From 6baf51791d26c2bd23ca2a978acb165d02e73f09 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 12:47:42 +0100 Subject: [PATCH 477/526] test --- .github/workflows/preview-link.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 9cb08a45bd0..a109a772f93 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -9,19 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - - name: Wait for Vercel deployment - run: | - echo "Waiting for Vercel deployment to complete..." - sleep 120 # Adjust this based on your deployment time - - name: Checkout code uses: actions/checkout@v3 - - name: Get vercel deployment URL - id: vercel + - name: Wait for Vercel deployment run: | - DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" - echo "::set-output name=deployment_url::${DEPLOYMENT_URL}" + echo "Waiting for Vercel deployment to complete..." + sleep 300 # Adjust this based on deployment speed - name: Get changed files id: files @@ -29,6 +23,15 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'website/docs/docs/') echo "::set-output name=changed_files::${CHANGED_FILES}" + - name: Generate deployment link + id: vercel + run: | + DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" + CHANGED_FILES=${{ steps.files.outputs.changed_files }} + # Formatting links for each changed file + LINKS=$(echo "$CHANGED_FILES" | awk -v url="$DEPLOYMENT_URL" '{print url "/" $0}') + echo "::set-output name=links::${LINKS}" + - name: Post comment with deployment link uses: peter-evans/create-or-update-comment@v1 with: @@ -37,7 +40,5 @@ jobs: body: | 🚀 Deployment available: ${{ steps.vercel.outputs.deployment_url }} Here are the direct links to the updated files: - - ${{ steps.files.outputs.changed_files }} - - You can review the changes directly in the deployed environment! + + ${{ steps.vercel.outputs.links }} From b6416c0d4c1388d7cd3d8cd0a6be7de0a568b09c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 12:56:33 +0100 Subject: [PATCH 478/526] test --- .github/workflows/preview-link.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index a109a772f93..fcd1c456241 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -15,7 +15,14 @@ jobs: - name: Wait for Vercel deployment run: | echo "Waiting for Vercel deployment to complete..." - sleep 300 # Adjust this based on deployment speed + sleep 500 # Adjust based on deployment time + + - name: Get Vercel deployment URL + id: vercel_url + run: | + # If the Vercel deployment URL is available via API, capture it here + DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" + echo "::set-output name=deployment_url::${DEPLOYMENT_URL}" - name: Get changed files id: files @@ -23,22 +30,21 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'website/docs/docs/') echo "::set-output name=changed_files::${CHANGED_FILES}" - - name: Generate deployment link - id: vercel + - name: Generate file preview links + id: links run: | - DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" - CHANGED_FILES=${{ steps.files.outputs.changed_files }} - # Formatting links for each changed file - LINKS=$(echo "$CHANGED_FILES" | awk -v url="$DEPLOYMENT_URL" '{print url "/" $0}') + DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" + CHANGED_FILES="${{ steps.files.outputs.changed_files }}" + LINKS=$(echo "$CHANGED_FILES" | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/" $0 ")"}') echo "::set-output name=links::${LINKS}" - name: Post comment with deployment link - uses: peter-evans/create-or-update-comment@v1 + uses: peter-evans/create-or-update-comment@v4.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - 🚀 Deployment available: ${{ steps.vercel.outputs.deployment_url }} + 🚀 Deployment available: ${{ steps.vercel_url.outputs.deployment_url }} Here are the direct links to the updated files: - ${{ steps.vercel.outputs.links }} + ${{ steps.links.outputs.links }} From 8b9be8cccb12257f2639d9fed1a5604b1d5f2867 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 13:10:22 +0100 Subject: [PATCH 479/526] test --- .github/workflows/preview-link.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index fcd1c456241..f5414a0fdc9 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -3,6 +3,17 @@ name: Vercel deployment preview link generator on: pull_request: types: [opened, synchronize] + paths: + - 'website/docs/docs/**' + - 'website/docs/best-practices/**' + - 'website/docs/guides/**' + - 'website/docs/faqs/**' + - 'website/docs/reference/**' + +permissions: + contents: read + pull-requests: write + jobs: comment-deployment-link: @@ -10,12 +21,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Wait for Vercel deployment run: | echo "Waiting for Vercel deployment to complete..." - sleep 500 # Adjust based on deployment time + sleep 300 # Adjust based on deployment time - name: Get Vercel deployment URL id: vercel_url From 117894528ebd55e3ff544c418ddebe3e27b483f2 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 13:21:19 +0100 Subject: [PATCH 480/526] test --- .github/workflows/preview-link.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index f5414a0fdc9..03199457f67 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -47,8 +47,9 @@ jobs: id: links run: | DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" - CHANGED_FILES="${{ steps.files.outputs.changed_files }}" - LINKS=$(echo "$CHANGED_FILES" | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/" $0 ")"}') + CHANGED_FILES="${{ steps.files.outputs.changed_files }}" + # Strip the 'website/docs/docs/' portion and append the rest to the URL + LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') echo "::set-output name=links::${LINKS}" - name: Post comment with deployment link From 5e402e2f3b4094957bbeadf11075e29b3d0a5099 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 13:41:57 +0100 Subject: [PATCH 481/526] test --- .github/workflows/preview-link.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 03199457f67..a367acc52ff 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -14,7 +14,6 @@ permissions: contents: read pull-requests: write - jobs: comment-deployment-link: runs-on: ubuntu-latest @@ -23,19 +22,25 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: Wait for Vercel deployment run: | echo "Waiting for Vercel deployment to complete..." sleep 300 # Adjust based on deployment time - - name: Get Vercel deployment URL + - name: Install GitHub CLI and jq + run: | + sudo apt-get install jq -y + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + sudo apt-get install gh -y + + - name: Get Vercel deployment URL from GitHub Check id: vercel_url run: | - # If the Vercel deployment URL is available via API, capture it here - DEPLOYMENT_URL="https://docs-getdbt-${{ github.sha }}-dbt-labs.vercel.app" - echo "::set-output name=deployment_url::${DEPLOYMENT_URL}" + CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) + VERCEL_URL=$(echo $CHECK_RUNS | jq -r '.check_runs[] | select(.name=="Vercel") | .details_url') + echo "::set-output name=deployment_url::${VERCEL_URL}" - name: Get changed files id: files From c8634a37a6d57bb1bb6f9591f4b9a7e3b9f333cc Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 13:50:58 +0100 Subject: [PATCH 482/526] test --- .github/workflows/preview-link.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index a367acc52ff..b0945bda492 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -37,6 +37,8 @@ jobs: - name: Get Vercel deployment URL from GitHub Check id: vercel_url + env: + VALE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) VERCEL_URL=$(echo $CHECK_RUNS | jq -r '.check_runs[] | select(.name=="Vercel") | .details_url') From c6a5cb9aa470f886181dbd5d3ca4fa18a4d5ad19 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 14:02:49 +0100 Subject: [PATCH 483/526] test --- .github/workflows/preview-link.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index b0945bda492..84905f41861 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -38,7 +38,7 @@ jobs: - name: Get Vercel deployment URL from GitHub Check id: vercel_url env: - VALE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) VERCEL_URL=$(echo $CHECK_RUNS | jq -r '.check_runs[] | select(.name=="Vercel") | .details_url') From 4ebcda47d2a130258275917b01921d48bddb967b Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 19 Sep 2024 16:11:42 +0100 Subject: [PATCH 484/526] update yaml --- .github/workflows/preview-link.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 84905f41861..faa339aa214 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -38,10 +38,14 @@ jobs: - name: Get Vercel deployment URL from GitHub Check id: vercel_url env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication run: | CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) VERCEL_URL=$(echo $CHECK_RUNS | jq -r '.check_runs[] | select(.name=="Vercel") | .details_url') + if [ -z "$VERCEL_URL" ]; then + echo "Vercel URL not found, defaulting to GitHub URL." + VERCEL_URL="https://github.com" + fi echo "::set-output name=deployment_url::${VERCEL_URL}" - name: Get changed files @@ -55,7 +59,7 @@ jobs: run: | DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" CHANGED_FILES="${{ steps.files.outputs.changed_files }}" - # Strip the 'website/docs/docs/' portion and append the rest to the URL + # Remove 'website/docs/docs/' and '.md' extension from the filenames LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') echo "::set-output name=links::${LINKS}" From 2a2df9a98564fe6ce52c629667d8fe55a69f6cef Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 16:29:46 +0100 Subject: [PATCH 485/526] add --- .github/workflows/preview-link.yml | 70 +++++++++++++++++++----------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index faa339aa214..de21f3aab7e 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -24,52 +24,72 @@ jobs: with: fetch-depth: 0 - - name: Wait for Vercel deployment - run: | - echo "Waiting for Vercel deployment to complete..." - sleep 300 # Adjust based on deployment time - - name: Install GitHub CLI and jq run: | - sudo apt-get install jq -y - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - sudo apt-get install gh -y + sudo apt-get update + sudo apt-get install -y jq + sudo apt-get install -y gh - - name: Get Vercel deployment URL from GitHub Check - id: vercel_url + - name: Wait for Vercel deployment + id: vercel_deploy env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) - VERCEL_URL=$(echo $CHECK_RUNS | jq -r '.check_runs[] | select(.name=="Vercel") | .details_url') - if [ -z "$VERCEL_URL" ]; then - echo "Vercel URL not found, defaulting to GitHub URL." - VERCEL_URL="https://github.com" + CHECK_RUN_ID="" + ATTEMPTS=0 + MAX_ATTEMPTS=30 # Adjust as needed + SLEEP_TIME=10 # Adjust as needed + while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do + CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) + VERCEL_CHECK=$(echo $CHECK_RUNS | jq '.check_runs[] | select(.name=="Vercel")') + if [ -n "$VERCEL_CHECK" ]; then + STATUS=$(echo $VERCEL_CHECK | jq -r '.status') + CONCLUSION=$(echo $VERCEL_CHECK | jq -r '.conclusion') + if [ "$STATUS" == "completed" ]; then + if [ "$CONCLUSION" == "success" ]; then + echo "Vercel deployment completed successfully." + VERCEL_URL=$(echo $VERCEL_CHECK | jq -r '.details_url') + echo "deployment_url=$VERCEL_URL" >> $GITHUB_OUTPUT + break + else + echo "Vercel deployment failed." + exit 1 + fi + else + echo "Vercel deployment status: $STATUS. Waiting..." + fi + else + echo "Vercel check not found. Waiting..." + fi + ATTEMPTS=$((ATTEMPTS + 1)) + sleep $SLEEP_TIME + done + if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then + echo "Vercel deployment did not complete within expected time." + exit 1 fi - echo "::set-output name=deployment_url::${VERCEL_URL}" - name: Get changed files id: files run: | CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'website/docs/docs/') - echo "::set-output name=changed_files::${CHANGED_FILES}" + echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT - name: Generate file preview links id: links run: | - DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" - CHANGED_FILES="${{ steps.files.outputs.changed_files }}" - # Remove 'website/docs/docs/' and '.md' extension from the filenames + DEPLOYMENT_URL="${{ steps.vercel_deploy.outputs.deployment_url }}" + CHANGED_FILES="${{ steps.files.outputs.changed_files }}" LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') - echo "::set-output name=links::${LINKS}" + echo "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link - uses: peter-evans/create-or-update-comment@v4.0.0 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - 🚀 Deployment available: ${{ steps.vercel_url.outputs.deployment_url }} + 🚀 Deployment available: ${{ steps.vercel_deploy.outputs.deployment_url }} Here are the direct links to the updated files: - + ${{ steps.links.outputs.links }} From b7fc7e2edd7ac3ac730e6083c27912d9d7e01b88 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 16:56:34 +0100 Subject: [PATCH 486/526] add --- .github/workflows/preview-link.yml | 79 +++++++++++++++++------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index de21f3aab7e..dcc35bbbd3d 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -24,48 +24,52 @@ jobs: with: fetch-depth: 0 - - name: Install GitHub CLI and jq + - name: Install necessary tools run: | sudo apt-get update - sudo apt-get install -y jq - sudo apt-get install -y gh + sudo apt-get install -y jq curl - - name: Wait for Vercel deployment - id: vercel_deploy - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Generate Vercel deployment URL + id: vercel_url run: | - CHECK_RUN_ID="" - ATTEMPTS=0 + # Get the branch name + BRANCH_NAME="${{ github.head_ref }}" + + # Convert to lowercase + BRANCH_NAME_LOWER=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]') + + # Replace non-alphanumeric characters with hyphens + BRANCH_NAME_SANITIZED=$(echo "$BRANCH_NAME_LOWER" | sed 's/[^a-z0-9]/-/g') + + # Construct the deployment URL + DEPLOYMENT_URL="https://docs-getdbt-com-git-${BRANCH_NAME_SANITIZED}-dbt-labs.vercel.app" + + echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT + + - name: Wait for deployment to be accessible (optional) + id: wait_for_deployment + run: | + DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" + echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." + MAX_ATTEMPTS=30 # Adjust as needed SLEEP_TIME=10 # Adjust as needed + ATTEMPTS=0 + while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do - CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs) - VERCEL_CHECK=$(echo $CHECK_RUNS | jq '.check_runs[] | select(.name=="Vercel")') - if [ -n "$VERCEL_CHECK" ]; then - STATUS=$(echo $VERCEL_CHECK | jq -r '.status') - CONCLUSION=$(echo $VERCEL_CHECK | jq -r '.conclusion') - if [ "$STATUS" == "completed" ]; then - if [ "$CONCLUSION" == "success" ]; then - echo "Vercel deployment completed successfully." - VERCEL_URL=$(echo $VERCEL_CHECK | jq -r '.details_url') - echo "deployment_url=$VERCEL_URL" >> $GITHUB_OUTPUT - break - else - echo "Vercel deployment failed." - exit 1 - fi - else - echo "Vercel deployment status: $STATUS. Waiting..." - fi + STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOYMENT_URL") + if [ "$STATUS_CODE" -eq 200 ]; then + echo "Deployment is accessible." + break else - echo "Vercel check not found. Waiting..." + echo "Deployment not yet accessible (status code: $STATUS_CODE). Waiting..." + sleep $SLEEP_TIME + ATTEMPTS=$((ATTEMPTS + 1)) fi - ATTEMPTS=$((ATTEMPTS + 1)) - sleep $SLEEP_TIME done + if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then - echo "Vercel deployment did not complete within expected time." + echo "Deployment did not become accessible within the expected time." exit 1 fi @@ -78,9 +82,16 @@ jobs: - name: Generate file preview links id: links run: | - DEPLOYMENT_URL="${{ steps.vercel_deploy.outputs.deployment_url }}" + DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" CHANGED_FILES="${{ steps.files.outputs.changed_files }}" - LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') + + if [ -z "$CHANGED_FILES" ]; then + echo "No changed files found in the specified directories." + LINKS="- No documentation files were changed." + else + LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') + fi + echo "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link @@ -89,7 +100,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - 🚀 Deployment available: ${{ steps.vercel_deploy.outputs.deployment_url }} + 🚀 **Deployment available:** ${{ steps.vercel_url.outputs.deployment_url }} Here are the direct links to the updated files: ${{ steps.links.outputs.links }} From b050146a2014793baf6e1fd863fae9993ee05832 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:07:03 +0100 Subject: [PATCH 487/526] add --- .github/workflows/preview-link.yml | 42 +++++++++++++++++------- website/docs/docs/build/saved-queries.md | 2 ++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index dcc35bbbd3d..ef49f24e3ea 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -46,14 +46,14 @@ jobs: echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT - - name: Wait for deployment to be accessible (optional) + - name: Wait for deployment to be accessible id: wait_for_deployment run: | DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." - MAX_ATTEMPTS=30 # Adjust as needed - SLEEP_TIME=10 # Adjust as needed + MAX_ATTEMPTS=60 # Adjust as needed (e.g., wait up to 10 minutes) + SLEEP_TIME=10 # Check every 10 seconds ATTEMPTS=0 while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do @@ -76,8 +76,20 @@ jobs: - name: Get changed files id: files run: | - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'website/docs/docs/') - echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT + # Get the list of changed files in the specified directories + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) + echo "Changed files:" + echo "$CHANGED_FILES" + + # Check if any files were changed + if [ -z "$CHANGED_FILES" ]; then + echo "No documentation files were changed." + echo "changed_files=" >> $GITHUB_OUTPUT + else + # Convert line-separated files to space-separated for easier handling + CHANGED_FILES="$(echo "$CHANGED_FILES" | tr '\n' ' ')" + echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT + fi - name: Generate file preview links id: links @@ -86,13 +98,23 @@ jobs: CHANGED_FILES="${{ steps.files.outputs.changed_files }}" if [ -z "$CHANGED_FILES" ]; then - echo "No changed files found in the specified directories." + echo "No documentation files were changed." LINKS="- No documentation files were changed." else - LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') + LINKS="" + for FILE in $CHANGED_FILES; do + # Remove 'website/docs/' prefix and '.md' extension + FILE_PATH="${FILE#website/docs/}" + FILE_PATH="${FILE_PATH%.md}" + # Replace spaces and special characters with hyphens in URL path + URL_PATH=$(echo "$FILE_PATH" | sed 's/ /-/g; s/[^a-zA-Z0-9\-\/]//g' | tr '[:upper:]' '[:lower:]') + FULL_URL="$DEPLOYMENT_URL/$URL_PATH" + LINKS="$LINKS\n- [$FULL_URL]($FULL_URL)" + done fi - echo "links=$LINKS" >> $GITHUB_OUTPUT + # Output the links + echo -e "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link uses: peter-evans/create-or-update-comment@v4 @@ -100,7 +122,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - 🚀 **Deployment available:** ${{ steps.vercel_url.outputs.deployment_url }} - Here are the direct links to the updated files: - + 🚀 Deployment available! Here are the direct links to the updated files: ${{ steps.links.outputs.links }} diff --git a/website/docs/docs/build/saved-queries.md b/website/docs/docs/build/saved-queries.md index e9beffca15f..518f9008b7a 100644 --- a/website/docs/docs/build/saved-queries.md +++ b/website/docs/docs/build/saved-queries.md @@ -6,6 +6,8 @@ sidebar_label: "Saved queries" tags: [Metrics, Semantic Layer] --- +# Test for preview link change + Saved queries are a way to save commonly used queries in MetricFlow. You can group metrics, dimensions, and filters that are logically related into a saved query. Saved queries are nodes and visible in the dbt . Saved queries serve as the foundational building block, allowing you to [configure exports](#configure-exports) in your saved query configuration. Exports takes this functionality a step further by enabling you to [schedule and write saved queries](/docs/use-dbt-semantic-layer/exports) directly within your data platform using [dbt Cloud's job scheduler](/docs/deploy/job-scheduler). From 94d82f4d305e7feba68d5dfb8eccdcfadf3c66bd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:11:04 +0100 Subject: [PATCH 488/526] add --- .github/workflows/preview-link.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index ef49f24e3ea..4781a576547 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -98,23 +98,14 @@ jobs: CHANGED_FILES="${{ steps.files.outputs.changed_files }}" if [ -z "$CHANGED_FILES" ]; then - echo "No documentation files were changed." + echo "No changed files found in the specified directories." LINKS="- No documentation files were changed." else - LINKS="" - for FILE in $CHANGED_FILES; do - # Remove 'website/docs/' prefix and '.md' extension - FILE_PATH="${FILE#website/docs/}" - FILE_PATH="${FILE_PATH%.md}" - # Replace spaces and special characters with hyphens in URL path - URL_PATH=$(echo "$FILE_PATH" | sed 's/ /-/g; s/[^a-zA-Z0-9\-\/]//g' | tr '[:upper:]' '[:lower:]') - FULL_URL="$DEPLOYMENT_URL/$URL_PATH" - LINKS="$LINKS\n- [$FULL_URL]($FULL_URL)" - done + LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') fi - # Output the links - echo -e "links=$LINKS" >> $GITHUB_OUTPUT + echo "links=$LINKS" >> $GITHUB_OUTPUT + - name: Post comment with deployment link uses: peter-evans/create-or-update-comment@v4 From bf9a57a4434028e163e47963ba0f11f12be606b9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:12:06 +0100 Subject: [PATCH 489/526] add --- website/docs/docs/build/saved-queries.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/docs/build/saved-queries.md b/website/docs/docs/build/saved-queries.md index 518f9008b7a..e9beffca15f 100644 --- a/website/docs/docs/build/saved-queries.md +++ b/website/docs/docs/build/saved-queries.md @@ -6,8 +6,6 @@ sidebar_label: "Saved queries" tags: [Metrics, Semantic Layer] --- -# Test for preview link change - Saved queries are a way to save commonly used queries in MetricFlow. You can group metrics, dimensions, and filters that are logically related into a saved query. Saved queries are nodes and visible in the dbt . Saved queries serve as the foundational building block, allowing you to [configure exports](#configure-exports) in your saved query configuration. Exports takes this functionality a step further by enabling you to [schedule and write saved queries](/docs/use-dbt-semantic-layer/exports) directly within your data platform using [dbt Cloud's job scheduler](/docs/deploy/job-scheduler). From 99f41768693cf2eddfc573ef7ea21882f9f7ec7a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:28:45 +0100 Subject: [PATCH 490/526] add --- .github/workflows/preview-link.yml | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 4781a576547..714464cf9ee 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -101,17 +101,34 @@ jobs: echo "No changed files found in the specified directories." LINKS="- No documentation files were changed." else - LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') + LINKS="" + for FILE in $CHANGED_FILES; do + # Remove 'website/docs/' prefix and '.md' extension + FILE_PATH="${FILE#website/docs/}" + FILE_PATH="${FILE_PATH%.md}" + # Replace spaces and special characters with hyphens in URL path + URL_PATH=$(echo "$FILE_PATH" | sed 's/ /-/g; s/[^a-zA-Z0-9\-_\/]//g' | tr '[:upper:]' '[:lower:]') + FULL_URL="$DEPLOYMENT_URL/$URL_PATH" + LINKS="$LINKS\n- [$FULL_URL]($FULL_URL)" + done fi - echo "links=$LINKS" >> $GITHUB_OUTPUT - + # Output the links + echo -e "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link - uses: peter-evans/create-or-update-comment@v4 + uses: actions/github-script@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { github, context } = require('@actions/github'); + const issue_number = context.payload.pull_request.number; + const body = ` 🚀 Deployment available! Here are the direct links to the updated files: ${{ steps.links.outputs.links }} + `; + await github.rest.issues.createComment({ + ...context.repo, + issue_number, + body: body + }); From d59c34b6e11c39b6b0d5f0ef379fae7c90e4e601 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:31:10 +0100 Subject: [PATCH 491/526] add --- .github/workflows/preview-link.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 714464cf9ee..4353f20f080 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -101,20 +101,10 @@ jobs: echo "No changed files found in the specified directories." LINKS="- No documentation files were changed." else - LINKS="" - for FILE in $CHANGED_FILES; do - # Remove 'website/docs/' prefix and '.md' extension - FILE_PATH="${FILE#website/docs/}" - FILE_PATH="${FILE_PATH%.md}" - # Replace spaces and special characters with hyphens in URL path - URL_PATH=$(echo "$FILE_PATH" | sed 's/ /-/g; s/[^a-zA-Z0-9\-_\/]//g' | tr '[:upper:]' '[:lower:]') - FULL_URL="$DEPLOYMENT_URL/$URL_PATH" - LINKS="$LINKS\n- [$FULL_URL]($FULL_URL)" - done + LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') fi - # Output the links - echo -e "links=$LINKS" >> $GITHUB_OUTPUT + echo "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link uses: actions/github-script@v6 From 0320862d909272441eee5c1d5acf84d1259a0c75 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 20 Sep 2024 17:33:15 +0100 Subject: [PATCH 492/526] add --- .github/workflows/preview-link.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 4353f20f080..733c243ec85 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -107,18 +107,11 @@ jobs: echo "links=$LINKS" >> $GITHUB_OUTPUT - name: Post comment with deployment link - uses: actions/github-script@v6 + uses: peter-evans/create-or-update-comment@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { github, context } = require('@actions/github'); - const issue_number = context.payload.pull_request.number; - const body = ` + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + 🚀 Deployment available! Here are the direct links to the updated files: ${{ steps.links.outputs.links }} - `; - await github.rest.issues.createComment({ - ...context.repo, - issue_number, - body: body - }); From 7301eab23eae0cace82c8d8d1b7b3dc02adf118c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 24 Sep 2024 14:25:42 +0100 Subject: [PATCH 493/526] add --- .github/workflows/preview-link.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 733c243ec85..317791f3b95 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -101,10 +101,25 @@ jobs: echo "No changed files found in the specified directories." LINKS="- No documentation files were changed." else - LINKS=$(echo "$CHANGED_FILES" | sed 's#website/docs/docs/##; s/.md$//' | awk -v url="$DEPLOYMENT_URL" '{print "- [" $0 "](" url "/docs/" $0 ")"}') + LINKS="" + # Convert CHANGED_FILES back to newline-separated for processing + CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ' ' '\n') + for FILE in $CHANGED_FILES; do + # Remove 'website/docs/' prefix + FILE_PATH="${FILE#website/docs/}" + # Keep the .md extension as per your desired output + # FILE_PATH="${FILE_PATH%.md}" + + # Construct the full URL + FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" + LINKS="$LINKS\n- $FULL_URL" + done fi - echo "links=$LINKS" >> $GITHUB_OUTPUT + # Properly set the multi-line output + echo "links<> $GITHUB_OUTPUT + echo -e "$LINKS" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Post comment with deployment link uses: peter-evans/create-or-update-comment@v4 From 88bb8e5dc6c45349495b27dba8347efc88cedc65 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 24 Sep 2024 14:33:29 +0100 Subject: [PATCH 494/526] add --- .github/workflows/preview-link.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 317791f3b95..84f7d187ac7 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -107,8 +107,8 @@ jobs: for FILE in $CHANGED_FILES; do # Remove 'website/docs/' prefix FILE_PATH="${FILE#website/docs/}" - # Keep the .md extension as per your desired output - # FILE_PATH="${FILE_PATH%.md}" + # Remove the .md extension as per your desired output + FILE_PATH="${FILE_PATH%.md}" # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" From da41198e4009fd93bdc263cfe9d2dfa23d9c53c9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 24 Sep 2024 14:59:03 +0100 Subject: [PATCH 495/526] add --- .github/workflows/preview-link.yml | 72 +++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 84f7d187ac7..32c6445c05e 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -13,6 +13,7 @@ on: permissions: contents: read pull-requests: write + checks: read # Added permission to read checks jobs: comment-deployment-link: @@ -46,30 +47,54 @@ jobs: echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT - - name: Wait for deployment to be accessible - id: wait_for_deployment + - name: Wait for Vercel deployment check to complete + id: wait_for_vercel + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" - echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." + # Set variables + COMMIT_SHA="${{ github.event.pull_request.head.sha }}" + REPO="${{ github.repository }}" + + echo "Waiting for Vercel deployment check to complete..." - MAX_ATTEMPTS=60 # Adjust as needed (e.g., wait up to 10 minutes) + MAX_ATTEMPTS=60 # Adjust as needed SLEEP_TIME=10 # Check every 10 seconds ATTEMPTS=0 while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do - STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOYMENT_URL") - if [ "$STATUS_CODE" -eq 200 ]; then - echo "Deployment is accessible." - break + # Get the check runs for the commit + CHECK_RUNS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/$REPO/commits/$COMMIT_SHA/check-runs") + + # Filter for the Vercel check run + VERCEL_CHECK=$(echo "$CHECK_RUNS" | jq -r '.check_runs[] | select(.name == "Vercel")') + + if [ -n "$VERCEL_CHECK" ]; then + STATUS=$(echo "$VERCEL_CHECK" | jq -r '.status') + CONCLUSION=$(echo "$VERCEL_CHECK" | jq -r '.conclusion') + + echo "Vercel check status: $STATUS" + + if [ "$STATUS" == "completed" ]; then + if [ "$CONCLUSION" == "success" ]; then + echo "Vercel deployment check completed successfully." + break + else + echo "Vercel deployment check failed." + exit 1 + fi + fi else - echo "Deployment not yet accessible (status code: $STATUS_CODE). Waiting..." - sleep $SLEEP_TIME - ATTEMPTS=$((ATTEMPTS + 1)) + echo "Vercel check not found. Waiting..." fi + + sleep $SLEEP_TIME + ATTEMPTS=$((ATTEMPTS + 1)) done if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then - echo "Deployment did not become accessible within the expected time." + echo "Vercel deployment check did not complete within expected time." exit 1 fi @@ -107,7 +132,7 @@ jobs: for FILE in $CHANGED_FILES; do # Remove 'website/docs/' prefix FILE_PATH="${FILE#website/docs/}" - # Remove the .md extension as per your desired output + # Remove the .md extension FILE_PATH="${FILE_PATH%.md}" # Construct the full URL @@ -122,11 +147,16 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: Post comment with deployment link - uses: peter-evans/create-or-update-comment@v4 + uses: actions/github-script@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | - - 🚀 Deployment available! Here are the direct links to the updated files: - ${{ steps.links.outputs.links }} + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { github, context } = require('@actions/github'); + const issue_number = context.payload.pull_request.number; + const links = `\n${{ steps.links.outputs.links }}`; + const body = `\n🚀 Deployment available! Here are the direct links to the updated files:${links}`; + await github.rest.issues.createComment({ + ...context.repo, + issue_number, + body: body + }); From 906cb2b78a5f7297528cc6bd89b1d4eb928c3796 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Tue, 24 Sep 2024 15:04:33 +0100 Subject: [PATCH 496/526] add --- .github/workflows/preview-link.yml | 72 +++++++++--------------------- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 32c6445c05e..84f7d187ac7 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -13,7 +13,6 @@ on: permissions: contents: read pull-requests: write - checks: read # Added permission to read checks jobs: comment-deployment-link: @@ -47,54 +46,30 @@ jobs: echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT - - name: Wait for Vercel deployment check to complete - id: wait_for_vercel - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Wait for deployment to be accessible + id: wait_for_deployment run: | - # Set variables - COMMIT_SHA="${{ github.event.pull_request.head.sha }}" - REPO="${{ github.repository }}" - - echo "Waiting for Vercel deployment check to complete..." + DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" + echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." - MAX_ATTEMPTS=60 # Adjust as needed + MAX_ATTEMPTS=60 # Adjust as needed (e.g., wait up to 10 minutes) SLEEP_TIME=10 # Check every 10 seconds ATTEMPTS=0 while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do - # Get the check runs for the commit - CHECK_RUNS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ - "https://api.github.com/repos/$REPO/commits/$COMMIT_SHA/check-runs") - - # Filter for the Vercel check run - VERCEL_CHECK=$(echo "$CHECK_RUNS" | jq -r '.check_runs[] | select(.name == "Vercel")') - - if [ -n "$VERCEL_CHECK" ]; then - STATUS=$(echo "$VERCEL_CHECK" | jq -r '.status') - CONCLUSION=$(echo "$VERCEL_CHECK" | jq -r '.conclusion') - - echo "Vercel check status: $STATUS" - - if [ "$STATUS" == "completed" ]; then - if [ "$CONCLUSION" == "success" ]; then - echo "Vercel deployment check completed successfully." - break - else - echo "Vercel deployment check failed." - exit 1 - fi - fi + STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOYMENT_URL") + if [ "$STATUS_CODE" -eq 200 ]; then + echo "Deployment is accessible." + break else - echo "Vercel check not found. Waiting..." + echo "Deployment not yet accessible (status code: $STATUS_CODE). Waiting..." + sleep $SLEEP_TIME + ATTEMPTS=$((ATTEMPTS + 1)) fi - - sleep $SLEEP_TIME - ATTEMPTS=$((ATTEMPTS + 1)) done if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then - echo "Vercel deployment check did not complete within expected time." + echo "Deployment did not become accessible within the expected time." exit 1 fi @@ -132,7 +107,7 @@ jobs: for FILE in $CHANGED_FILES; do # Remove 'website/docs/' prefix FILE_PATH="${FILE#website/docs/}" - # Remove the .md extension + # Remove the .md extension as per your desired output FILE_PATH="${FILE_PATH%.md}" # Construct the full URL @@ -147,16 +122,11 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: Post comment with deployment link - uses: actions/github-script@v6 + uses: peter-evans/create-or-update-comment@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { github, context } = require('@actions/github'); - const issue_number = context.payload.pull_request.number; - const links = `\n${{ steps.links.outputs.links }}`; - const body = `\n🚀 Deployment available! Here are the direct links to the updated files:${links}`; - await github.rest.issues.createComment({ - ...context.repo, - issue_number, - body: body - }); + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + + 🚀 Deployment available! Here are the direct links to the updated files: + ${{ steps.links.outputs.links }} From 9eb8d033bdab7eb58486a2a5da8e6290a42ae0c6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 15:10:15 +0100 Subject: [PATCH 497/526] add --- .github/workflows/preview-link.yml | 59 +++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 84f7d187ac7..2c33a41c169 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -13,6 +13,7 @@ on: permissions: contents: read pull-requests: write + checks: write # Added permission for creating check runs jobs: comment-deployment-link: @@ -112,7 +113,7 @@ jobs: # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" - LINKS="$LINKS\n- $FULL_URL" + LINKS="$LINKS\n- [$FILE_PATH]($FULL_URL)" done fi @@ -121,12 +122,52 @@ jobs: echo -e "$LINKS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Post comment with deployment link - uses: peter-evans/create-or-update-comment@v4 + - name: Post deployment links in a check run + uses: actions/github-script@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | - - 🚀 Deployment available! Here are the direct links to the updated files: - ${{ steps.links.outputs.links }} + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const deploymentUrl = `🚀 Deployment available at: [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }})`; + + const links = `Here are the direct links to the updated files:\n${{ steps.links.outputs.links }}`; + + const summary = `${deploymentUrl}\n\n${links}`; + + // Check if a check run already exists + const checkRuns = await github.checks.listForRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: context.payload.pull_request.head.sha, + }); + + const existingCheckRun = checkRuns.data.check_runs.find( + (run) => run.name === 'Vercel Deployment Preview' + ); + + if (existingCheckRun) { + // Update the existing check run + await github.checks.update({ + owner: context.repo.owner, + repo: context.repo.repo, + check_run_id: existingCheckRun.id, + output: { + title: 'Vercel Deployment Preview', + summary: summary, + }, + conclusion: 'success', + }); + } else { + // Create a new check run + await github.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: 'Vercel Deployment Preview', + head_sha: context.payload.pull_request.head.sha, + status: 'completed', + conclusion: 'success', + output: { + title: 'Vercel Deployment Preview', + summary: summary, + }, + }); + } From e073651171e638e20e4776466b007fcb1fce19b9 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 15:15:28 +0100 Subject: [PATCH 498/526] add --- .github/workflows/preview-link.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 2c33a41c169..f0123233b01 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -128,25 +128,25 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const deploymentUrl = `🚀 Deployment available at: [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }})`; - + const links = `Here are the direct links to the updated files:\n${{ steps.links.outputs.links }}`; - + const summary = `${deploymentUrl}\n\n${links}`; - - // Check if a check run already exists - const checkRuns = await github.checks.listForRef({ + + // Access octokit.rest instead of github + const checkRuns = await octokit.rest.checks.listForRef({ owner: context.repo.owner, repo: context.repo.repo, ref: context.payload.pull_request.head.sha, }); - + const existingCheckRun = checkRuns.data.check_runs.find( (run) => run.name === 'Vercel Deployment Preview' ); - + if (existingCheckRun) { // Update the existing check run - await github.checks.update({ + await octokit.rest.checks.update({ owner: context.repo.owner, repo: context.repo.repo, check_run_id: existingCheckRun.id, @@ -158,7 +158,7 @@ jobs: }); } else { // Create a new check run - await github.checks.create({ + await octokit.rest.checks.create({ owner: context.repo.owner, repo: context.repo.repo, name: 'Vercel Deployment Preview', @@ -171,3 +171,4 @@ jobs: }, }); } + \ No newline at end of file From 7d62b078d781858599ed0150f272141306b717f1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 15:47:07 +0100 Subject: [PATCH 499/526] add --- .github/workflows/preview-link.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index f0123233b01..1fc877fa8e1 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -13,7 +13,7 @@ on: permissions: contents: read pull-requests: write - checks: write # Added permission for creating check runs + checks: write # Ensure this permission is set jobs: comment-deployment-link: @@ -128,25 +128,25 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const deploymentUrl = `🚀 Deployment available at: [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }})`; - + const links = `Here are the direct links to the updated files:\n${{ steps.links.outputs.links }}`; - + const summary = `${deploymentUrl}\n\n${links}`; - - // Access octokit.rest instead of github - const checkRuns = await octokit.rest.checks.listForRef({ + + // Access github.rest instead of octokit + const checkRuns = await github.rest.checks.listForRef({ owner: context.repo.owner, repo: context.repo.repo, ref: context.payload.pull_request.head.sha, }); - + const existingCheckRun = checkRuns.data.check_runs.find( (run) => run.name === 'Vercel Deployment Preview' ); - + if (existingCheckRun) { // Update the existing check run - await octokit.rest.checks.update({ + await github.rest.checks.update({ owner: context.repo.owner, repo: context.repo.repo, check_run_id: existingCheckRun.id, @@ -158,7 +158,7 @@ jobs: }); } else { // Create a new check run - await octokit.rest.checks.create({ + await github.rest.checks.create({ owner: context.repo.owner, repo: context.repo.repo, name: 'Vercel Deployment Preview', @@ -171,4 +171,3 @@ jobs: }, }); } - \ No newline at end of file From 6a9e9bbeb3306ea107314218ac63b43ac12b238c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:03:28 +0100 Subject: [PATCH 500/526] add --- .github/workflows/preview-link.yml | 80 +++++++++--------------------- 1 file changed, 24 insertions(+), 56 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 1fc877fa8e1..7102fa35da7 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -11,12 +11,11 @@ on: - 'website/docs/reference/**' permissions: - contents: read + contents: write pull-requests: write - checks: write # Ensure this permission is set jobs: - comment-deployment-link: + update-pr-description: runs-on: ubuntu-latest steps: @@ -53,7 +52,7 @@ jobs: DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." - MAX_ATTEMPTS=60 # Adjust as needed (e.g., wait up to 10 minutes) + MAX_ATTEMPTS=60 # Wait up to 10 minutes SLEEP_TIME=10 # Check every 10 seconds ATTEMPTS=0 @@ -104,17 +103,18 @@ jobs: else LINKS="" # Convert CHANGED_FILES back to newline-separated for processing - CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ' ' '\n') - for FILE in $CHANGED_FILES; do + echo "$CHANGED_FILES" | tr ' ' '\n' > files.txt + while IFS= read -r FILE; do # Remove 'website/docs/' prefix FILE_PATH="${FILE#website/docs/}" - # Remove the .md extension as per your desired output + # Remove the .md extension FILE_PATH="${FILE_PATH%.md}" # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" LINKS="$LINKS\n- [$FILE_PATH]($FULL_URL)" - done + done < files.txt + rm files.txt fi # Properly set the multi-line output @@ -122,52 +122,20 @@ jobs: echo -e "$LINKS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Post deployment links in a check run - uses: actions/github-script@v6 + - name: Update PR description with deployment links + uses: peter-evans/pull-request-description@v2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const deploymentUrl = `🚀 Deployment available at: [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }})`; - - const links = `Here are the direct links to the updated files:\n${{ steps.links.outputs.links }}`; - - const summary = `${deploymentUrl}\n\n${links}`; - - // Access github.rest instead of octokit - const checkRuns = await github.rest.checks.listForRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: context.payload.pull_request.head.sha, - }); - - const existingCheckRun = checkRuns.data.check_runs.find( - (run) => run.name === 'Vercel Deployment Preview' - ); - - if (existingCheckRun) { - // Update the existing check run - await github.rest.checks.update({ - owner: context.repo.owner, - repo: context.repo.repo, - check_run_id: existingCheckRun.id, - output: { - title: 'Vercel Deployment Preview', - summary: summary, - }, - conclusion: 'success', - }); - } else { - // Create a new check run - await github.rest.checks.create({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'Vercel Deployment Preview', - head_sha: context.payload.pull_request.head.sha, - status: 'completed', - conclusion: 'success', - output: { - title: 'Vercel Deployment Preview', - summary: summary, - }, - }); - } + token: ${{ secrets.GITHUB_TOKEN }} + prepend: | + + + 🚀 **Deployment Preview Available!** + + **Deployment URL:** [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }}) + + **Direct links to the updated files:** + ${{ steps.links.outputs.links }} + + --- + + retain-cycles: 1 From cc05bcfda028d5fff782f35cedcc200a350ea786 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:10:35 +0100 Subject: [PATCH 501/526] add --- .github/workflows/preview-link.yml | 55 +++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 7102fa35da7..38f97a65773 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -21,8 +21,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Install necessary tools run: | @@ -35,11 +33,8 @@ jobs: # Get the branch name BRANCH_NAME="${{ github.head_ref }}" - # Convert to lowercase - BRANCH_NAME_LOWER=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]') - - # Replace non-alphanumeric characters with hyphens - BRANCH_NAME_SANITIZED=$(echo "$BRANCH_NAME_LOWER" | sed 's/[^a-z0-9]/-/g') + # Convert to lowercase and sanitize branch name + BRANCH_NAME_SANITIZED=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g') # Construct the deployment URL DEPLOYMENT_URL="https://docs-getdbt-com-git-${BRANCH_NAME_SANITIZED}-dbt-labs.vercel.app" @@ -77,7 +72,7 @@ jobs: id: files run: | # Get the list of changed files in the specified directories - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) + CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) echo "Changed files:" echo "$CHANGED_FILES" @@ -123,19 +118,45 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: Update PR description with deployment links - uses: peter-evans/pull-request-description@v2 + uses: actions/github-script@v6 with: - token: ${{ secrets.GITHUB_TOKEN }} - prepend: | - + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prNumber = context.issue.number; - 🚀 **Deployment Preview Available!** + // Fetch the current PR description + const { data: pullRequest } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber, + }); - **Deployment URL:** [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }}) + let body = pullRequest.body || ''; + + // Define the markers + const startMarker = ''; + const endMarker = ''; + // Build the deployment content + const deploymentContent = `${startMarker} + 🚀 **Deployment Preview Available!** + **Deployment URL:** [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }}) **Direct links to the updated files:** ${{ steps.links.outputs.links }} - --- - - retain-cycles: 1 + ${endMarker}`; + + // Remove existing deployment content between markers + const regex = new RegExp(`${startMarker}[\\s\\S]*?${endMarker}`, 'g'); + body = body.replace(regex, '').trim(); + + // Prepend the new deployment content + body = `${deploymentContent}\n\n${body}`; + + // Update the PR description + await github.rest.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber, + body: body, + }); From 59069e14602bf8d16fc9f4a7a7bba4933fd7d958 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:14:12 +0100 Subject: [PATCH 502/526] add --- .github/workflows/preview-link.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 38f97a65773..9c54ca61555 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -139,8 +139,8 @@ jobs: // Build the deployment content const deploymentContent = `${startMarker} - 🚀 **Deployment Preview Available!** - **Deployment URL:** [${{ steps.vercel_url.outputs.deployment_url }}](${{ steps.vercel_url.outputs.deployment_url }}) + 🚀 **Deployment preview available!** + **Deployment URLs:** [${{ steps.links.outputs.links }}](${{ steps.links.outputs.links }}) **Direct links to the updated files:** ${{ steps.links.outputs.links }} --- From 37ad7decdeb1238f1175fd013d5d11f6857a2307 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:19:06 +0100 Subject: [PATCH 503/526] add --- .github/workflows/preview-link.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 9c54ca61555..6d3803a2026 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -140,9 +140,9 @@ jobs: // Build the deployment content const deploymentContent = `${startMarker} 🚀 **Deployment preview available!** - **Deployment URLs:** [${{ steps.links.outputs.links }}](${{ steps.links.outputs.links }}) + **Deployment URL:** [${inputs.deployment_url}](${inputs.deployment_url}) **Direct links to the updated files:** - ${{ steps.links.outputs.links }} + ${inputs.links} --- ${endMarker}`; @@ -160,3 +160,5 @@ jobs: pull_number: prNumber, body: body, }); + deployment_url: ${{ steps.vercel_url.outputs.deployment_url }} + links: ${{ steps.links.outputs.links }} From bc8474dba87bbc31a39fbdb1f5bee6f86b377b98 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:30:42 +0100 Subject: [PATCH 504/526] add --- .github/workflows/preview-link.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 6d3803a2026..c44604407e0 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -121,6 +121,8 @@ jobs: uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} + deployment_url: ${{ steps.vercel_url.outputs.deployment_url }} + links: ${{ steps.links.outputs.links }} script: | const prNumber = context.issue.number; @@ -160,5 +162,3 @@ jobs: pull_number: prNumber, body: body, }); - deployment_url: ${{ steps.vercel_url.outputs.deployment_url }} - links: ${{ steps.links.outputs.links }} From 964fc6d884131256c4b1e283404947d1cd585b1a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:34:02 +0100 Subject: [PATCH 505/526] add --- .github/workflows/preview-link.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index c44604407e0..04c97f4bdae 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -121,8 +121,6 @@ jobs: uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} - deployment_url: ${{ steps.vercel_url.outputs.deployment_url }} - links: ${{ steps.links.outputs.links }} script: | const prNumber = context.issue.number; @@ -139,12 +137,17 @@ jobs: const startMarker = ''; const endMarker = ''; + // Get the deployment URL and links from environment variables + const deploymentUrl = process.env.DEPLOYMENT_URL; + const links = process.env.LINKS; + // Build the deployment content const deploymentContent = `${startMarker} 🚀 **Deployment preview available!** - **Deployment URL:** [${inputs.deployment_url}](${inputs.deployment_url}) + **Deployment URL:** [${deploymentUrl}](${deploymentUrl}) + **Direct links to the updated files:** - ${inputs.links} + ${links} --- ${endMarker}`; @@ -162,3 +165,6 @@ jobs: pull_number: prNumber, body: body, }); + env: + DEPLOYMENT_URL: ${{ steps.vercel_url.outputs.deployment_url }} + LINKS: ${{ steps.links.outputs.links }} From 9618c965d57a60803988b9b8b052bf5c876529f4 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:38:59 +0100 Subject: [PATCH 506/526] add --- .github/workflows/preview-link.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 04c97f4bdae..c11253676e6 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -21,6 +21,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install necessary tools run: | @@ -33,8 +35,11 @@ jobs: # Get the branch name BRANCH_NAME="${{ github.head_ref }}" - # Convert to lowercase and sanitize branch name - BRANCH_NAME_SANITIZED=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g') + # Convert to lowercase + BRANCH_NAME_LOWER=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]') + + # Replace non-alphanumeric characters with hyphens + BRANCH_NAME_SANITIZED=$(echo "$BRANCH_NAME_LOWER" | sed 's/[^a-z0-9]/-/g') # Construct the deployment URL DEPLOYMENT_URL="https://docs-getdbt-com-git-${BRANCH_NAME_SANITIZED}-dbt-labs.vercel.app" @@ -72,7 +77,7 @@ jobs: id: files run: | # Get the list of changed files in the specified directories - CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) echo "Changed files:" echo "$CHANGED_FILES" @@ -94,12 +99,12 @@ jobs: if [ -z "$CHANGED_FILES" ]; then echo "No changed files found in the specified directories." - LINKS="- No documentation files were changed." + LINKS="No documentation files were changed." else LINKS="" # Convert CHANGED_FILES back to newline-separated for processing - echo "$CHANGED_FILES" | tr ' ' '\n' > files.txt - while IFS= read -r FILE; do + CHANGED_FILES=$(echo "$CHANGED_FILES" | tr ' ' '\n') + for FILE in $CHANGED_FILES; do # Remove 'website/docs/' prefix FILE_PATH="${FILE#website/docs/}" # Remove the .md extension @@ -107,9 +112,8 @@ jobs: # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" - LINKS="$LINKS\n- [$FILE_PATH]($FULL_URL)" - done < files.txt - rm files.txt + LINKS="$LINKS\n$FULL_URL" + done fi # Properly set the multi-line output @@ -143,10 +147,7 @@ jobs: // Build the deployment content const deploymentContent = `${startMarker} - 🚀 **Deployment preview available!** - **Deployment URL:** [${deploymentUrl}](${deploymentUrl}) - - **Direct links to the updated files:** + 🚀 Deployment available! Here are the direct links to the updated files: ${links} --- ${endMarker}`; From d3bbee0c1928636c068f989f549f90b302bea7d1 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:43:54 +0100 Subject: [PATCH 507/526] add --- .github/workflows/preview-link.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index c11253676e6..5561d1a916d 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -112,7 +112,7 @@ jobs: # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" - LINKS="$LINKS\n$FULL_URL" + LINKS="$LINKS\n- $FULL_URL" done fi @@ -145,12 +145,16 @@ jobs: const deploymentUrl = process.env.DEPLOYMENT_URL; const links = process.env.LINKS; - // Build the deployment content - const deploymentContent = `${startMarker} - 🚀 Deployment available! Here are the direct links to the updated files: - ${links} - --- - ${endMarker}`; + // Build the deployment content without leading whitespace + const deploymentContent = [ + `${startMarker}`, + '🚀 Deployment available! Here are the direct links to the updated files:', + '', + `${links}`, + '', + '---', + `${endMarker}` + ].join('\n'); // Remove existing deployment content between markers const regex = new RegExp(`${startMarker}[\\s\\S]*?${endMarker}`, 'g'); From 48ed9db426bdd3f6f0bb66d5c659bb8578726408 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:58:21 +0100 Subject: [PATCH 508/526] add --- .github/workflows/preview-link.yml | 46 +++++++----------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 5561d1a916d..2eed7fdf284 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -4,11 +4,7 @@ on: pull_request: types: [opened, synchronize] paths: - - 'website/docs/docs/**' - - 'website/docs/best-practices/**' - - 'website/docs/guides/**' - - 'website/docs/faqs/**' - - 'website/docs/reference/**' + - 'website/docs/**' permissions: contents: write @@ -49,29 +45,8 @@ jobs: - name: Wait for deployment to be accessible id: wait_for_deployment run: | - DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" - echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." - - MAX_ATTEMPTS=60 # Wait up to 10 minutes - SLEEP_TIME=10 # Check every 10 seconds - ATTEMPTS=0 - - while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do - STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOYMENT_URL") - if [ "$STATUS_CODE" -eq 200 ]; then - echo "Deployment is accessible." - break - else - echo "Deployment not yet accessible (status code: $STATUS_CODE). Waiting..." - sleep $SLEEP_TIME - ATTEMPTS=$((ATTEMPTS + 1)) - fi - done - - if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then - echo "Deployment did not become accessible within the expected time." - exit 1 - fi + echo "Waiting for 5 minutes to allow the deployment to complete..." + sleep 300 # Wait for 300 seconds (5 minutes) - name: Get changed files id: files @@ -112,7 +87,7 @@ jobs: # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" - LINKS="$LINKS\n- $FULL_URL" + LINKS="$LINKS\n$FULL_URL" done fi @@ -148,11 +123,12 @@ jobs: // Build the deployment content without leading whitespace const deploymentContent = [ `${startMarker}`, + '', + '---', '🚀 Deployment available! Here are the direct links to the updated files:', '', `${links}`, '', - '---', `${endMarker}` ].join('\n'); @@ -160,8 +136,8 @@ jobs: const regex = new RegExp(`${startMarker}[\\s\\S]*?${endMarker}`, 'g'); body = body.replace(regex, '').trim(); - // Prepend the new deployment content - body = `${deploymentContent}\n\n${body}`; + // Append the new deployment content + body = `${body}\n\n${deploymentContent}`; // Update the PR description await github.rest.pulls.update({ @@ -170,6 +146,6 @@ jobs: pull_number: prNumber, body: body, }); - env: - DEPLOYMENT_URL: ${{ steps.vercel_url.outputs.deployment_url }} - LINKS: ${{ steps.links.outputs.links }} + env: + DEPLOYMENT_URL: ${{ steps.vercel_url.outputs.deployment_url }} + LINKS: ${{ steps.links.outputs.links }} From 8c6c6171b225ae544808517547adc0406bcbcdbd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 16:58:58 +0100 Subject: [PATCH 509/526] add --- .github/workflows/preview-link.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 2eed7fdf284..5b28c19757d 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -4,7 +4,11 @@ on: pull_request: types: [opened, synchronize] paths: - - 'website/docs/**' + - 'website/docs/docs/**' + - 'website/docs/best-practices/**' + - 'website/docs/guides/**' + - 'website/docs/faqs/**' + - 'website/docs/reference/**' permissions: contents: write From 0e407fac77b85fc41ca5cbf2d16a21bca0635c86 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 25 Sep 2024 17:07:25 +0100 Subject: [PATCH 510/526] add --- .github/workflows/preview-link.yml | 36 +++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 5b28c19757d..8ea9a99aab8 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -49,8 +49,29 @@ jobs: - name: Wait for deployment to be accessible id: wait_for_deployment run: | - echo "Waiting for 5 minutes to allow the deployment to complete..." - sleep 300 # Wait for 300 seconds (5 minutes) + DEPLOYMENT_URL="${{ steps.vercel_url.outputs.deployment_url }}" + echo "Waiting for deployment at $DEPLOYMENT_URL to become accessible..." + + MAX_ATTEMPTS=60 # Wait up to 10 minutes + SLEEP_TIME=10 # Check every 10 seconds + ATTEMPTS=0 + + while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do + STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOYMENT_URL") + if [ "$STATUS_CODE" -eq 200 ]; then + echo "Deployment is accessible." + break + else + echo "Deployment not yet accessible (status code: $STATUS_CODE). Waiting..." + sleep $SLEEP_TIME + ATTEMPTS=$((ATTEMPTS + 1)) + fi + done + + if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then + echo "Deployment did not become accessible within the expected time." + exit 1 + fi - name: Get changed files id: files @@ -91,7 +112,7 @@ jobs: # Construct the full URL FULL_URL="$DEPLOYMENT_URL/$FILE_PATH" - LINKS="$LINKS\n$FULL_URL" + LINKS="$LINKS\n- $FULL_URL" done fi @@ -127,12 +148,11 @@ jobs: // Build the deployment content without leading whitespace const deploymentContent = [ `${startMarker}`, - '', - '---', '🚀 Deployment available! Here are the direct links to the updated files:', '', `${links}`, '', + '---', `${endMarker}` ].join('\n'); @@ -150,6 +170,6 @@ jobs: pull_number: prNumber, body: body, }); - env: - DEPLOYMENT_URL: ${{ steps.vercel_url.outputs.deployment_url }} - LINKS: ${{ steps.links.outputs.links }} + env: + DEPLOYMENT_URL: ${{ steps.vercel_url.outputs.deployment_url }} + LINKS: ${{ steps.links.outputs.links }} From b3c877bad723fff2f8544394677ac974b648215f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 10:50:05 +0100 Subject: [PATCH 511/526] update accepted --- styles/Vocab/EN/accept.txt | 25 ++++++++++++++++++++++--- styles/custom/UIElements.yml | 17 ----------------- 2 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 styles/custom/UIElements.yml diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 3cad2eae559..585a063a59d 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -48,9 +48,9 @@ pseudocolumn \]+> -\w+-\w+ -\w+/\w+ +<[^>]+> < !-- allows tabs --> +\w+-\w+ +\w+/\w+ n/a N/A \w+/\w+|\w+-\w+|n/a @@ -64,3 +64,22 @@ gcloud MSFT shoutout DDL +DWUs +DWU +APIs +API +:::caution +:::info +:::tip +:::note +:::warning +ing +ETL +ELT +SSIS +PBI +PowerBI +datetime +PySpark +\b[a-z]+(?:_[a-z]+)*\b +\b[A-Z]{2,}(?:/[A-Z]{2,})?\b <-- This should allow acronyms like API, AI/ML --> diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml deleted file mode 100644 index 2f9a22206f0..00000000000 --- a/styles/custom/UIElements.yml +++ /dev/null @@ -1,17 +0,0 @@ -# styles/custom/BoldUIElements.yml -extends: existence -message: "UI elements like '%s' should be bold." -level: warning -tokens: - # Only match UI elements that are not bolded (i.e., not within **) - - '\bSave\b' - - '\bSave as\b' - - '\bCancel\b' - - '\bSubmit\b' - - '\bEdit\b' - - '\bAccount settings\b' - - '\bProject details\b' - - '\bProfile settings\b' - - '\bPersonal profile\b' - -scope: raw # Ensure the rule is applied before formatting From f6248ce827a373dc4143552ab2894f23f6a98e30 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 10:57:07 +0100 Subject: [PATCH 512/526] update accepted --- styles/Vocab/EN/accept.txt | 6 +++--- styles/Vocab/EN/reject.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 585a063a59d..8c6c01e538d 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -48,7 +48,7 @@ pseudocolumn \]+> < !-- allows tabs --> +<[^>]+> < !-- allows tags --> \w+-\w+ \w+/\w+ n/a @@ -81,5 +81,5 @@ PBI PowerBI datetime PySpark -\b[a-z]+(?:_[a-z]+)*\b -\b[A-Z]{2,}(?:/[A-Z]{2,})?\b <-- This should allow acronyms like API, AI/ML --> +\b[a-z]+(?:_[a-z]+)*\b +\b[A-Z]{2,}(?:/[A-Z]{2,})?\b diff --git a/styles/Vocab/EN/reject.txt b/styles/Vocab/EN/reject.txt index bc8d1020ec2..957b825ee6d 100644 --- a/styles/Vocab/EN/reject.txt +++ b/styles/Vocab/EN/reject.txt @@ -6,3 +6,4 @@ DBT DBT-tonic DBTonic DBT Mesh +\b\w+\s{2,}\w+\b From 8f47902f99ef07b36e6165735fce0e8cdd9ddb7c Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 11:36:48 +0100 Subject: [PATCH 513/526] update ui --- styles/custom/UIElements.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 styles/custom/UIElements.yml diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml new file mode 100644 index 00000000000..adcda09e000 --- /dev/null +++ b/styles/custom/UIElements.yml @@ -0,0 +1,17 @@ +# styles/custom/BoldUIElements.yml +extends: existence +message: "UI elements like '%s' should be bold." +level: warning +tokens: + # Match UI elements that are not bolded (i.e., not within **), but exclude those starting a sentence + - '(? Date: Fri, 27 Sep 2024 11:37:34 +0100 Subject: [PATCH 514/526] update ui --- styles/custom/LatinAbbreviations.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/styles/custom/LatinAbbreviations.yml b/styles/custom/LatinAbbreviations.yml index 402ac42252b..f5962273440 100644 --- a/styles/custom/LatinAbbreviations.yml +++ b/styles/custom/LatinAbbreviations.yml @@ -6,6 +6,7 @@ ignorecase: false swap: - e.g.: for example - eg: for example + - e.g: for example - i.e.: for example - i.e.: that is - etc.: and so on From 1ebf7392dff7bc027a8a76fc6d7b875ec0839b7e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 11:46:32 +0100 Subject: [PATCH 515/526] update header --- styles/custom/SentenceCaseHeaders.yml | 25 ++++++++++++++++++++++++- styles/custom/UIElements.yml | 20 ++++++++++---------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index b98d307fd6f..d3b0b9cfdc0 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -2,7 +2,7 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." level: warning scope: heading -match: $sentence +match: $sentence # enforce sentence-style capitalization for headers indicators: - ":" exceptions: @@ -11,3 +11,26 @@ exceptions: - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - '\bdbt\s+.*?\b' + - Snowflake + - Databricks + - Azure + - GCP + - AWS + - SQL + - CLI + - API + - YAML + - JSON + - HTML + - Redshift + - Google + - BigQuery + - SnowSQL + - Snowsight + - Snowpark + - Fabric + - Microsoft + - Postgres + - Explorer + - IDE + - diff --git a/styles/custom/UIElements.yml b/styles/custom/UIElements.yml index adcda09e000..f78a15af4b4 100644 --- a/styles/custom/UIElements.yml +++ b/styles/custom/UIElements.yml @@ -3,15 +3,15 @@ extends: existence message: "UI elements like '%s' should be bold." level: warning tokens: - # Match UI elements that are not bolded (i.e., not within **), but exclude those starting a sentence - - '(? Date: Fri, 27 Sep 2024 11:49:15 +0100 Subject: [PATCH 516/526] update accept --- styles/Vocab/EN/accept.txt | 51 +++++++++++--------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 8c6c01e538d..d4b1a01926d 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -1,3 +1,4 @@ +# Proper nouns and terms that should always be accepted dbt Cloud dbt Core dbt Semantic Layer @@ -7,16 +8,12 @@ dbt-tonic dbtonic IDE CLI -Config -config -configs +Config # Proper noun capitalization info docs -doc yaml YAML SQL -sql bash shell MetricFlow @@ -24,14 +21,8 @@ jinja jinja2 sqlmesh Snowflake -dbt Mesh -dbt mesh -mesh -Snowflake Databricks Fabric -ETL -ETL Redshift Azure DevOps @@ -42,44 +33,30 @@ CSV S3 SCD repo -YAML -YML -pseudocolumn -\]+> < !-- allows tags --> -\w+-\w+ -\w+/\w+ -n/a -N/A -\w+/\w+|\w+-\w+|n/a boolean defaultValue= DWH -DWHs ADF BQ gcloud MSFT -shoutout DDL -DWUs -DWU APIs API +datetime +PySpark :::caution +:::note :::info :::tip -:::note :::warning -ing -ETL -ELT -SSIS -PBI -PowerBI -datetime -PySpark -\b[a-z]+(?:_[a-z]+)*\b -\b[A-Z]{2,}(?:/[A-Z]{2,})?\b + +# Regex patterns to allow specific formats +\<[^>]+\> # Allows HTML-like tags +\b[a-z]+(?:_[a-z]+)*\b # Allows snake_case words +\b[A-Z]{2,}(?:/[A-Z]{2,})?\b # Allows acronyms like SQL, IDE +\w+-\w+ # Allows hyphenated words (e.g., dbt-core) +\w+/\w+ # Allows slash-separated words (e.g., API/CLI) +n/a +N/A From 80e769ef17fdfcc77d5e5d47e3fa196d6cc7c8fd Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 11:52:27 +0100 Subject: [PATCH 517/526] update accept --- styles/Vocab/EN/accept.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index d4b1a01926d..79d9429c51a 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -51,12 +51,10 @@ PySpark :::info :::tip :::warning - -# Regex patterns to allow specific formats -\<[^>]+\> # Allows HTML-like tags -\b[a-z]+(?:_[a-z]+)*\b # Allows snake_case words -\b[A-Z]{2,}(?:/[A-Z]{2,})?\b # Allows acronyms like SQL, IDE -\w+-\w+ # Allows hyphenated words (e.g., dbt-core) -\w+/\w+ # Allows slash-separated words (e.g., API/CLI) +\<[^>]+\> +\b[a-z]+(?:_[a-z]+)*\b +\b[A-Z]{2,}(?:/[A-Z]{2,})?\b +\w+-\w+ +\w+/\w+ n/a N/A From 709ee469faddfbce552024f38c28babb86c7eaee Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 11:54:41 +0100 Subject: [PATCH 518/526] update accept --- styles/Vocab/EN/accept.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 79d9429c51a..7579bd67c50 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -1,4 +1,3 @@ -# Proper nouns and terms that should always be accepted dbt Cloud dbt Core dbt Semantic Layer @@ -8,7 +7,7 @@ dbt-tonic dbtonic IDE CLI -Config # Proper noun capitalization +Config info docs yaml @@ -37,6 +36,8 @@ dbt_project.yml boolean defaultValue= DWH +DWUs +shoutout ADF BQ gcloud @@ -44,6 +45,9 @@ MSFT DDL APIs API +SSIS +PBI +PowerBI datetime PySpark :::caution @@ -58,3 +62,7 @@ PySpark \w+/\w+ n/a N/A +\ Date: Fri, 27 Sep 2024 12:03:25 +0100 Subject: [PATCH 519/526] update accept --- styles/custom/SentenceCaseHeaders.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/styles/custom/SentenceCaseHeaders.yml b/styles/custom/SentenceCaseHeaders.yml index d3b0b9cfdc0..d1d6cd97c67 100644 --- a/styles/custom/SentenceCaseHeaders.yml +++ b/styles/custom/SentenceCaseHeaders.yml @@ -2,7 +2,7 @@ extends: capitalization message: "'%s' should use sentence-style capitalization. Try '%s' instead." level: warning scope: heading -match: $sentence # enforce sentence-style capitalization for headers +match: $sentence # Enforces sentence-style capitalization indicators: - ":" exceptions: @@ -10,7 +10,6 @@ exceptions: - '\bdbt\s+Cloud\b' - '\bdbt\s+Core\b' - '\bdbt\s+Cloud\s+CLI\b' - - '\bdbt\s+.*?\b' - Snowflake - Databricks - Azure @@ -33,4 +32,3 @@ exceptions: - Postgres - Explorer - IDE - - From e2f8c195d80d0d50b0d0502f2e2b50ef46697cb6 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 12:14:30 +0100 Subject: [PATCH 520/526] update accept --- styles/Vocab/EN/accept.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/styles/Vocab/EN/accept.txt b/styles/Vocab/EN/accept.txt index 7579bd67c50..e673e2ef83d 100644 --- a/styles/Vocab/EN/accept.txt +++ b/styles/Vocab/EN/accept.txt @@ -56,7 +56,6 @@ PySpark :::tip :::warning \<[^>]+\> -\b[a-z]+(?:_[a-z]+)*\b \b[A-Z]{2,}(?:/[A-Z]{2,})?\b \w+-\w+ \w+/\w+ From c7e41954cf4af9136a1522766103cc6104daa67a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Sep 2024 13:27:02 +0100 Subject: [PATCH 521/526] update accept --- .github/workflows/vale.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index f91f33ce03a..55bf36f229f 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -1,4 +1,4 @@ -name: Vale Linting +name: Vale linting on: pull_request: @@ -10,7 +10,7 @@ on: jobs: vale: - name: Vale Linting + name: Vale linting runs-on: ubuntu-latest steps: - name: Checkout code @@ -58,7 +58,7 @@ jobs: fi done - - name: Run Vale + - name: Run vale if: ${{ steps.changed-files.outputs.any_changed == 'true' }} uses: errata-ai/vale-action@reviewdog with: @@ -68,7 +68,7 @@ jobs: separator: ' ' version: '2.27.0' - - name: Post Summary Comment + - name: Post summary comment if: ${{ steps.changed-files.outputs.any_changed == 'true' }} run: | COMMENT="❗️Oh no, some Vale linting found issues! Please check the **Files change** tab for detailed results and make the necessary updates." From e0596c7367a896521590cbeaa47ee98357b4d642 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 4 Oct 2024 15:59:09 +0100 Subject: [PATCH 522/526] update --- .github/workflows/preview-link.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 8ea9a99aab8..8c5bb7d6dea 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -76,18 +76,12 @@ jobs: - name: Get changed files id: files run: | - # Get the list of changed files in the specified directories CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '^website/docs/(docs|best-practices|guides|faqs|reference)/.*\.md$' || true) - echo "Changed files:" - echo "$CHANGED_FILES" - - # Check if any files were changed if [ -z "$CHANGED_FILES" ]; then echo "No documentation files were changed." echo "changed_files=" >> $GITHUB_OUTPUT else - # Convert line-separated files to space-separated for easier handling - CHANGED_FILES="$(echo "$CHANGED_FILES" | tr '\n' ' ')" + CHANGED_FILES=$(echo "$CHANGED_FILES" | tr '\n' ' ') echo "changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT fi From 34b2ddb947d2ce2ce8be09b1170ad0c1f7438eb3 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 4 Oct 2024 16:05:31 +0100 Subject: [PATCH 523/526] add line --- .github/workflows/preview-link.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-link.yml b/.github/workflows/preview-link.yml index 8c5bb7d6dea..f128f44b8cd 100644 --- a/.github/workflows/preview-link.yml +++ b/.github/workflows/preview-link.yml @@ -142,11 +142,11 @@ jobs: // Build the deployment content without leading whitespace const deploymentContent = [ `${startMarker}`, + '---', '🚀 Deployment available! Here are the direct links to the updated files:', '', `${links}`, '', - '---', `${endMarker}` ].join('\n'); From 20a50a64f7bdabc28894e6f504f8e2fcdfe53dfe Mon Sep 17 00:00:00 2001 From: Joao Clemencio Date: Mon, 14 Oct 2024 21:21:12 +0100 Subject: [PATCH 524/526] Update link to Lightdash SL instructions --- website/snippets/_sl-partner-links.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/snippets/_sl-partner-links.md b/website/snippets/_sl-partner-links.md index 28e4dc24b39..dc102869c72 100644 --- a/website/snippets/_sl-partner-links.md +++ b/website/snippets/_sl-partner-links.md @@ -56,7 +56,7 @@ The following tools integrate with the dbt Semantic Layer: body="Check out how to connect, query, and consume reliable dbt metrics in real time " link="https://docs.lightdash.com/guides/dbt-semantic-layer/" icon="lightdash"/> - From ecf6e7af96395decfff0a0ade364bb5d162faf09 Mon Sep 17 00:00:00 2001 From: Joao Clemencio Date: Tue, 15 Oct 2024 09:24:46 +0100 Subject: [PATCH 525/526] Update Mode and Push.ai redirects to end URLs --- website/snippets/_sl-partner-links.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/snippets/_sl-partner-links.md b/website/snippets/_sl-partner-links.md index dc102869c72..ccb6be2ddbb 100644 --- a/website/snippets/_sl-partner-links.md +++ b/website/snippets/_sl-partner-links.md @@ -56,7 +56,7 @@ The following tools integrate with the dbt Semantic Layer: body="Check out how to connect, query, and consume reliable dbt metrics in real time " link="https://docs.lightdash.com/guides/dbt-semantic-layer/" icon="lightdash"/> - @@ -68,9 +68,9 @@ The following tools integrate with the dbt Semantic Layer: - @@ -82,9 +82,9 @@ The following tools integrate with the dbt Semantic Layer: - From 2bda1df5c7d00cd60118f9be179700e9c4cb35ac Mon Sep 17 00:00:00 2001 From: Joao Clemencio Date: Tue, 15 Oct 2024 09:27:10 +0100 Subject: [PATCH 526/526] Updating lightdash --- website/snippets/_sl-partner-links.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/snippets/_sl-partner-links.md b/website/snippets/_sl-partner-links.md index ccb6be2ddbb..aaefcc77747 100644 --- a/website/snippets/_sl-partner-links.md +++ b/website/snippets/_sl-partner-links.md @@ -54,9 +54,9 @@ The following tools integrate with the dbt Semantic Layer: -