Skip to content

Commit dfa9bb9

Browse files
davehentonclaude
andauthored
fix: write duplication migration settings to identical_code and similar_code (#2721)
## Summary - Config migrator was writing `enabled` and `threshold` to `[smells.duplication]`, which only supports `nodes_threshold` and `filter_patterns` — these settings were silently ignored - Now writes `enabled` and `threshold` to `[smells.identical_code]` and `[smells.similar_code]` separately - Uses threshold of 15 (the qlty default already in effect) to avoid changing behavior for existing customers Closes #2717 ## Test plan - [x] Unit tests in `qlty-config` pass (`cargo test -p qlty-config migration`) - [x] Integration tests pass (`cargo test -p qlty config_migrate_tests`) - [x] `cargo check` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d18582 commit dfa9bb9

File tree

10 files changed

+183
-68
lines changed

10 files changed

+183
-68
lines changed

qlty-cli/tests/cmd/config/migrate/checks.stdout

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ threshold = 5
4040
[smells.function_complexity]
4141
threshold = 6
4242

43-
[smells.duplication]
44-
enabled = true
45-
threshold = 30
43+
[smells.identical_code]
44+
threshold = 15
45+
46+
[smells.similar_code]
47+
threshold = 15
4648

qlty-cli/tests/cmd/config/migrate/exclude_patterns.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ threshold = 4
1919
[smells.function_complexity]
2020
threshold = 5
2121

22-
[smells.duplication]
23-
threshold = 22
22+
[smells.identical_code]
23+
threshold = 15
24+
25+
[smells.similar_code]
26+
threshold = 15
2427

qlty-cli/tests/cmd/config/migrate/match_multiple.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ threshold = 4
4949
[smells.function_complexity]
5050
threshold = 5
5151

52-
[smells.duplication]
53-
threshold = 22
52+
[smells.identical_code]
53+
threshold = 15
54+
55+
[smells.similar_code]
56+
threshold = 15
5457

qlty-cli/tests/cmd/config/migrate/match_path.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ threshold = 4
4545
[smells.function_complexity]
4646
threshold = 5
4747

48-
[smells.duplication]
49-
threshold = 22
48+
[smells.identical_code]
49+
threshold = 15
50+
51+
[smells.similar_code]
52+
threshold = 15
5053

qlty-cli/tests/cmd/config/migrate/match_path_plugin_name.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ threshold = 4
4545
[smells.function_complexity]
4646
threshold = 5
4747

48-
[smells.duplication]
49-
threshold = 22
48+
[smells.identical_code]
49+
threshold = 15
50+
51+
[smells.similar_code]
52+
threshold = 15
5053

qlty-cli/tests/cmd/config/migrate/match_url_filename.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ threshold = 4
4545
[smells.function_complexity]
4646
threshold = 5
4747

48-
[smells.duplication]
49-
threshold = 22
48+
[smells.identical_code]
49+
threshold = 15
50+
51+
[smells.similar_code]
52+
threshold = 15
5053

qlty-cli/tests/cmd/config/migrate/match_url_plugin_name.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ threshold = 4
4545
[smells.function_complexity]
4646
threshold = 5
4747

48-
[smells.duplication]
49-
threshold = 22
48+
[smells.identical_code]
49+
threshold = 15
50+
51+
[smells.similar_code]
52+
threshold = 15
5053

qlty-cli/tests/cmd/config/migrate/missing_codeclimate_yml_fetch.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ threshold = 4
3434
[smells.function_complexity]
3535
threshold = 5
3636

37-
[smells.duplication]
38-
threshold = 22
37+
[smells.identical_code]
38+
threshold = 15
39+
40+
[smells.similar_code]
41+
threshold = 15
3942

qlty-cli/tests/cmd/config/migrate/no_match.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ threshold = 4
4141
[smells.function_complexity]
4242
threshold = 5
4343

44-
[smells.duplication]
45-
threshold = 22
44+
[smells.identical_code]
45+
threshold = 15
46+
47+
[smells.similar_code]
48+
threshold = 15
4649

0 commit comments

Comments
 (0)