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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/config/default.yml +14 -0
- data/lib/rubocop/fourshark/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8b84b9e99c1ff660e70c0dc9b6d600361f175fc7ea47be4c27ceb3ed46c879c
|
|
4
|
+
data.tar.gz: b80b447aff3ef40874166bef818eba3d18caff427b39e095c0ad15099804fc88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abdb30af6129f55a4c37b4f788dbee1528e28129642bcdaaaddc6164d4187d6fb4b0d8177b27b0b523c5749482951af32ebcbd54963651d8c4eb16bb73b4ab19
|
|
7
|
+
data.tar.gz: eb6678c1b97f140ef14c222e047b3dbf9c6342281b1a01818f176f9000246de2c95c7d919f1fda3e6cb83507367b88697d049effac922cfd5a3c7f521de323b7
|
data/CHANGELOG.md
CHANGED
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
|