rubocop-fourshark 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f2644c550944bc0f11e7b4222b430e7cecc1ed4bf97f2650eb6f60e9f588a03
4
- data.tar.gz: 5e2cbafe91b1b52c7d8de97d8d45c8a7e39a65921d3040bd07d48b5ccfbcd0e4
3
+ metadata.gz: a8b84b9e99c1ff660e70c0dc9b6d600361f175fc7ea47be4c27ceb3ed46c879c
4
+ data.tar.gz: b80b447aff3ef40874166bef818eba3d18caff427b39e095c0ad15099804fc88
5
5
  SHA512:
6
- metadata.gz: 7564a809a8d3e84320ac5de4e597cdc610c8568dbbc30eafcfa8b908955a38d022e68778fce30a35a8391a4576b98f965976e03234adb985c64dc26ae46c7ca8
7
- data.tar.gz: fc105db26052f84221d17282382d867aa3d72a12d8a8b91d900061b84b01fe58d552e5365755af15f1a72df2036bb523574b28ff6311d2ffd14c0de5295e35dc
6
+ metadata.gz: abdb30af6129f55a4c37b4f788dbee1528e28129642bcdaaaddc6164d4187d6fb4b0d8177b27b0b523c5749482951af32ebcbd54963651d8c4eb16bb73b4ab19
7
+ data.tar.gz: eb6678c1b97f140ef14c222e047b3dbf9c6342281b1a01818f176f9000246de2c95c7d919f1fda3e6cb83507367b88697d049effac922cfd5a3c7f521de323b7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.3.0] - 2026-06-19
2
+
3
+ ### Added
4
+
5
+ - `RSpec/Dialect` configured to forbid `subject`, `subject!` and `let!` in favor of a lazy `let`
6
+
1
7
  ## [0.2.3] - 2026-05-30
2
8
 
3
9
  ### Fixed
data/README.md CHANGED
@@ -82,6 +82,7 @@ Where a 4Shark cop supersedes or contradicts a stock cop, `config/default.yml` t
82
82
 
83
83
  | Cop | Intent |
84
84
  |---|---|
85
+ | `RSpec/Dialect` | Use `let`, never `subject` or `let!` — every `subject`/`subject!`/`let!` is flagged in favor of a lazy `let` (force creation in an explicit `before`, not with `let!`). The implicit subject behind `is_expected` is a different method and is left untouched. Stock cop, configured via `PreferredMethods`. |
85
86
  | `RSpec/InverseOfMatcher` | Root models must assert `.inverse_of` in association specs; subclasses must not (it belongs to the parent). Scoped to `spec/models`. |
86
87
  | `RSpec/OverwrittenLet` | A `let`/`let!` must not override one defined in an outer example group — shadowing makes it ambiguous which value applies. Scenario-specific `let`s, and the same name across sibling contexts, are fine. |
87
88
  | `RSpec/ConditionalInLet` | A `let` must not contain conditional logic (`if`/`case`) — branch with separate `context`s instead. Ternaries are allowed. |
data/config/default.yml CHANGED
@@ -50,6 +50,20 @@ Rails/OrderedMacros:
50
50
  - 'app/models/**/*.rb'
51
51
  VersionAdded: '0.2.0'
52
52
 
53
+ # Stock cop configured (not a 4Shark cop): map `subject`/`subject!`/`let!` to `let`
54
+ # so every `subject`, `subject!` and `let!` call is flagged in favor of a lazy
55
+ # `let` (force creation in an explicit `before`, not with `let!`). The implicit
56
+ # subject behind `is_expected` is a different method and is left untouched.
57
+ RSpec/Dialect:
58
+ Description: 'Use `let`, never `subject` or `let!` — objects are lazy `let`, forced in `before`.'
59
+ Enabled: true
60
+ PreferredMethods:
61
+ subject: let
62
+ subject!: let
63
+ let!: let
64
+ Include:
65
+ - 'spec/**/*_spec.rb'
66
+
53
67
  RSpec/InverseOfMatcher:
54
68
  Description: 'Root models must include `.inverse_of` in association specs; subclasses must not.'
55
69
  Enabled: true
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Fourshark
5
- VERSION = '0.2.3'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-fourshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Ribeiro