PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: stretchr/testify (go)
Issue: Panic in mock.Arguments.String
A regression in callString():
```
panic(0x28ff20, 0xdd3bc0)
	/usr/local/go/src/runtime/panic.go:967 +0x166
github.com/stretchr/testify/mock.Arguments.String(0xc000474840, 0x2, 0x2, 0x0, 0x0, 0x0, 0x1, 0x1)
	third-party-source/go/github.com/stretchr/testify/mock/mock.go:833 +0xd1
github.com/stretchr/testify/mock.(*Mock).AssertExpectations(0xc0000a8640, 0x4f7a00, 0xc000199b00, 0x4f3500)
	third-party-source/go/github.com/stretchr/testify/mock/mock.go:464 +0x3b3
```

A proposed fix is coming shortly.
Pull request description: mock: callString to handle nil nicely
## Summary
Fixes a regression in `testify/mock`.
## Changes
Handle nil in Arguments.String() by employing fmt.Sprint().

## Motivation
A regression introduced while replacing `fmt.Sprint()` with `reflect.TypeOf(arg)` in `Arguments.String()`: `reflect.TypeOf(nil)` returns `nil` which is its documented behaviour. A null pointer dereference is what follows.

A unit test case added.

## Related issues
Closes #936.


Patch:
diff --git a/mock/mock.go b/mock/mock.go
index a6d9526..c6df448 100644
--- a/mock/mock.go
+++ b/mock/mock.go
@@ -855,7 +855,7 @@ func (args Arguments) String(indexOrNil ...int) string {
 		// normal String() method - return a string representation of the args
 		var argsStr []string
 		for _, arg := range args {
-			argsStr = append(argsStr, reflect.TypeOf(arg).String())
+			argsStr = append(argsStr, fmt.Sprintf("%T", arg)) // handles nil nicely
 		}
 		return strings.Join(argsStr, ",")
 	} else if len(indexOrNil) == 1 {


Test patch:
diff --git a/mock/mock_test.go b/mock/mock_test.go
index 1b681aa..cb49541 100644
--- a/mock/mock_test.go
+++ b/mock/mock_test.go
@@ -778,6 +778,7 @@ func Test_Mock_findExpectedCall_Respects_Repeatability(t *testing.T) {
 func Test_callString(t *testing.T) {
 
 	assert.Equal(t, `Method(int,bool,string)`, callString("Method", []interface{}{1, true, "something"}, false))
+	assert.Equal(t, `Method(<nil>)`, callString("Method", []interface{}{nil}, false))
 
 }
Repository: platers/obsidian-linter (ts)
Issue: Bug: `Format Yaml Array` rule breaks nested YAML objects
## Describe the Bug

`Format Yaml Array` rule breaks nested YAML objects

## How to Reproduce

Steps to reproduce the behavior:

``` markdown
---
key1:
  key2: value2
  key3:
    - item1
    - item2
---
```

## Expected Behavior

Not changed

## Actual Behavior

```markdown
key1:
  - item1
  - item2
```markdown
Pull request description: Don't call format array for non-arrays
Fixes #477 

Patch:
diff --git a/src/rules/format-yaml-arrays.ts b/src/rules/format-yaml-arrays.ts
index eabbf93..c3ee018 100644
--- a/src/rules/format-yaml-arrays.ts
+++ b/src/rules/format-yaml-arrays.ts
@@ -49,11 +49,6 @@ export default class RuleTemplate extends RuleBuilder<FormatYamlArrayOptions> {
         return text;
       }
 
-      // https://stackoverflow.com/a/44198641
-      const isValidDate = function(date: any) {
-        return date && Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date);
-      };
-
       if (options.formatAliasKey && Object.keys(yaml).includes(OBSIDIAN_ALIASES_KEY)) {
         text = setYamlSection(text, OBSIDIAN_ALIASES_KEY, formatYamlArrayValue(convertAliasValueToStringOrStringArray(splitValueIfSingleOrMultilineArray(getYamlSectionValue(text, OBSIDIAN_ALIASES_KEY))), options.aliasArrayStyle));
       }
@@ -67,7 +62,7 @@ export default class RuleTemplate extends RuleBuilder<FormatYamlArrayOptions> {
 
         for (const key of Object.keys(yaml)) {
           // skip non-arrays and already accounted for keys
-          if (keysToIgnore.includes(key) || !(typeof yaml[key] === 'object' && !isValidDate(yaml[key]) && yaml[key] as string[])) {
+          if (keysToIgnore.includes(key) || !Array.isArray(yaml[key])) {
             continue;
           }
 


Test patch:
diff --git a/__tests__/format-yaml-arrays.test.ts b/__tests__/format-yaml-arrays.test.ts
index 77c6060..a7c7c94 100644
--- a/__tests__/format-yaml-arrays.test.ts
+++ b/__tests__/format-yaml-arrays.test.ts
@@ -785,5 +785,29 @@ ruleTest({
         ---
       `,
     },
+    {
+      testName: 'Nested objects are preserved',
+      before: dedent`
+        ---
+        key1:
+          key2: value2
+          key3:
+            - item1
+            - item2
+        ---
+      `,
+      after: dedent`
+        ---
+        key1:
+          key2: value2
+          key3:
+            - item1
+            - item2
+        ---
+      `,
+      options: {
+        defaultArrayStyle: NormalArrayFormats.MultiLine,
+      },
+    },
   ],
 });
Repository: vaskoz/dailycodingproblem-go (go)
Issue: Day 89
Good morning! Here's your coding interview problem for today.

This problem was asked by LinkedIn.

Determine whether a tree is a valid binary search tree.

A binary search tree is a tree with two children, left and right, and satisfies the constraint that the key in the left child must be less than or equal to the root and the key in the right child must be greater than or equal to the root.
Pull request description: Day89
Resolves #187.

Patch:
diff --git a/README.md b/README.md
index fc4f1e4..56aaefc 100644
--- a/README.md
+++ b/README.md
@@ -98,3 +98,4 @@ problems from
 * [Day 86](https://github.com/vaskoz/dailycodingproblem-go/issues/181)
 * [Day 87](https://github.com/vaskoz/dailycodingproblem-go/issues/183)
 * [Day 88](https://github.com/vaskoz/dailycodingproblem-go/issues/185)
+* [Day 89](https://github.com/vaskoz/dailycodingproblem-go/issues/187)
diff --git a/day89/problem.go b/day89/problem.go
new file mode 100644
index 0000000..1d36eb5
--- /dev/null
+++ b/day89/problem.go
@@ -0,0 +1,24 @@
+package day89
+
+// BST represents a binary search tree.
+type BST struct {
+	Value       int
+	Left, Right *BST
+}
+
+// IsValidBST checks if the given tree conforms to the BST property.
+func IsValidBST(root *BST) bool {
+	const MaxInt = int(^uint(0) >> 1)
+	const MinInt = -MaxInt - 1
+	return isValidBST(root.Left, MinInt, root.Value) && isValidBST(root.Right, root.Value, MaxInt)
+}
+
+func isValidBST(root *BST, min, max int) bool {
+	if root == nil {
+		return true
+	}
+	if root.Value > min && root.Value <= max {
+		return isValidBST(root.Left, min, root.Value) && isValidBST(root.Right, root.Value, max)
+	}
+	return false
+}


Test patch:
diff --git a/day89/problem_test.go b/day89/problem_test.go
new file mode 100644
index 0000000..6cf01c8
--- /dev/null
+++ b/day89/problem_test.go
@@ -0,0 +1,29 @@
+package day89
+
+import "testing"
+
+var testcases = []struct {
+	root    *BST
+	isValid bool
+}{
+	{&BST{}, true},
+	{&BST{10, &BST{1, nil, nil}, &BST{20, nil, nil}}, true},
+	{&BST{10, &BST{20, nil, nil}, &BST{1, nil, nil}}, false},
+}
+
+func TestIsValidBST(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := IsValidBST(tc.root); result != tc.isValid {
+			t.Errorf("Expected %v got %v", tc.isValid, result)
+		}
+	}
+}
+
+func BenchmarkIsValidBST(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			IsValidBST(tc.root)
+		}
+	}
+}