Skip to content

Commit

Permalink
Split RSpec/FilePath into RSpec/SpecFilePathSuffix and `RSpec/Spe…
Browse files Browse the repository at this point in the history
…cFilePathFormat`
  • Loading branch information
ydah committed Aug 25, 2023
1 parent 456be2a commit 21507cf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 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
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## Master (Unreleased)

- 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])
- 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 21507cf

Please sign in to comment.