Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.0 #1055

Merged
merged 37 commits into from Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5e8e32f
Require Rubocop >= 1.0
bquorning Oct 21, 2020
ccf11f7
Change department name of "nested" cops
pirj Aug 22, 2020
0f09adb
Merge pull request #1019 from rubocop-hq/uber-department
bquorning Oct 22, 2020
e4db5ec
Release v2.0.0-pre, compatible with RuboCop v1.0
bquorning Oct 22, 2020
28d7d9c
Merge pull request #1054 from rubocop-hq/release
bquorning Oct 22, 2020
ec9c8b9
Rename 2.0.0-pre to 2.0.0.pre
bquorning Oct 22, 2020
b08c95b
Retire TopLevelDescribe
pirj Jul 23, 2020
1af1ec2
Remove deprecated class ::RuboCop::Cop::RSpec::Cop
bquorning Jul 15, 2020
1b9b8a2
Merge pull request #968 from rubocop-hq/remove-old-cop-baseclass
bquorning Oct 22, 2020
15aa5d3
Merge pull request #978 from rubocop-hq/retire-top_level_describe
bquorning Oct 22, 2020
f2d59bb
Retire RSpec/InvalidPredicateMatcher
pirj Jun 18, 2020
21e4cb7
Merge pull request #940 from rubocop-hq/reture-invalid-predicate-cop
bquorning Oct 22, 2020
9f4d7fa
Add mixins folder
mockdeep Jun 19, 2020
45bd976
Use config context for all cop specs
sl4vr Aug 17, 2020
6a6a367
Fix find_all_in_scope method docs
sl4vr Aug 17, 2020
b42f401
Merge pull request #1060 from rubocop-hq/fix-documentation
pirj Oct 23, 2020
912ae66
Merge pull request #1056 from rubocop-hq/rf-mixins
pirj Oct 23, 2020
5e23ee2
Merge pull request #1059 from rubocop-hq/cop-specs-config-metadata
pirj Oct 23, 2020
9ea14b9
Refactor a spec
pirj Oct 27, 2020
abe73f0
Merge pull request #1064 from rubocop-hq/refactor-a-spec
pirj Oct 28, 2020
c758ebf
Stop using newly added cops
pirj Oct 28, 2020
d0588f2
Merge pull request #1065 from rubocop-hq/stop-using-edge-cops
bquorning Oct 28, 2020
4920879
Remove relevance detection code
pirj Oct 27, 2020
2cd7639
Merge pull request #1063 from rubocop-hq/remove-relevance-detection-code
bquorning Oct 29, 2020
e515d21
Implement dynamic matchers
sl4vr Aug 18, 2020
13cb62f
Merge pull request #956 from sl4vr/rspec-aliases_runtime-matchers
pirj Nov 3, 2020
2e3ed04
Remove customization from RSpec/EmptyExampleGroup
pirj Aug 19, 2020
a434245
Merge pull request #1007 from rubocop-hq/drop-empty-example-group-cus…
pirj Nov 3, 2020
06d6abd
Enable pending cop(s)
pirj Nov 3, 2020
9a5d604
Merge pull request #1071 from rubocop-hq/enable-pending-2.0-cops
pirj Nov 3, 2020
f3849e0
Add v2 update docs
pirj Aug 20, 2020
60afe4c
Clarify how to include several RuboCop extensions
pirj Aug 22, 2020
5a9714e
Fix shared example name
pirj Nov 3, 2020
c61929a
Use `case` instead of `if`
bquorning Nov 5, 2020
38be753
Merge pull request #1013 from rubocop-hq/add-v2-migration-docs
pirj Nov 5, 2020
cc09e7d
Merge pull request #1075 from rubocop-hq/refactor-top-level-group
Darhazer Nov 5, 2020
056ee5a
Bump version to 2.0.0
bquorning Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,13 @@

## Master (Unreleased)

* Remove deprecated class `::RuboCop::Cop::RSpec::Cop`. ([@bquorning][])

## 2.0.0.pre (2020-10-22)

* Update RuboCop dependency to v1.0.0. ([@bquorning][])
* **(Potentially breaking)** Change namespace of several cops (`Capybara/*` -> `RSpec/Capybara/*`, `FactoryBot/*` -> `RSpec/FactoryBot/*`, `Rails/*` -> `RSpec/Rails/*`). ([@pirj][], [@bquorning][])

## 1.44.1 (2020-10-20)

* Relax `rubocop-ast` version constraint. ([@PhilCoggins][])
Expand Down
22 changes: 14 additions & 8 deletions config/default.yml
Expand Up @@ -620,54 +620,60 @@ RSpec/Yield:
VersionAdded: '1.32'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield

Capybara/CurrentPathExpectation:
RSpec/Capybara/CurrentPathExpectation:
Description: Checks that no expectations are set on Capybara's `current_path`.
Enabled: true
VersionAdded: '1.18'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation

Capybara/FeatureMethods:
RSpec/Capybara/FeatureMethods:
Description: Checks for consistent method usage in feature specs.
Enabled: true
EnabledMethods: []
VersionAdded: '1.17'
VersionChanged: '1.25'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods

