From 0a9eaf3388c4893b66f410ab2757ed65cf2b9149 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 6 Oct 2024 19:33:37 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=85=20ci:=20add=20a=20spellcheck=20ty?= =?UTF-8?q?pos=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/typos.yml | 24 ++++++++++++++++++++++++ _typos.toml | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/typos.yml create mode 100644 _typos.toml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000..ba5aa7d1f --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,24 @@ +name: Check for typos + +on: + [pull_request, merge_group, workflow_dispatch] + +jobs: + check-typos: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: git fetch origin ${{ github.base_ref }} + + - name: Get a list of changed files + id: get_files + run: | + changed_files=$(git diff --name-only origin/${{ github.base_ref }} HEAD) + existing_files=$(echo "$changed_files" | xargs -I {} bash -c 'if [ -f "{}" ]; then echo "./{}"; fi') + echo "files=$existing_files" >> GITHUB_OUTPUT + + - name: Run spellcheck + uses: crate-ci/typos@v1.25.0 + with: + files: ${{ steps.get_files.outputs.files }} diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..38770ffe4 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,7 @@ +[files] +extend-exclude = ["tui/cool_tips.txt"] + +[default] +extend-ignore-identifiers-re = [ + "ratatui", +] From 4bcebf6f77a16d6b8e943ec261d788ea59a5e3dc Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 6 Oct 2024 19:39:28 +0200 Subject: [PATCH 2/2] remove changes files check --- .github/workflows/typos.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index ba5aa7d1f..901d5e71e 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -1,7 +1,7 @@ name: Check for typos on: - [pull_request, merge_group, workflow_dispatch] + [push, pull_request, workflow_dispatch] jobs: check-typos: @@ -11,14 +11,5 @@ jobs: - uses: actions/checkout@v4 - run: git fetch origin ${{ github.base_ref }} - - name: Get a list of changed files - id: get_files - run: | - changed_files=$(git diff --name-only origin/${{ github.base_ref }} HEAD) - existing_files=$(echo "$changed_files" | xargs -I {} bash -c 'if [ -f "{}" ]; then echo "./{}"; fi') - echo "files=$existing_files" >> GITHUB_OUTPUT - - name: Run spellcheck uses: crate-ci/typos@v1.25.0 - with: - files: ${{ steps.get_files.outputs.files }}