Skip to content

Commit beb0438

Browse files
pirjbquorning
andcommitted
Update docs according to code review comments
Co-authored-by: Benjamin Quorning <[email protected]>
1 parent 84c77ea commit beb0438

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

docs/modules/ROOT/pages/index.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ https://github.com/rubocop-hq/rubocop[RuboCop].
55

66
RuboCop RSpec follows the https://docs.rubocop.org/rubocop/versioning.html[RuboCop versioning guide].
77
In a nutshell, between major versions new cops are introduced in a special `pending` status.
8-
That means that they won't take their duties unless explicitly told otherwise.
8+
That means that they won’t be run unless explicitly told otherwise.
99
RuboCop will warn on start that certain cops are neither explicitly enabled and disabled.
10-
On a major version release, all new cops introduced since the previous major release, are enabled.
10+
On a major version release, all `pending` cops are enabled.
1111

1212
== Project Goals
1313

docs/modules/ROOT/pages/upgrade_to_version_2.adoc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ In version 2.x:
77

88
- `RSpec/InvalidPredicateMatcher` cop is removed
99
- `CustomIncludeMethods` configuration option for `RSpec/EmptyExampleGroup` is removed
10-
- cop departments are nested for cops with a department that doesn't match the extension name (`Capybara`, `FactoryBot`, `Rails`)
10+
- cop departments are nested for cops with a department that doesnt match the extension name (`Capybara`, `FactoryBot`, `Rails`)
1111

1212
[discrete]
1313
=== Adjust the configuration of `RSpec/EmptyExampleGroup`
@@ -34,8 +34,8 @@ AllCops:
3434

3535
RuboCop extensions had cops with clashing names and departments, e.g. both `rspec-rails` and `rubocop-rspec` had `Rails::HttpStatus` cops.
3636
To avoid issues, e.g. inability to disable just one of the cops, each extension now has its own uber-department.
37-
Expectedly, RuboCop RSpec's uber-department name is `RSpec`.
38-
Changes are only applied to cops that don't already have the department set to `RSpec`, i.e. `Capybara`, `FactoryBot` and `Rails`.
37+
Expectedly, RuboCop RSpecs uber-department name is `RSpec`.
38+
Changes are only applied to cops that dont already have the department set to `RSpec`, i.e. `Capybara`, `FactoryBot` and `Rails`.
3939

4040
[source,yaml]
4141
----
@@ -68,14 +68,14 @@ https://github.com/rubocop-hq/rubocop/pull/8490[Learn more about this change].
6868

6969
== Custom Cop Update Guide
7070

71-
Due to significant API changes custom cops will break.
71+
Due to significant API changes, custom cops may break.
7272
Here is the summary of the changes:
7373

7474
1) The base class for cops is now `RuboCop::Cop::RSpec::Base` instead of `RuboCop::Cop::RSpec::Cop`.
7575

7676
2) `TopLevelDescribe` is replaced with a more generic `TopLevelGroup`.
7777

78-
3) `RuboCop::RSpec::Language` has been completely rewritten to support dynamic RSpec DSL aliases and negated matchers to fully support third-party libraries e.g. RSpec Rails, Pundit, Action Policy and many others.
78+
3) `RuboCop::RSpec::Language` has been completely rewritten to support dynamic RSpec DSL aliases and negated matchers to fully support third-party libraries such as RSpec Rails, Pundit, Action Policy and many others.
7979

8080
4) RuboCop RSpec updated the dependency of RuboCop to 1.0+.
8181

@@ -109,7 +109,7 @@ https://github.com/rubocop-hq/rubocop-rspec/pull/962[Example pull request].
109109
`TopLevelDescribe` was incomplete, had poor performance and did not distinguish between example groups and shared example groups.
110110

111111
`TopLevelGroup` provides a similar interface, but instead of a single `on_top_level_describe` hook there are two, `on_top_level_example_group` and `on_top_level_group`.
112-
There's no need yet for `on_top_level_shared_group` for RuboCop core cops, but if your custom cop needs such a hook, please feel free to send a pull request.
112+
Theres no need yet for `on_top_level_shared_group` for RuboCop core cops, but if your custom cop needs such a hook, please feel free to send a pull request.
113113

114114
Additionally, `single_top_level_describe?` is removed with no direct replacement.
115115
You may use `top_level_groups` query method instead, e.g. `top_level_groups.one?`.
@@ -142,8 +142,7 @@ def_node_search :examples?,
142142
143143
# After
144144
def_node_search :examples?,
145-
send_pattern(
146-
'{#rspec(:Includes, :Example) #rspec(:Examples)}')
145+
send_pattern('{#rspec(:Includes, :Example) #rspec(:Examples)}')
147146
----
148147

149148
[source,ruby]
@@ -161,6 +160,6 @@ https://github.com/rubocop-hq/rubocop-rspec/pull/956[Pull request with more exam
161160

162161
=== Conform with RuboCop API Changes
163162

164-
The parent project, RuboCop, have API changes.
165-
They won't result in cop breakages, however, it's recommended to update cops to use new APIs.
166-
Follow the https://docs.rubocop.org/rubocop/v1_upgrade_notes[RuboCop's core v1 update guide] to adjust custom cops' RuboCop Autocorrect API usage.
163+
The parent project, RuboCop, has API changes.
164+
While they wont result in cop breakages, it is recommended to update cops to use new API’s.
165+
Follow the https://docs.rubocop.org/rubocop/v1_upgrade_notes[RuboCop v1 update guide] to adjust custom cops’ use of RuboCop’s auto-correction API.

0 commit comments

Comments
 (0)