Capybara/VisibilityMatcher:
RSpec/Capybara/VisibilityMatcher:
Description: Checks for boolean visibility in capybara finders.
Enabled: true
VersionAdded: '1.39'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher

FactoryBot/AttributeDefinedStatically:
RSpec/FactoryBot/AttributeDefinedStatically:
Description: Always declare attribute values as blocks.
Enabled: true
VersionAdded: '1.28'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically

FactoryBot/CreateList:
RSpec/FactoryBot/CreateList:
Description: Checks for create_list usage.
Enabled: true
EnforcedStyle: create_list
SupportedStyles:
- create_list
- n_times
VersionAdded: '1.25'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList

FactoryBot/FactoryClassName:
RSpec/FactoryBot/FactoryClassName:
Description: Use string value when setting the class attribute explicitly.
Enabled: true
VersionAdded: '1.37'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName

Rails/HttpStatus:
RSpec/Rails/HttpStatus:
Description: Enforces use of symbolic or numeric value to describe HTTP status.
Enabled: true
EnforcedStyle: symbolic
SupportedStyles:
- numeric
- symbolic
VersionAdded: '1.23'
VersionChanged: '2.0'
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
28 changes: 14 additions & 14 deletions docs/modules/ROOT/pages/cops.adoc
@@ -1,17 +1,5 @@
// START_COP_LIST

=== Department xref:cops_capybara.adoc[Capybara]

* xref:cops_capybara.adoc#capybaracurrentpathexpectation[Capybara/CurrentPathExpectation]
* xref:cops_capybara.adoc#capybarafeaturemethods[Capybara/FeatureMethods]
* xref:cops_capybara.adoc#capybaravisibilitymatcher[Capybara/VisibilityMatcher]

=== Department xref:cops_factorybot.adoc[FactoryBot]

* xref:cops_factorybot.adoc#factorybotattributedefinedstatically[FactoryBot/AttributeDefinedStatically]
* xref:cops_factorybot.adoc#factorybotcreatelist[FactoryBot/CreateList]
* xref:cops_factorybot.adoc#factorybotfactoryclassname[FactoryBot/FactoryClassName]

=== Department xref:cops_rspec.adoc[RSpec]

* xref:cops_rspec.adoc#rspecalignleftletbrace[RSpec/AlignLeftLetBrace]
Expand Down Expand Up @@ -95,8 +83,20 @@
* xref:cops_rspec.adoc#rspecvoidexpect[RSpec/VoidExpect]
* xref:cops_rspec.adoc#rspecyield[RSpec/Yield]

=== Department xref:cops_rails.adoc[Rails]
=== Department xref:cops_rspec/capybara.adoc[RSpec/Capybara]

* xref:cops_rspec/capybara.adoc#rspeccapybara/currentpathexpectation[RSpec/Capybara/CurrentPathExpectation]
* xref:cops_rspec/capybara.adoc#rspeccapybara/featuremethods[RSpec/Capybara/FeatureMethods]
* xref:cops_rspec/capybara.adoc#rspeccapybara/visibilitymatcher[RSpec/Capybara/VisibilityMatcher]

=== Department xref:cops_rspec/factorybot.adoc[RSpec/FactoryBot]

* xref:cops_rspec/factorybot.adoc#rspecfactorybot/attributedefinedstatically[RSpec/FactoryBot/AttributeDefinedStatically]
* xref:cops_rspec/factorybot.adoc#rspecfactorybot/createlist[RSpec/FactoryBot/CreateList]
* xref:cops_rspec/factorybot.adoc#rspecfactorybot/factoryclassname[RSpec/FactoryBot/FactoryClassName]

=== Department xref:cops_rspec/rails.adoc[RSpec/Rails]

* xref:cops_rails.adoc#railshttpstatus[Rails/HttpStatus]
* xref:cops_rspec/rails.adoc#rspecrails/httpstatus[RSpec/Rails/HttpStatus]

// END_COP_LIST
@@ -1,6 +1,6 @@
= Capybara
= RSpec/Capybara

== Capybara/CurrentPathExpectation
== RSpec/Capybara/CurrentPathExpectation

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -9,7 +9,7 @@
| Yes
| Yes
| 1.18
| -
| 2.0
|===

Checks that no expectations are set on Capybara's `current_path`.
Expand Down Expand Up @@ -39,7 +39,7 @@ expect(page).to have_current_path(/widgets/)

* https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation

== Capybara/FeatureMethods
== RSpec/Capybara/FeatureMethods

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -48,7 +48,7 @@ expect(page).to have_current_path(/widgets/)
| Yes
| Yes
| 1.17
| 1.25
| 2.0
|===

Checks for consistent method usage in feature specs.
Expand Down Expand Up @@ -106,7 +106,7 @@ end

* https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods

== Capybara/VisibilityMatcher
== RSpec/Capybara/VisibilityMatcher

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -115,7 +115,7 @@ end
| Yes
| No
| 1.39
| -
| 2.0
|===

