PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: dprint/dprint-plugin-typescript (rust)

Issue:
Incorrect output for inline block statement containing an empty statement
**Describe the bug**

dprint-plugin-typescript version: 0.80.2

**Input Code**

An if statement with a block statement that only contains an empty statement, all in one line (see [Playground](https://dprint.dev/playground/#code/JYMwBAFALgTgrgUwJRgN4G4C+Q/language/typescript)):

```ts
if (true) {;}
```

**Expected Output**

dprint should remove the empty statement, but keep the block statement:

```ts
if (true) {}
```

**Actual Output**

dprint currently removes the block statement entirely:

```ts
if (true)
```

---

Note that dprint formats this code correctly when the block statement is not on a single line (see [Playground](https://dprint.dev/playground/#code/JYMwBAFALgTgrgUwJRgN4CgxbAbnQXyA/language/typescript)):

```ts
// Before
if (true) {
    ;
}

// After
if (true) {
}
```

Pull request:
fix: braces in blocks with conditional braces should not be removed when containing a single empty statement
Closes #468

Patch:
diff --git a/src/generation/generate.rs b/src/generation/generate.rs
index 874cca2..26bcfaa 100644
--- a/src/generation/generate.rs
+++ b/src/generation/generate.rs
@@ -8336,7 +8336,7 @@ fn gen_conditional_brace_body<'a>(opts: GenConditionalBraceBodyOptions<'a>, cont
 
   fn get_force_braces(body_node: Node) -> bool {
     if let Node::BlockStmt(body_node) = body_node {
-      body_node.stmts.is_empty()
+      body_node.stmts.is_empty() || body_node.stmts.iter().all(|s| s.kind() == NodeKind::EmptyStmt)
     } else {
       false
     }


Test patch:
diff --git a/tests/specs/issues/issue0468.txt b/tests/specs/issues/issue0468.txt
new file mode 100644
index 0000000..bd9b67d
--- /dev/null
+++ b/tests/specs/issues/issue0468.txt
@@ -0,0 +1,19 @@
+== should not remove the braces in an if/while statement when the body contains empty statements ==
+if (true) {;}
+while (true) {;}
+
+// these going multi-line is ok... nobody should be writing this
+// and fixing it just adds more complexity
+if (true) {;;}
+while (true) {;;}
+
+[expect]
+if (true) {}
+while (true) {}
+
+// these going multi-line is ok... nobody should be writing this
+// and fixing it just adds more complexity
+if (true) {
+}
+while (true) {
+}
Repository: go-kratos/kratos (go)

Issue:
v2/config/env watcher stop 后，next 返回值不确定
https://github.com/go-kratos/kratos/blob/80378ca10dc7560c711ccd7a8b22ea0320f0965c/config/env/watcher.go

```
func Test_watcher_Next(t *testing.T) {
	w, err := NewWatcher()
	if err != nil {
		panic(err)
	}
	w.Stop()
	var a, b int
	for i := 0; i < 10000; i++ {
		_, err := w.Next()
		if err == nil {
			a++
		} else {
			b++
		}
	}
	t.Logf("err nil: %v", a)
	t.Logf("err non nil: %v", b)
}
```

```
=== RUN   Test_watcher_Next
    watcher_test.go:22: err nil: 4959
    watcher_test.go:23: err non nil: 5041
--- PASS: Test_watcher_Next (0.00s)
PASS
```

exit 与 cancel 作用貌似重复了，建议去掉一个。
w.cancel() 可以重复执行，close(w.exit) 重复执行会panic

用exit的话，可以改成：
```
case <-w.exit:
	return nil, context.Canceled
```

Pull request:
chore(config/env): polish watcher
Should fix #1340 

Patch:
diff --git a/config/env/watcher.go b/config/env/watcher.go
index fa7c7682..edcaf3e9 100644
--- a/config/env/watcher.go
+++ b/config/env/watcher.go
@@ -7,8 +7,6 @@ import (
 )
 
 type watcher struct {
-	exit chan struct{}
-
 	ctx    context.Context
 	cancel context.CancelFunc
 }
@@ -17,7 +15,7 @@ var _ config.Watcher = (*watcher)(nil)
 
 func NewWatcher() (config.Watcher, error) {
 	ctx, cancel := context.WithCancel(context.Background())
-	return &watcher{exit: make(chan struct{}), ctx: ctx, cancel: cancel}, nil
+	return &watcher{ctx: ctx, cancel: cancel}, nil
 }
 
 // Next will be blocked until the Stop method is called
@@ -25,13 +23,10 @@ func (w *watcher) Next() ([]*config.KeyValue, error) {
 	select {
 	case <-w.ctx.Done():
 		return nil, w.ctx.Err()
-	case <-w.exit:
-		return nil, nil
 	}
 }
 
 func (w *watcher) Stop() error {
-	close(w.exit)
 	w.cancel()
 	return nil
 }


Test patch:
diff --git a/config/env/watcher_test.go b/config/env/watcher_test.go
new file mode 100644
index 00000000..bea14947
--- /dev/null
+++ b/config/env/watcher_test.go
@@ -0,0 +1,29 @@
+package env
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+)
+
+func Test_watcher_next(t *testing.T) {
+	t.Run("next after stop should return err", func(t *testing.T) {
+		w, err := NewWatcher()
+		require.NoError(t, err)
+
+		_ = w.Stop()
+		_, err = w.Next()
+		assert.Error(t, err)
+	})
+}
+
+func Test_watcher_stop(t *testing.T) {
+	t.Run("stop multiple times should not panic", func(t *testing.T) {
+		w, err := NewWatcher()
+		require.NoError(t, err)
+
+		_ = w.Stop()
+		_ = w.Stop()
+	})
+}
Repository: Yoctol/bottender (ts)

Issue:
Inconsistent naming
PageInbox here:
https://github.com/Yoctol/bottender/blob/adf8696fb18cfab87fff18b5524626ba011d3ac8/src/context/MessengerContext.js#L272

Inbox here:
https://github.com/Yoctol/bottender/blob/f41fff520195df6ae66e1b7ffe48dd5c739e2eef/src/context/MessengerEvent.js#L707

which one is better, or make it both work

Pull request:
Consistent naming
close #279 

Patch:
diff --git a/src/context/MessengerEvent.js b/src/context/MessengerEvent.js
index dcb6ee64..4b291063 100644
--- a/src/context/MessengerEvent.js
+++ b/src/context/MessengerEvent.js
@@ -701,10 +701,10 @@ export default class MessengerEvent implements Event {
   }
 
   /**
-   * Determine if the event is a request thread control event sent by facebook integrated inbox (appId is 263902037430900).
+   * Determine if the event is a request thread control event sent by facebook integrated 'Page Inbox' (appId is 263902037430900).
    *
    */
-  get isRequestThreadControlFromInbox(): boolean {
+  get isRequestThreadControlFromPageInbox(): boolean {
     return (
       !!this._rawEvent.request_thread_control &&
       typeof this._rawEvent.request_thread_control === 'object' &&


Test patch:
diff --git a/src/context/__tests__/MessengerEvent.spec.js b/src/context/__tests__/MessengerEvent.spec.js
index 43225875..22346feb 100644
--- a/src/context/__tests__/MessengerEvent.spec.js
+++ b/src/context/__tests__/MessengerEvent.spec.js
@@ -1232,19 +1232,19 @@ it('#isRequestThreadControl', () => {
   ).toEqual(true);
 });
 
-it('#isRequestThreadControlFromInbox', () => {
+it('#isRequestThreadControlFromPageInbox', () => {
   expect(
-    new MessengerEvent(textMessage).isRequestThreadControlFromInbox
+    new MessengerEvent(textMessage).isRequestThreadControlFromPageInbox
+  ).toEqual(false);
+  expect(
+    new MessengerEvent(postback).isRequestThreadControlFromPageInbox
   ).toEqual(false);
-  expect(new MessengerEvent(postback).isRequestThreadControlFromInbox).toEqual(
-    false
-  );
   expect(
     new MessengerEvent(requestThreadControlFromInbox).isRequestThreadControl
   ).toEqual(true);
   expect(
     new MessengerEvent(requestThreadControlFromInbox)
-      .isRequestThreadControlFromInbox
+      .isRequestThreadControlFromPageInbox
   ).toEqual(true);
 });