cuke-dedup 0.2.0 → 0.2.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to CukeDedup are documented in this file. The project follows
4
4
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [Unreleased]
7
+
8
+ ## [0.2.1] - 2026-09-13
9
+
10
+ ### Changed
11
+
12
+ - Release binaries abort on panic and ship without a symbol table, which reduces the published
13
+ archive for each platform by about 21 percent, from 2,499,615 to 1,972,110 bytes on
14
+ `aarch64-apple-darwin`, with no measured analysis slowdown. Only the binaries this project
15
+ distributes are affected; a crate depending on CukeDedup keeps its own release profile.
16
+ - Handlers whose behavior is a parameterized inline invocation, such as
17
+ `((value) => check(value))(compute())`, are excluded from handler comparison. The arguments
18
+ are not substituted, so the body is never read and two such handlers are not claimed to be
19
+ equivalent. Version 0.2.0 reported a byte-identical pair of that shape as a duplicate; it is
20
+ no longer reported. Zero-parameter invocations are unaffected and still compare normally.
21
+
22
+ ### Fixed
23
+
24
+ - Preserve callback call evidence in near-duplicate analysis without promoting deferred assertions
25
+ to executed behavior, preventing unrelated callback bodies from appearing identical.
26
+ - Clarify that parameterization suggestions preserve expected assertion values and polarity.
27
+ - Near-duplicate analysis now distinguishes assertions targeting different properties, expecting
28
+ different inline or immutable local values, or using opposite chains such as `expect(...).not`,
29
+ while retaining assertion-only duplicate candidates and avoiding misleading handler-overlap
30
+ warnings. Assertion provenance now also respects TypeScript runtime namespaces, erased
31
+ declarations, namespace bindings, and wrapped assertion expressions.
32
+ - Changed-files mode no longer inherits the caller's Git environment. `GIT_DIR`, `GIT_WORK_TREE`,
33
+ `GIT_INDEX_FILE`, and related variables outrank the repository selected per invocation, so
34
+ running CukeDedup from another repository's Git hook resolved revisions, ignore rules, and the
35
+ changed set against the hook's repository instead of the analyzed root.
36
+
6
37
  ## [0.2.0] - 2026-09-10
7
38
 
8
39
  ### Changed
@@ -120,6 +151,7 @@ Initial public release.
120
151
  - Native Cargo and npm distributions for eight supported targets.
121
152
  - A checksum-verified GitHub Action and an agent-oriented CukeDedup skill.
122
153
 
154
+ [0.2.1]: https://github.com/figueiredoluiz/cuke-dedup/compare/v0.2.0...v0.2.1
123
155
  [0.2.0]: https://github.com/figueiredoluiz/cuke-dedup/compare/v0.1.1...v0.2.0
124
156
  [0.1.1]: https://github.com/figueiredoluiz/cuke-dedup/compare/v0.1.0...v0.1.1
125
157
  [0.1.0]: https://github.com/figueiredoluiz/cuke-dedup/releases/tag/v0.1.0
package/README.md CHANGED
@@ -136,7 +136,7 @@ steps:
136
136
  with:
137
137
  fetch-depth: 0
138
138
  persist-credentials: false
139
- - uses: figueiredoluiz/cuke-dedup@v0.2.0
139
+ - uses: figueiredoluiz/cuke-dedup@v0.2.1
140
140
  with:
141
141
  path: .
142
142
  threshold: 5
@@ -18,7 +18,7 @@ steps:
18
18
  fetch-depth: 0
19
19
  persist-credentials: false
20
20
 
21
- - uses: figueiredoluiz/cuke-dedup@v0.2.0
21
+ - uses: figueiredoluiz/cuke-dedup@v0.2.1
22
22
  id: cuke-dedup
23
23
  with:
24
24
  path: .
package/docs/rules.md CHANGED
@@ -48,6 +48,8 @@ other pair rules and retains at most 10,000 findings. Reaching a limit marks ana
48
48
 
49
49
  Different effective matchers use the same non-trivial handler after parameter and local-variable
50
50
  normalization. Empty, pending, unresolved, and otherwise non-comparable handlers are excluded.
