Skip to content

Commit 108a928

Browse files
authored
wrong compression type: put the issue on the value, rather than the key (#19)
1 parent 7061fd2 commit 108a928

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rules/msk_topic_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (r *MSKTopicConfigRule) validateCompressionType(
223223
err := runner.EmitIssueWithFix(
224224
r,
225225
fmt.Sprintf("the %s value must be equal to '%s'", compressionTypeKey, compressionTypeVal),
226-
ctPair.Key.Range(),
226+
ctPair.Value.Range(),
227227
func(f tflint.Fixer) error {
228228
return f.ReplaceText(ctPair.Value.Range(), `"`+compressionTypeVal+`"`)
229229
},

rules/msk_topic_config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ resource "kafka_topic" "topic_with_wrong_compression_type" {
180180
Message: "the compression.type value must be equal to 'zstd'",
181181
Range: hcl.Range{
182182
Filename: fileName,
183-
Start: hcl.Pos{Line: 7, Column: 5},
184-
End: hcl.Pos{Line: 7, Column: 23},
183+
Start: hcl.Pos{Line: 7, Column: 26},
184+
End: hcl.Pos{Line: 7, Column: 32},
185185
},
186186
},
187187
},

0 commit comments

Comments
 (0)