Skip to content

Commit ff7f2d6

Browse files
authored
fix: remove deprecated Reporter methods (google#722)
Per google#706 (comment)
1 parent 70a5894 commit ff7f2d6

6 files changed

+1
-60
lines changed

pkg/reporter/gh-annotations_reporter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ func NewGHAnnotationsReporter(stdout io.Writer, stderr io.Writer) *GHAnnotations
2222
}
2323
}
2424

25-
func (r *GHAnnotationsReporter) PrintError(msg string) {
26-
r.PrintErrorf(msg)
27-
}
28-
2925
func (r *GHAnnotationsReporter) PrintErrorf(msg string, a ...any) {
3026
fmt.Fprintf(r.stderr, msg, a...)
3127
r.hasPrintedError = true
@@ -35,10 +31,6 @@ func (r *GHAnnotationsReporter) HasPrintedError() bool {
3531
return r.hasPrintedError
3632
}
3733

38-
func (r *GHAnnotationsReporter) PrintText(msg string) {
39-
r.PrintTextf(msg)
40-
}
41-
4234
func (r *GHAnnotationsReporter) PrintTextf(msg string, a ...any) {
4335
fmt.Fprintf(r.stderr, msg, a...)
4436
}

pkg/reporter/json_reporter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ func NewJSONReporter(stdout io.Writer, stderr io.Writer) *JSONReporter {
2222
}
2323
}
2424

25-
func (r *JSONReporter) PrintError(msg string) {
26-
r.PrintErrorf(msg)
27-
}
28-
2925
func (r *JSONReporter) PrintErrorf(msg string, a ...any) {
3026
fmt.Fprintf(r.stderr, msg, a...)
3127
r.hasPrintedError = true
@@ -35,10 +31,6 @@ func (r *JSONReporter) HasPrintedError() bool {
3531
return r.hasPrintedError
3632
}
3733

38-
func (r *JSONReporter) PrintText(msg string) {
39-
r.PrintTextf(msg)
40-
}
41-
4234
func (r *JSONReporter) PrintTextf(msg string, a ...any) {
4335
// Print non json text to stderr
4436
fmt.Fprintf(r.stderr, msg, a...)

pkg/reporter/reporter.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,18 @@ import (
55
)
66

77
type Reporter interface {
8-
// PrintError prints errors in an appropriate manner to ensure that results
9-
// are printed in a way that is semantically valid for the intended consumer,
10-
// and tracking that an error has been printed.
11-
//
12-
// Where the error is actually printed (if at all) is entirely up to the actual
13-
// reporter, though generally it will be to stderr.
14-
//
15-
// Deprecated: use PrintErrorf instead
16-
PrintError(msg string)
178
// PrintErrorf prints errors in an appropriate manner to ensure that results
189
// are printed in a way that is semantically valid for the intended consumer,
1910
// and tracking that an error has been printed.
2011
//
2112
// Where the error is actually printed (if at all) is entirely up to the actual
2213
// reporter, though generally it will be to stderr.
2314
PrintErrorf(msg string, a ...any)
24-
// HasPrintedError returns true if there have been any calls to PrintError or
25-
// PrintErrorf.
15+
// HasPrintedError returns true if there have been any calls to PrintErrorf.
2616
//
2717
// This does not actually represent if the error was actually printed anywhere
2818
// since what happens to the error message is up to the actual reporter.
2919
HasPrintedError() bool
30-
// PrintText prints text in an appropriate manner to ensure that results
31-
// are printed in a way that is semantically valid for the intended consumer.
32-
//
33-
// Where the text is actually printed (if at all) is entirely up to the actual
34-
// reporter; in most cases for "human format" reporters this will be stdout
35-
// whereas for "machine format" reporters this will stderr.
36-
//
37-
// Deprecated: use PrintTextf instead
38-
PrintText(msg string)
3920
// PrintTextf prints text in an appropriate manner to ensure that results
4021
// are printed in a way that is semantically valid for the intended consumer.
4122
//

pkg/reporter/sarif_reporter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ func NewSarifReporter(stdout io.Writer, stderr io.Writer) *SARIFReporter {
2222
}
2323
}
2424

25-
func (r *SARIFReporter) PrintError(msg string) {
26-
r.PrintErrorf(msg)
27-
}
28-
2925
func (r *SARIFReporter) PrintErrorf(msg string, a ...any) {
3026
fmt.Fprintf(r.stderr, msg, a...)
3127
r.hasPrintedError = true
@@ -35,10 +31,6 @@ func (r *SARIFReporter) HasPrintedError() bool {
3531
return r.hasPrintedError
3632
}
3733

38-
func (r *SARIFReporter) PrintText(msg string) {
39-
r.PrintTextf(msg)
40-
}
41-
4234
func (r *SARIFReporter) PrintTextf(msg string, a ...any) {
4335
fmt.Fprintf(r.stderr, msg, a...)
4436
}

pkg/reporter/table_reporter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ func NewTableReporter(stdout io.Writer, stderr io.Writer, markdown bool, termina
2727
}
2828
}
2929

30-
func (r *TableReporter) PrintError(msg string) {
31-
r.PrintErrorf(msg)
32-
}
33-
3430
func (r *TableReporter) PrintErrorf(msg string, a ...any) {
3531
fmt.Fprintf(r.stderr, msg, a...)
3632
r.hasPrintedError = true
@@ -40,10 +36,6 @@ func (r *TableReporter) HasPrintedError() bool {
4036
return r.hasPrintedError
4137
}
4238

43-
func (r *TableReporter) PrintText(msg string) {
44-
r.PrintTextf(msg)
45-
}
46-
4739
func (r *TableReporter) PrintTextf(msg string, a ...any) {
4840
fmt.Fprintf(r.stdout, msg, a...)
4941
}

pkg/reporter/void_reporter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ type VoidReporter struct {
88
hasPrintedError bool
99
}
1010

11-
func (r *VoidReporter) PrintError(msg string) {
12-
r.PrintErrorf(msg)
13-
}
14-
1511
func (r *VoidReporter) PrintErrorf(msg string, a ...any) {
1612
r.hasPrintedError = true
1713
}
@@ -20,10 +16,6 @@ func (r *VoidReporter) HasPrintedError() bool {
2016
return r.hasPrintedError
2117
}
2218

23-
func (r *VoidReporter) PrintText(msg string) {
24-
r.PrintTextf(msg)
25-
}
26-
2719
func (r *VoidReporter) PrintTextf(msg string, a ...any) {
2820
}
2921

0 commit comments

Comments
 (0)