51
+ Exact handler matches also require equal behavior signatures. Handlers whose assertion arguments
52
+ reference unresolved external values are excluded from handler comparisons; matcher checks still run.
51
53
  Consider one parameterized definition, but retain separate definitions when shared implementation
52
54
  is intentional domain vocabulary.
53
55
 
@@ -57,8 +59,17 @@ Matcher wording is close and meaningful handlers share at least 50% ordered beha
57
59
  compatible structural or canonical-call evidence. Similar prose alone and unrelated actions do
58
60
  not qualify. Review the pair and consolidate only when both definitions express the same behavior.
59
61
 
60
- When handlers are not structurally equivalent, they must share a canonical call action, including
61
- direct and fluent forms such as `page.click()` and `page.locator(...).click()`.
62
+ When handlers are not structurally equivalent, they must share canonical action evidence: either
63
+ a call action, including direct and fluent forms such as `page.click()` and
64
+ `page.locator(...).click()`, or an assertion with the same matcher and subject shape. Expected
65
+ assertion values and polarity remain semantic during final similarity verification.
66
+ Decorated class methods must also have compatible runtime-affecting semantics: async versus sync,
67
+ static versus instance, generator, getter, and setter differences veto a near-duplicate match.
68
+ Call evidence includes inline callback bodies syntactically; deferred assertions are not treated as
69
+ directly executed assertions.
70
+ Deferred assertion sequences must match in value, polarity, and order for a near-duplicate finding.
71
+ Shared wrapper calls cannot compensate for different deferred assertions. This conservatively skips
72
+ fuzzy matches when one callback adds or reorders assertions; exact matcher checks still run.
62
73
 
63
74
  ### parameterization-candidate
64
75
 
@@ -67,6 +78,10 @@ texts are sufficiently similar. Findings remain pair-specific so reports retain
67
78
  literals and matcher text. Replace repeated literals with a parameter when it makes the test
68
79
  vocabulary clearer.
69
80
 
81
+ Expected assertion values and polarity are not erased for this rule. For example,
82
+ `expect(state).toBe('ready')` and `expect(state).toBe('idle')` express distinct expectations and
83
+ do not produce a parameterization suggestion solely because their expected literals differ.
84
+
70
85
  ### unused-definition
71
86
 
72
87
  No successfully parsed concrete feature step matches a definition. This rule is disabled when the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuke-dedup",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Static analysis for duplicate and reusable Cucumber step definitions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,6 +21,7 @@
21
21
  "test": "node --test npm/test/*.test.mjs",
22
22
  "skills:check": "node scripts/check/check-agent-skills.mjs",
23
23
  "check:versions": "node scripts/check/check-release-version.mjs",
24
+ "bump:version": "node scripts/release/bump-version.mjs",
24
25
  "pack:check": "npm pack --dry-run",
25
26
  "corpus:check": "node scripts/check/check-corpus.mjs",
26
27
  "benchmark": "node scripts/benchmark/benchmark-analysis.mjs"
@@ -46,13 +47,13 @@
46
47
  "npm/platforms/*"
47
48
  ],
48
49
  "optionalDependencies": {
49
- "cuke-dedup-darwin-arm64": "0.2.0",
50
- "cuke-dedup-darwin-x64": "0.2.0",
51
- "cuke-dedup-linux-arm64-gnu": "0.2.0",
52
- "cuke-dedup-linux-arm64-musl": "0.2.0",
53
- "cuke-dedup-linux-x64-gnu": "0.2.0",
54
- "cuke-dedup-linux-x64-musl": "0.2.0",
55
- "cuke-dedup-windows-arm64-msvc": "0.2.0",
56
- "cuke-dedup-windows-x64-msvc": "0.2.0"
50
+ "cuke-dedup-darwin-arm64": "0.2.1",
51
+ "cuke-dedup-darwin-x64": "0.2.1",
52
+ "cuke-dedup-linux-arm64-gnu": "0.2.1",
53
+ "cuke-dedup-linux-arm64-musl": "0.2.1",
54
+ "cuke-dedup-linux-x64-gnu": "0.2.1",
55
+ "cuke-dedup-linux-x64-musl": "0.2.1",
56
+ "cuke-dedup-windows-arm64-msvc": "0.2.1",
57
+ "cuke-dedup-windows-x64-msvc": "0.2.1"
57
58
  }
58
59
  }