rubocop-rspec icon indicating copy to clipboard operation
rubocop-rspec copied to clipboard

Add `Suffixes` configuration option to `RSpec/ContextWording`

Open ydah opened this issue 2 years ago • 0 comments

Resolve: #1356

Concerns include the following: RSpec/ContextWording prefix match checking is strict as follows.

# for example - `Prefixes: [when]`
# good
context 'when something' do
end

# bad
context 'whenever something' do
end

In Japanese, each word is not separated by a space. Therefore, to check words such as those in the https://github.com/rubocop/rubocop-rspec/issues/1356 , the following will work differently for prefix and suffix.

# for example - `Suffixes: [if]`
# good
context 'something if' do
end

# good
context 'something serif' do
end

Before submitting the PR make sure the following are checked:

  • [x] Feature branch is up-to-date with master (if not - rebase it).
  • [x] Squashed related commits together.
  • [x] Added tests.
  • [x] Updated documentation.
  • [x] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • [x] The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

If you have created a new cop:

  • [-] Added the new cop to config/default.yml.
  • [-] The cop is configured as Enabled: pending in config/default.yml.
  • [-] The cop is configured as Enabled: true in .rubocop.yml.
  • [-] The cop documents examples of good and bad code.
  • [-] The tests assert both that bad code is reported and that good code is not reported.
  • [-] Set VersionAdded in default/config.yml to the next minor version.

If you have modified an existing cop's configuration options:

  • [x] Set VersionChanged in config/default.yml to the next major version.

ydah avatar Aug 05 '22 11:08 ydah