Skip to content

Commit

Permalink
Deprecate RSpec/FilePath cop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Aug 16, 2023
1 parent b92d666 commit 4b8cfed
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ Style/FormatStringToken:
Style/RequireOrder:
Enabled: true

RSpec/FilePath:
RSpec/SpecFilePathFormat:
Enabled: true
Exclude:
- spec/rubocop/cop/rspec/mixin/**/*.rb

Expand Down Expand Up @@ -163,6 +164,8 @@ RSpec/SkipBlockInsideExample:
Enabled: true
RSpec/SortMetadata:
Enabled: true
RSpec/SpecFilePathSuffix:
Enabled: true
RSpec/SubjectDeclaration:
Enabled: true
RSpec/VerifiedDoubleReference:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix an infinite loop error when `RSpec/ExcessiveDocstringSpacing` finds a description with non-ASCII leading/trailing whitespace. ([@bcgraham])
- Add `RSpec/SpecFilePathSuffix` cop. ([@ydah])
- Add `RSpec/SpecFilePathFormat` cop. ([@ydah])
- Deprecate `RSpec/FilePath` cop. Split `RSpec/FilePath` into `RSpec/SpecFilePathSuffix` and `RSpec/SpecFilePathFormat`. ([@ydah])

## 2.23.2 (2023-08-09)

Expand Down
4 changes: 2 additions & 2 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ RSpec/ExpectOutput:

RSpec/FilePath:
Description: Checks that spec file paths are consistent and well-formed.
Enabled: true
Enabled: false
Include:
- "**/*_spec*rb*"
- "**/spec/**/*"
Expand All @@ -446,7 +446,7 @@ RSpec/FilePath:
IgnoreMethods: false
SpecSuffixOnly: false
VersionAdded: '1.2'
VersionChanged: '1.40'
VersionChanged: "<<next>>"
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath

RSpec/Focus:
Expand Down
6 changes: 6 additions & 0 deletions config/obsoletion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ renamed:
RSpec/FactoryBot/FactoryClassName: FactoryBot/FactoryClassName
RSpec/FactoryBot/FactoryNameStyle: FactoryBot/FactoryNameStyle
RSpec/FactoryBot/SyntaxMethods: FactoryBot/SyntaxMethods

split:
RSpec/FilePath:
alternatives:
- RSpec/SpecFilePathFormat
- RSpec/SpecFilePathSuffix
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/cops_rspec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1943,11 +1943,11 @@ expect { my_app.print_report }.to output('Hello World').to_stdout
|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

| Enabled
| Disabled
| Yes
| No
| 1.2
| 1.40
| <<next>>
|===

Checks that spec file paths are consistent and well-formed.
Expand Down

0 comments on commit 4b8cfed

Please sign in to comment.