Skip to content

Commit e5b598f

Browse files
committed
Add spelling checks to the workflow in GitHub Actions
We would like to leave it to codespell to verify the spelling of our code. I propose to use codespell-project/actions-codespell, now v1.0. https://github.com/codespell-project/actions-codespell
1 parent 99bc4e2 commit e5b598f

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.codespellignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xdescribe

.github/workflows/codespell.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CodeSpell
2+
on:
3+
- pull_request
4+
jobs:
5+
codespell:
6+
name: CodeSpell
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: CodeSpell
11+
uses: codespell-project/actions-codespell@master
12+
with:
13+
check_filenames: true
14+
ignore_words_file: .codespellignore

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
616616
* Split `UnitSpecNaming` cop into `RSpecDescribeClass`, `RSpecDescribeMethod` and `RSpecFileName` and enabled them all by default. ([@geniou][])
617617
* Add `RSpecExampleWording` cop to prevent to use of should at the beginning of the spec description. ([@geniou][])
618618
* Fix `RSpecFileName` cop for non-class specs. ([@geniou][])
619-
* Adapt `RSpecFileName` cop to commen naming convention and skip spec with multiple top level describes. ([@geniou][])
619+
* Adapt `RSpecFileName` cop to common naming convention and skip spec with multiple top level describes. ([@geniou][])
620620
* Add `RSpecMultipleDescribes` cop to check for multiple top level describes. ([@geniou][])
621621
* Add `RSpecDescribedClass` to promote the use of `described_class`. ([@geniou][])
622622
* Add `RSpecInstanceVariable` cop to check for the usage of instance variables. ([@geniou][])

lib/rubocop/cop/rspec/empty_example_group.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class EmptyExampleGroup < Base
123123
# describe { it { i_run_as_well } }
124124
#
125125
# @example source that does not match
126-
# before { it { whatever here wont run anyway } }
126+
# before { it { whatever here won't run anyway } }
127127
#
128128
# @param node [RuboCop::AST::Node]
129129
# @return [Array<RuboCop::AST::Node>] matching nodes

lib/rubocop/rspec/wording.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def rewrite
3131
attr_reader :text, :ignores, :replacements
3232

3333
def replace_prefix(pattern, replacement)
34-
text.sub(pattern) do |shouldnt|
35-
uppercase?(shouldnt) ? replacement.upcase : replacement
34+
text.sub(pattern) do |matched|
35+
uppercase?(matched) ? replacement.upcase : replacement
3636
end
3737
end
3838

0 commit comments

Comments
 (0)