nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: reviewdog/reviewdog
Pull request #1858 (2024-07-27 03:45:24)

Remove original_output from RDJSON(L) output
It's used internally and we shouldn't expose it as output.

- [x] Updated Unreleased section in [CHANGELOG](https://github.com/reviewdog/reviewdog/blob/master/CHANGELOG.md) or it's not notable changes.




Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f51a47b..1a6c22ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - ...
 
 ### :rotating_light: Breaking changes
+- [#1858](https://github.com/reviewdog/reviewdog/pull/1858) Remove original_output from rdjson/rdjsonl reporters' output
 - ...
 
 ## [v0.20.1] - 2024-07-10
diff --git a/comment_iowriter.go b/comment_iowriter.go
index e69330cf..77c1ea57 100644
--- a/comment_iowriter.go
+++ b/comment_iowriter.go
@@ -79,6 +79,8 @@ func (cw *RDJSONLCommentWriter) Post(_ context.Context, c *Comment) error {
 			Name: c.ToolName,
 		}
 	}
+	// Remove OriginalOutput. It's used internally and we shouldn't expose it as output.
+	c.Result.Diagnostic.OriginalOutput = ""
 	b, err := protojson.MarshalOptions{
 		UseProtoNames:     true,
 		UseEnumNumbers:    false,
@@ -124,6 +126,8 @@ func (cw *RDJSONCommentWriter) Flush(_ context.Context) error {
 		Diagnostics: make([]*rdf.Diagnostic, 0, len(cw.comments)),
 	}
 	for _, c := range cw.comments {
+		// Remove OriginalOutput. It's used internally and we shouldn't expose it as output.
+		c.Result.Diagnostic.OriginalOutput = ""
 		result.Diagnostics = append(result.Diagnostics, c.Result.Diagnostic)
 	}
 	b, err := protojson.MarshalOptions{


Test patch:
diff --git a/comment_iowriter_test.go b/comment_iowriter_test.go
index 8aeaf502..ac75f43b 100644
--- a/comment_iowriter_test.go
+++ b/comment_iowriter_test.go
@@ -104,8 +104,9 @@ func TestRDJSONLCommentWriter_Post(t *testing.T) {
 			in: &Comment{
 				Result: &filter.FilteredDiagnostic{
 					Diagnostic: &rdf.Diagnostic{
-						Location: &rdf.Location{Path: "/path/to/file"},
-						Message:  "message",
+						Location:       &rdf.Location{Path: "/path/to/file"},
+						Message:        "message",
+						OriginalOutput: "original output",
 					},
 				},
 				ToolName: "tool name",
@@ -167,8 +168,9 @@ func TestRDJSONCommentWriter_Post(t *testing.T) {
 		{
 			Result: &filter.FilteredDiagnostic{
 				Diagnostic: &rdf.Diagnostic{
-					Location: &rdf.Location{Path: "/path/to/file"},
-					Message:  "message",
+					Location:       &rdf.Location{Path: "/path/to/file"},
+					Message:        "message",
+					OriginalOutput: "original output",
 				},
 			},
 			ToolName: "tool name",
Repository: reviewdog/reviewdog
Pull request #309 (2019-09-20 10:56:33)

Remove BlobHRef from struct of github.CheckRunAnnotation
# What 
I remove `BlobHRef` from struct of github.CheckRunAnnotation.

# Why
Because removed variable  in `go-github` repo. So I think It would be better to remove in this repo too.
FYI : https://github.com/google/go-github/pull/1242


Patch:
diff --git a/doghouse/server/doghouse.go b/doghouse/server/doghouse.go
index c631fa93..422c24a7 100644
--- a/doghouse/server/doghouse.go
+++ b/doghouse/server/doghouse.go
@@ -205,7 +205,6 @@ func (ch *Checker) buildFindingLink(c *reviewdog.FilteredCheck) string {
 func (ch *Checker) toCheckRunAnnotation(c *reviewdog.FilteredCheck) *github.CheckRunAnnotation {
 	a := &github.CheckRunAnnotation{
 		Path:            github.String(c.Path),
-		BlobHRef:        github.String(ch.brobHRef(c.Path)),
 		StartLine:       github.Int(c.Lnum),
 		EndLine:         github.Int(c.Lnum),
 		AnnotationLevel: github.String(ch.annotationLevel()),


Test patch:
diff --git a/doghouse/server/doghouse_test.go b/doghouse/server/doghouse_test.go
index 332c9a47..b797bda7 100644
--- a/doghouse/server/doghouse_test.go
+++ b/doghouse/server/doghouse_test.go
@@ -117,7 +117,6 @@ func TestCheck_OK(t *testing.T) {
 		wantAnnotaions := []*github.CheckRunAnnotation{
 			{
 				Path:            github.String("sample.new.txt"),
-				BlobHRef:        github.String("http://github.com/haya14busa/reviewdog/blob/1414/sample.new.txt"),
 				StartLine:       github.Int(2),
 				EndLine:         github.Int(2),
 				AnnotationLevel: github.String("warning"),
Repository: reviewdog/reviewdog
Pull request #334 (2019-09-29 14:16:15)

github-pr-check: fix missing name
![](https://user-images.githubusercontent.com/3797062/65833795-16520780-e30f-11e9-9824-c0ec51b1f240.png)


Patch:
diff --git a/doghouse/server/doghouse.go b/doghouse/server/doghouse.go
index 7be8abae..4986f020 100644
--- a/doghouse/server/doghouse.go
+++ b/doghouse/server/doghouse.go
@@ -87,6 +87,7 @@ func (ch *Checker) postCheck(ctx context.Context, checkID int64, checks []*revie
 		conclusion = ch.conclusion()
 	}
 	opt := github.UpdateCheckRunOptions{
+		Name:        ch.checkName(),
 		Status:      github.String("completed"),
 		Conclusion:  github.String(conclusion),
 		CompletedAt: &github.Timestamp{Time: time.Now()},
@@ -109,6 +110,7 @@ func (ch *Checker) createCheck(ctx context.Context) (*github.CheckRun, error) {
 
 func (ch *Checker) postAnnotations(ctx context.Context, checkID int64, annotations []*github.CheckRunAnnotation) error {
 	opt := github.UpdateCheckRunOptions{
+		Name: ch.checkName(),
 		Output: &github.CheckRunOutput{
 			Title:       github.String(ch.checkTitle()),
 			Summary:     github.String(""), // Post summary with the last reqeust.


Test patch:
diff --git a/doghouse/server/doghouse_test.go b/doghouse/server/doghouse_test.go
index 55fb7e39..3fa7a3fb 100644
--- a/doghouse/server/doghouse_test.go
+++ b/doghouse/server/doghouse_test.go
@@ -103,6 +103,9 @@ func TestCheck_OK(t *testing.T) {
 		if checkID != wantCheckID {
 			t.Errorf("UpdateCheckRun: checkID = %d, want %d", checkID, wantCheckID)
 		}
+		if opt.Name != name {
+			t.Errorf("UpdateCheckRunOptions.Name = %q, want %q", opt.Name, name)
+		}
 		annotations := opt.Output.Annotations
 		if len(annotations) == 0 {
 			if *opt.Conclusion != conclusion {
Repository: reviewdog/reviewdog
Pull request #391 (2019-12-14 17:56:17)

fix typos


Patch:
diff --git a/cmd/reviewdog/doghouse.go b/cmd/reviewdog/doghouse.go
index 551a830b..ad13481b 100644
--- a/cmd/reviewdog/doghouse.go
+++ b/cmd/reviewdog/doghouse.go
@@ -177,7 +177,7 @@ func reportResults(w io.Writer, filteredResultSet *reviewdog.FilteredCheckMap) b
 			log.Printf("reviewdog: result not found for %q", name)
 			continue
 		}
-		fmt.Fprintf(w, "reviwedog: Reporting results for %q\n", name)
+		fmt.Fprintf(w, "reviewdog: Reporting results for %q\n", name)
 		foundResultPerName := false
 		filteredNum := 0
 		for _, result := range results {
@@ -193,7 +193,7 @@ func reportResults(w io.Writer, filteredResultSet *reviewdog.FilteredCheckMap) b
 			}
 		}
 		if !foundResultPerName {
-			fmt.Fprintf(w, "reviwedog: No results found for %q. %d results found outside diff.\n", name, filteredNum)
+			fmt.Fprintf(w, "reviewdog: No results found for %q. %d results found outside diff.\n", name, filteredNum)
 		}
 	}
 	return foundInDiff


Test patch:
diff --git a/cmd/reviewdog/doghouse_test.go b/cmd/reviewdog/doghouse_test.go
index 1357162f..85a8ebac 100644
--- a/cmd/reviewdog/doghouse_test.go
+++ b/cmd/reviewdog/doghouse_test.go
@@ -365,11 +365,11 @@ func TestReportResults(t *testing.T) {
 	if !foundResultInDiff {
 		t.Errorf("foundResultInDiff = %v, want true", foundResultInDiff)
 	}
-	want := `reviwedog: Reporting results for "name1"
+	want := `reviewdog: Reporting results for "name1"
 name1-L1
 name1-L2
-reviwedog: Reporting results for "name2"
-reviwedog: No results found for "name2". 1 results found outside diff.
+reviewdog: Reporting results for "name2"
+reviewdog: No results found for "name2". 1 results found outside diff.
 `
 	if got := stdout.String(); got != want {
 		t.Errorf("diff found for report:\ngot:\n%s\nwant:\n%s", got, want)
@@ -405,10 +405,10 @@ func TestReportResults_noResultsInDiff(t *testing.T) {
 	if foundResultInDiff {
 		t.Errorf("foundResultInDiff = %v, want false", foundResultInDiff)
 	}
-	want := `reviwedog: Reporting results for "name1"
-reviwedog: No results found for "name1". 2 results found outside diff.
-reviwedog: Reporting results for "name2"
-reviwedog: No results found for "name2". 1 results found outside diff.
+	want := `reviewdog: Reporting results for "name1"
+reviewdog: No results found for "name1". 2 results found outside diff.
+reviewdog: Reporting results for "name2"
+reviewdog: No results found for "name2". 1 results found outside diff.
 `
 	if got := stdout.String(); got != want {
 		t.Errorf("diff found for report:\ngot:\n%s\nwant:\n%s", got, want)
Repository: reviewdog/reviewdog
Pull request #544 (2020-05-05 09:41:13)

Support empty -diff flag for -repoter=local with -filter-mode=nofilter
ref: #536


Patch:
diff --git a/cmd/reviewdog/main.go b/cmd/reviewdog/main.go
index 3c3e28f6..1d1b151e 100644
--- a/cmd/reviewdog/main.go
+++ b/cmd/reviewdog/main.go
@@ -335,11 +335,15 @@ github-pr-check reporter as a fallback.
 		}
 		ds = d
 	case "local":
-		d, err := diffService(opt.diffCmd, opt.diffStrip)
-		if err != nil {
-			return err
+		if opt.diffCmd == "" && opt.filterMode == difffilter.ModeNoFilter {
+			ds = &reviewdog.EmptyDiff{}
+		} else {
+			d, err := diffService(opt.diffCmd, opt.diffStrip)
+			if err != nil {
+				return err
+			}
+			ds = d
 		}
-		ds = d
 	}
 
 	if isProject {
diff --git a/diff.go b/diff.go
index 496d0d83..89b4dd92 100644
--- a/diff.go
+++ b/diff.go
@@ -60,3 +60,12 @@ func (d *DiffCmd) Diff(_ context.Context) ([]byte, error) {
 func (d *DiffCmd) Strip() int {
 	return d.strip
 }
+
+// EmptyDiff service return empty diff.
+type EmptyDiff struct{}
+
+func (*EmptyDiff) Diff(context.Context) ([]byte, error) {
+	return []byte{}, nil
+}
+
+func (*EmptyDiff) Strip() int { return 0 }


Test patch:
diff --git a/cmd/reviewdog/main_test.go b/cmd/reviewdog/main_test.go
index d0925b81..70326194 100644
--- a/cmd/reviewdog/main_test.go
+++ b/cmd/reviewdog/main_test.go
@@ -10,6 +10,7 @@ import (
 	"testing"
 
 	"github.com/reviewdog/reviewdog/commands"
+	"github.com/reviewdog/reviewdog/difffilter"
 )
 
 func TestRun_local(t *testing.T) {
@@ -71,6 +72,39 @@ line3
 
 }
 
+func TestRun_local_nofilter(t *testing.T) {
+	var (
+		stdin = strings.Join([]string{
+			"/path/to/file(2,1): message1",
+			"/path/to/file(2): message2",
+			"/path/to/file(14,1): message3",
+		}, "\n")
+		want = `/path/to/file(2,1): message1
+/path/to/file(14,1): message3`
+	)
+
+	opt := &option{
+		diffCmd:   "", // empty
+		efms:      strslice([]string{`%f(%l,%c): %m`}),
+		diffStrip: 0,
+		reporter:  "local",
+	}
+
+	stdout := new(bytes.Buffer)
+	if err := run(strings.NewReader(stdin), stdout, opt); err == nil {
+		t.Errorf("got no error, but want error")
+	}
+
+	opt.filterMode = difffilter.ModeNoFilter
+	if err := run(strings.NewReader(stdin), stdout, opt); err != nil {
+		t.Error(err)
+	}
+
+	if got := strings.Trim(stdout.String(), "\n"); got != want {
+		t.Errorf("got:\n%v\n want\n%v", got, want)
+	}
+}
+
 func TestRun_local_tee(t *testing.T) {
 	stdin := "tee test"
 	opt := &option{