kaizo 0.8.0 → 0.9.2

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: a33b49134e0a0a871e9b6358cf3fcc9ab88d9ebaca5e8928003de08594c01a11
4
- data.tar.gz: 7ed8c9d6780bc64c233b94135850694da8b2bfa1e314dd7369dddf7560f7d42d
3
+ metadata.gz: cad3868f708e0f017a8591fbc77881d53054d4fcc672c9a6adbfdb2ff7928834
4
+ data.tar.gz: 37b9f18bfd87518a2027ac6786352600d1c3d1f68153eeadbab8d964c835a90d
5
5
  SHA512:
6
- metadata.gz: b4c8a8645f32a48c82b52d23966d37d2608c63a0c84e4820e33c15ed6f58bb84c40658eef9de990874e3e0d304c8d6d27abec8ef5f708ff3468f6430663cdd12
7
- data.tar.gz: f4189d76f5bb36959f71c84f0497b33805e77ae4e8b04941c78e8517a9012f92447dbbb08c8063b5738746018330fba474abcee324656461af7ec83f2946a96a
6
+ metadata.gz: 74e87adf1362de156eac0285be0c51b89eec0b2209bf9371a3bf3ac52c41404b49c3f694bfebfea9ec9d3bf32ab572816e580575a39af5a568fc74bd844c91c5
7
+ data.tar.gz: 6789d9a9dabe6bcc17fb2d90702478d42d3593aed4e934743ed1f6c05946bfc1294d0a229173f1e345a1efc2f897a0f436630597ce33fac79e69430d50bc5cd6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,89 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.9.1
4
+
5
+ - `Kaizo/KeywordArguments` and `Kaizo/TotalArguments` no longer run on `spec/`
6
+ and `test/` trees: wide keyword interfaces are the testing idiom there
7
+ (FactoryBot-style `create`/`build` helpers), and a total bound would
8
+ re-police the keywords the exemption frees. Override with `Exclude: []` to
9
+ police tests too. `Kaizo/PositionalArguments` still runs everywhere --
10
+ positional arguments communicate nothing unless they are solo.
11
+ - Rewrite the README example-first: every cop section leads with its bad/good
12
+ example, a fourteen-cop table replaces the catalog paragraph, a real
13
+ `rubocop --only Kaizo` transcript opens the document, and the enablement
14
+ policy is stated plainly (every cop ships enabled; the plugin's
15
+ out-of-department changes are disabling `Style/RedundantBegin` and the
16
+ `Style/HashSyntax` shorthand enforcement shipped since 0.8.0).
17
+ - Verify the README in CI: `spec/readme_examples_spec.rb` executes every
18
+ example against the shipped config — bad code must be flagged by the cop
19
+ its marker names, good code must pass the whole department, YAML fences
20
+ must parse into real cops with shipped option keys, suffix claims run with
21
+ the documented merge applied, the console transcript is re-derived from the
22
+ cops, and every cop must have both a bad and a good example.
23
+ - Fix two rdoc errors found in review: `Kaizo/AgentNounClassName`'s
24
+ `inherit_mode` example was a no-op (`Ledger` is already a default), and
25
+ `Kaizo/ExplicitBegin`'s docs called re-enabling `Style/RedundantBegin` an
26
+ opt-out when it leaves both cops fighting; the opt-out is disabling
27
+ `Kaizo/ExplicitBegin`.
28
+ - Fix a README error found in review: the enablement policy named
29
+ `Style/RedundantBegin` as the only out-of-department change, omitting the
30
+ `Style/HashSyntax` shorthand enforcement the Public Config has shipped
31
+ since 0.8.0. The policy now names both, and a guard spec pins the Public
32
+ Config's foreign-cop list to exactly the two the README names.
33
+
34
+ ## 0.9.0
35
+
36
+ - Add `Kaizo/TempfileCreate` cop: requires temporary files to be created with
37
+ block-form `Tempfile.create`, the only temp-file API whose cleanup is
38
+ deterministic (the block closes and removes the file when it returns).
39
+ `Tempfile.new` and `Tempfile.open` are flagged — their cleanup rides on a GC
40
+ finalizer that may run late or never — as is blockless `Tempfile.create`,
41
+ which returns a plain `File` that is never removed automatically. A
42
+ block-pass argument (`Tempfile.create("x", &writer)`) counts as a block. No
43
+ autocorrection. Enabled by default.
44
+ - Add `Kaizo/SpecSubject` cop: requires the unit under test to be declared with
45
+ `subject`, not `let`. A `let`/`let!` is flagged when its block confidently
46
+ builds the class under test — a `.new` on `described_class`, on the constant
47
+ an enclosing `describe`/`context` names (full or short name), or on a
48
+ constant matching the spec's file name (`pool_spec.rb` names `Pool`,
49
+ `api_client_spec.rb` names `APIClient`). Deliberate second instances (an
50
+ `other` in an equality spec) are exempted with `AllowedMethods` /
51
+ `AllowedPatterns`, matched against the `let` name. Runs on `**/*_spec.rb`.
52
+ No autocorrection. Enabled by default.
53
+ - `Kaizo/SpecComment` no longer inspects `spec/helpers` or `spec/support` by
54
+ default: those directories hold infrastructure, not specs, and prose there is
55
+ legitimate. The exclusion is plain per-cop `Exclude` configuration, so
56
+ override it (`Exclude: []`) to police them again, or broaden/narrow the scope
57
+ with the standard `Include`/`Exclude` as before.
58
+ - `Kaizo/SpecDescriptionProse` no longer flags error class names in
59
+ descriptions: `it "raises Foo::Error"` passes, because the error is part of
60
+ the specified behavior — it is what the user ultimately sees raised. Any
61
+ constant path whose final segment ends in `Error` or `Exception` reads as
62
+ prose; the rest of the description is still checked.
63
+ - `Kaizo/SpecDescriptionProse` gains `AllowedPatterns`: regexps matched against
64
+ the whole description that exempt it from every rule — the ad-hoc escape
65
+ hatch for a description that must quote something code-shaped.
66
+ - **Renamed** `Kaizo/SpecDescriptionProse`'s options: `Conjunctions` is now
67
+ `ForbiddenWords` and `ContextPrefixes` is now `RequiredContextPrefixes`. The
68
+ old names said nothing about whether the lists include or exclude, or how
69
+ the filter works; the new ones do. This is a clean break: the old keys are
70
+ no longer read — RuboCop warns that the parameter is unsupported and the
71
+ shipped defaults apply — so rename them when upgrading.
72
+ - The argument-counting cops (`Kaizo/PositionalArguments`,
73
+ `Kaizo/KeywordArguments`, `Kaizo/TotalArguments`) gain `AllowedMethods` and
74
+ `AllowedPatterns`: exempt individual methods by name or regexp — e.g. allow
75
+ `#initialize` to gather collaborators while everything else stays under a
76
+ strict `Max`. Covers `def`, `def self.`, and the symbol/string
77
+ `define_method` forms.
78
+ - `Kaizo/PluralCollectionName`'s `ArrayMethods` list is now genuinely
79
+ configurable (the README already described it as such); the default list is
80
+ spelled out in the shipped config so `inherit_mode: merge` can extend it.
81
+ - Every cop's rdoc header now carries a `== Configuration` section documenting
82
+ each option, its semantics, and its default, with a ready-to-paste
83
+ `.rubocop.yml` snippet — the config plane was previously undocumented at the
84
+ class level.
85
+
86
+ ## 0.8.0
4
87
 
5
88
  - Add `Kaizo/PluralCollectionName` cop: flags a method that returns an array
6
89
  under a singular name (`def user` handing back `[first, second]`), since a
@@ -31,6 +114,11 @@
31
114
  or `tmp` satisfies the rule while missing what it asks for. The offense message
32
115
  itself is unchanged.
33
116
 
117
+ ## 0.7.0
118
+
119
+ - No user-facing changes. Internal tooling and gem metadata only — nothing in
120
+ the shipped cops or their configuration differed from 0.6.0.
121
+
34
122
  ## 0.6.0
35
123
 
36
124
  - **Renamed the gem from `rubocop-design` to `kaizo`**, and moved every cop from