Skip to content

Commit

Permalink
Merge pull request #92 from sleepingkingstudios/chore/rubocop-config
Browse files Browse the repository at this point in the history
Chore/Extract third-party RuboCop configuration.
  • Loading branch information
sleepingkingstudios authored Jul 30, 2024
2 parents 11de89a + af2256b commit 8dbc616
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 32 deletions.
32 changes: 3 additions & 29 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require:
- rubocop-rspec

inherit_gem:
rspec-sleeping_king_studios: config/rubocop-rspec.yml

AllCops:
TargetRubyVersion: 3.1
NewCops: enable
Expand Down Expand Up @@ -35,35 +38,6 @@ RSpec:
- '**/*_examples.rb'
- '**/*_contract.rb'
- '**/*_spec.rb'
Language:
ExampleGroups:
Regular:
- context
- describe
- wrap_context
Skipped:
- xcontext
- xdescribe
- xwrap_context
Focused:
- fcontext
- fdescribe
- fwrap_context
Helpers:
- let
- let!
- let?
Includes:
Examples:
- finclude_contract
- finclude_examples
- fwrap_examples
- include_contract
- include_examples
- wrap_examples
- xinclude_contract
- xinclude_examples
- xwrap_examples

Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Updated minimum `Hashdiff` version to `~> 1.1`.

Extracted `rubocop-rspec` configuration. To add support for `RSpec::SleepingKingStudios` extensions to `rubocop-rspec`, add the following to your `.rubocop.yml` configuration file:

```yml
inherit_gem:
rspec-sleeping_king_studios: 'config/rubocop-rspec.yml'
```
### Concerns
#### Memoized Helpers
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ A collection of matchers and extensions to ease TDD/BDD using RSpec. Extends bui

## About

### Setup

To add support for `RSpec::SleepingKingStudios` extensions to `rubocop-rspec`, add the following to your `.rubocop.yml` configuration file:

```yml
inherit_gem:
rspec-sleeping_king_studios: 'config/rubocop-rspec.yml'
```
### Compatibility
RSpec::SleepingKingStudios is tested against the following dependencies:
Expand Down Expand Up @@ -34,7 +43,6 @@ To contribute code, please fork the repository, make the desired updates, and th

Please note that the `RSpec::SleepingKingStudios` project is released with a [Contributor Code of Conduct](https://github.com/sleepingkingstudios/rspec-sleeping_king_studios/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.


## Configuration

RSpec::SleepingKingStudios now has configuration options available through `RSpec.configuration`. For example, to set the behavior of the matcher examples when a failure message expectation is undefined (see RSpec Matcher Examples, below), put the following in your `spec_helper` or other configuration file:
Expand Down
41 changes: 41 additions & 0 deletions config/rubocop-rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
RSpec:
Language:
ExampleGroups:
Regular:
- context
- describe
- wrap_context
- wrap_deferred
Skipped:
- xcontext
- xdescribe
- xwrap_context
- xwrap_deferred
Focused:
- fcontext
- fdescribe
- fwrap_context
- fwrap_deferred
Helpers:
- let
- let!
- let?
Includes:
Examples:
- finclude_contract
- finclude_deferred
- finclude_examples
- fwrap_examples
- include_contract
- include_deferred
- include_examples
- wrap_examples
- xinclude_contract
- xinclude_deferred
- xinclude_examples
- xwrap_examples
SharedGroups:
Examples:
- deferred_examples
Context:
- deferred_context
5 changes: 3 additions & 2 deletions rspec-sleeping_king_studios.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ Gem::Specification.new do |gem|
}

gem.required_ruby_version = ['>= 3.1', '< 4.0']
gem.require_path = 'lib'
gem.files = Dir['lib/**/*.rb', 'LICENSE', '*.md']
gem.require_path = 'lib'
gem.files =
Dir['config/rubocop-rspec.yml', 'lib/**/*.rb', 'LICENSE', '*.md']

gem.add_dependency 'hashdiff', '~> 1.1'
gem.add_dependency 'rspec', '~> 3.4'
Expand Down

0 comments on commit 8dbc616

Please sign in to comment.