Skip to content

Commit 3048e55

Browse files
authored
Fix legend displaying wrong symbols (#226)
This commit fixes a display error for "updated" and "deleted" items which would always display a "+" symbol no matter what.
1 parent b411b04 commit 3048e55

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Order should be `CHANGE`, `FEATURE`, `ENHANCEMENT`, and `BUGFIX`
44

55
## unreleased/master
66

7-
[FEATURE] Support Arm64 on Darwin for all binaries (benchtool etc). #215
7+
* [FEATURE] Support Arm64 on Darwin for all binaries (benchtool etc). #215
8+
* [BUGFIX] Fix `cortextool rules` legends displaying wrong symbols for updates and deletions. #226
89

910
## v0.10.7
1011

pkg/printer/printer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ func (p *Printer) PrintComparisonResult(results []rules.NamespaceChange, verbose
122122
p.Println("[green] +[reset] created")
123123
}
124124
if updated > 0 {
125-
p.Println("[yellow] +[reset] updated")
125+
p.Println("[yellow] ~[reset] updated")
126126
}
127127
if deleted > 0 {
128-
p.Println("[red] +[reset] deleted")
128+
p.Println("[red] -[reset] deleted")
129129
}
130130
fmt.Println()
131131
fmt.Println("The following changes will be made if the provided rule set is synced:")

pkg/rules/compare.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ func PrintComparisonResult(results []NamespaceChange, verbose bool) error {
183183
colorstring.Println("[green] +[reset] created") //nolint
184184
}
185185
if updated > 0 {
186-
colorstring.Println("[yellow] +[reset] updated") //nolint
186+
colorstring.Println("[yellow] ~[reset] updated") //nolint
187187
}
188188
if deleted > 0 {
189-
colorstring.Println("[red] +[reset] deleted") //nolint
189+
colorstring.Println("[red] -[reset] deleted") //nolint
190190
}
191191
fmt.Println()
192192
fmt.Println("The following changes will be made if the provided rule set is synced:")
@@ -222,7 +222,7 @@ func PrintComparisonResult(results []NamespaceChange, verbose bool) error {
222222
oldYaml, _ := yaml.Marshal(c.Original)
223223
separated = strings.Split(string(oldYaml), "\n")
224224
for _, l := range separated {
225-
colorstring.Printf("[red]+ %v\n", l)
225+
colorstring.Printf("[red]- %v\n", l)
226226
}
227227
}
228228
}

0 commit comments

Comments
 (0)