From dab7fcef69080e81c58c8ec28dbdf35544fe8f2d Mon Sep 17 00:00:00 2001 From: viralpraxis Date: Mon, 30 Dec 2024 01:54:59 +0300 Subject: [PATCH] Add spell checking to CI Based on https://github.com/rubocop/rubocop/blob/master/.github/workflows/spell_checking.yml. --- .github/workflows/spell_checking.yml | 30 +++++++++++++++++++ .../mutable_class_instance_variable_spec.rb | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/spell_checking.yml diff --git a/.github/workflows/spell_checking.yml b/.github/workflows/spell_checking.yml new file mode 100644 index 0000000..c5cf849 --- /dev/null +++ b/.github/workflows/spell_checking.yml @@ -0,0 +1,30 @@ +name: Spell Checking + +on: [pull_request] + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + codespell: + name: Check spelling of all files with codespell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + check_filenames: true + check_hidden: true + misspell: + name: Check spelling of all files in commit with misspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install + run: wget -O - -q https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | sh -s -- -b . + - name: Misspell + run: git ls-files --empty-directory | xargs ./misspell -error diff --git a/spec/rubocop/cop/thread_safety/mutable_class_instance_variable_spec.rb b/spec/rubocop/cop/thread_safety/mutable_class_instance_variable_spec.rb index 05535b4..155d327 100644 --- a/spec/rubocop/cop/thread_safety/mutable_class_instance_variable_spec.rb +++ b/spec/rubocop/cop/thread_safety/mutable_class_instance_variable_spec.rb @@ -131,7 +131,7 @@ def some_method it_behaves_like 'mutable objects', '%w(a b c)' it_behaves_like 'mutable objects', '{ a: 1, b: 2 }' it_behaves_like 'mutable objects', "'str'" - it_behaves_like 'mutable objects', %("\#{30 + 12}nd") + it_behaves_like 'mutable objects', %("\#{30 + 12}ok") it_behaves_like 'immutable objects', '1' it_behaves_like 'immutable objects', '2.1' @@ -391,7 +391,7 @@ def some_method it_behaves_like 'mutable objects', '%w(a b c)' it_behaves_like 'mutable objects', '{ a: 1, b: 2 }' it_behaves_like 'mutable objects', "'str'" - it_behaves_like 'mutable objects', %("\#{30 + 12}nd") + it_behaves_like 'mutable objects', %("\#{30 + 12}ok") it_behaves_like 'mutable objects', 'Something.new' it_behaves_like 'immutable objects', '1'