Skip to content

Commit

Permalink
Add spelling checks to the workflow in GitHub Actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ydah committed Aug 26, 2022
1 parent 99bc4e2 commit e5b598f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdescribe
14 changes: 14 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CodeSpell
on:
- pull_request
jobs:
codespell:
name: CodeSpell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: CodeSpell
uses: codespell-project/actions-codespell@master
with:
check_filenames: true
ignore_words_file: .codespellignore
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
* Split `UnitSpecNaming` cop into `RSpecDescribeClass`, `RSpecDescribeMethod` and `RSpecFileName` and enabled them all by default. ([@geniou][])
* Add `RSpecExampleWording` cop to prevent to use of should at the beginning of the spec description. ([@geniou][])
* Fix `RSpecFileName` cop for non-class specs. ([@geniou][])
* Adapt `RSpecFileName` cop to commen naming convention and skip spec with multiple top level describes. ([@geniou][])
* Adapt `RSpecFileName` cop to common naming convention and skip spec with multiple top level describes. ([@geniou][])
* Add `RSpecMultipleDescribes` cop to check for multiple top level describes. ([@geniou][])
* Add `RSpecDescribedClass` to promote the use of `described_class`. ([@geniou][])
* Add `RSpecInstanceVariable` cop to check for the usage of instance variables. ([@geniou][])
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/empty_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class EmptyExampleGroup < Base
# describe { it { i_run_as_well } }
#
# @example source that does not match
# before { it { whatever here wont run anyway } }
# before { it { whatever here won't run anyway } }
#
# @param node [RuboCop::AST::Node]
# @return [Array<RuboCop::AST::Node>] matching nodes
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/rspec/wording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def rewrite
attr_reader :text, :ignores, :replacements

def replace_prefix(pattern, replacement)
text.sub(pattern) do |shouldnt|
uppercase?(shouldnt) ? replacement.upcase : replacement
text.sub(pattern) do |matched|
uppercase?(matched) ? replacement.upcase : replacement
end
end

Expand Down

0 comments on commit e5b598f

Please sign in to comment.