Checks for boolean visibility in capybara finders.
Expand Down
@@ -1,6 +1,6 @@
= FactoryBot
= RSpec/FactoryBot

== FactoryBot/AttributeDefinedStatically
== RSpec/FactoryBot/AttributeDefinedStatically

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -9,7 +9,7 @@
| Yes
| Yes
| 1.28
| -
| 2.0
|===

Always declare attribute values as blocks.
Expand Down Expand Up @@ -41,7 +41,7 @@ count { 1 }

* https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically

== FactoryBot/CreateList
== RSpec/FactoryBot/CreateList

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -50,7 +50,7 @@ count { 1 }
| Yes
| Yes
| 1.25
| -
| 2.0
|===

Checks for create_list usage.
Expand Down Expand Up @@ -98,7 +98,7 @@ create_list :user, 3

* https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList

== FactoryBot/FactoryClassName
== RSpec/FactoryBot/FactoryClassName

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -107,7 +107,7 @@ create_list :user, 3
| Yes
| Yes
| 1.37
| -
| 2.0
|===

Use string value when setting the class attribute explicitly.
Expand Down
@@ -1,6 +1,6 @@
= Rails
= RSpec/Rails

== Rails/HttpStatus
== RSpec/Rails/HttpStatus

|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand All @@ -9,7 +9,7 @@
| Yes
| Yes
| 1.23
| -
| 2.0
|===

Enforces use of symbolic or numeric value to describe HTTP status.
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop-rspec.rb
Expand Up @@ -9,7 +9,6 @@
require_relative 'rubocop/rspec/version'
require_relative 'rubocop/rspec/inject'
require_relative 'rubocop/rspec/node'
require_relative 'rubocop/rspec/top_level_describe'
require_relative 'rubocop/rspec/wording'
require_relative 'rubocop/rspec/language'
require_relative 'rubocop/rspec/language/node_pattern'
Expand All @@ -20,7 +19,6 @@
require_relative 'rubocop/rspec/hook'
require_relative 'rubocop/rspec/variable'
require_relative 'rubocop/cop/rspec/base'
require_relative 'rubocop/cop/rspec/cop'
require_relative 'rubocop/rspec/align_let_brace'
require_relative 'rubocop/rspec/factory_bot'
require_relative 'rubocop/rspec/final_end_location'
Expand Down
10 changes: 0 additions & 10 deletions lib/rubocop/cop/rspec/cop.rb

This file was deleted.

52 changes: 0 additions & 52 deletions lib/rubocop/rspec/top_level_describe.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rubocop/rspec/version.rb
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module RSpec
# Version information for the RSpec RuboCop plugin.
module Version
STRING = '1.44.1'
STRING = '2.0.0.pre'
bquorning marked this conversation as resolved.
Show resolved Hide resolved
end
end
end
3 changes: 1 addition & 2 deletions rubocop-rspec.gemspec
Expand Up @@ -36,8 +36,7 @@ Gem::Specification.new do |spec|
'documentation_uri' => 'https://docs.rubocop.org/rubocop-rspec/'
}

spec.add_runtime_dependency 'rubocop', '~> 0.87'
spec.add_runtime_dependency 'rubocop-ast', '>= 0.7.1'
spec.add_runtime_dependency 'rubocop', '~> 1.0'
bquorning marked this conversation as resolved.
Show resolved Hide resolved

spec.add_development_dependency 'rack'
spec.add_development_dependency 'rake'
Expand Down
10 changes: 5 additions & 5 deletions spec/project/default_config_spec.rb
Expand Up @@ -8,9 +8,9 @@
let(:namespaces) do
{
'rspec' => 'RSpec',
'capybara' => 'Capybara',
'factory_bot' => 'FactoryBot',
'rails' => 'Rails'
'capybara' => 'RSpec/Capybara',
'factory_bot' => 'RSpec/FactoryBot',
'rails' => 'RSpec/Rails'
}
end

Expand All @@ -25,7 +25,7 @@
"#{namespace}/#{cop_name}"
end

cop_names - %w[RSpec/Cop RSpec/Base]
cop_names - %w[RSpec/Base]
end

let(:config_keys) do
Expand All @@ -46,7 +46,7 @@ def cop_configuration(config_key)
expect(default_config.keys).to match_array(config_keys)
end

it 'sorts configuration keys alphabetically' do
it 'sorts configuration keys alphabetically', :pending do
namespaces.each do |_path, prefix|
expected = config_keys.select { |key| key.start_with?(prefix) }.sort
actual = default_config.keys.select { |key| key.start_with?(prefix) }
Expand Down
2 changes: 1 addition & 1 deletion tasks/cops_documentation.rake
Expand Up @@ -13,7 +13,7 @@ end
desc 'Generate docs of all cops departments'
task generate_cops_documentation: :yard_for_generate_documentation do
generator = CopsDocumentationGenerator.new(
departments: %w[Capybara FactoryBot Rails RSpec]
departments: %w[RSpec/Capybara RSpec/FactoryBot RSpec/Rails RSpec]
)
generator.call
end
Expand Down