PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: cakephp/chronos (php)
Issue: Invalid deprecation error for Date::startOfWeek()
I just updated my installation of Chronos to the latest available version for the project (PHP 7.3, so best I get is 2.4.4), and I got this nonsensical error:
`(new Date($anyDateHere))->addWeeks(1)->startOfWeek()`
throws
`2.5 startOfDay() will be removed in 3.x.`
But this method calls `startOfDay()` implicitly, under the hood, users can't NOT call it.

Pull request description: Fix deprecations from internals for Date
Fix deprecations for startOfDay/endOfDay being called by startOfWeek/endOfWeek. Because dates don't have times we don't need to modify any time related components and can just return early.

Fixes #453

Patch:
diff --git a/src/Traits/ModifierTrait.php b/src/Traits/ModifierTrait.php
index 8d1797d..effe09a 100644
--- a/src/Traits/ModifierTrait.php
+++ b/src/Traits/ModifierTrait.php
@@ -1051,6 +1051,9 @@ trait ModifierTrait
         if ($dt->dayOfWeek !== static::$weekStartsAt) {
             $dt = $dt->previous(static::$weekStartsAt);
         }
+        if ($dt instanceof ChronosDate) {
+            return $dt;
+        }
 
         return $dt->startOfDay();
     }
@@ -1066,6 +1069,9 @@ trait ModifierTrait
         if ($dt->dayOfWeek !== static::$weekEndsAt) {
             $dt = $dt->next(static::$weekEndsAt);
         }
+        if ($dt instanceof ChronosDate) {
+            return $dt;
+        }
 
         return $dt->endOfDay();
     }


Test patch:
diff --git a/tests/TestCase/Date/AddTest.php b/tests/TestCase/Date/AddTest.php
index 9da9ccf..e6389b3 100644
--- a/tests/TestCase/Date/AddTest.php
+++ b/tests/TestCase/Date/AddTest.php
@@ -135,4 +135,22 @@ class AddTest extends TestCase
         $this->assertSame(2, $class::create(1975, 5, 31)->addWeekdays(1)->day);
         $this->assertSame(30, $class::create(1975, 5, 31)->addWeekdays(-1)->day);
     }
+
+    /**
+     * @dataProvider dateClassProvider
+     * @return void
+     */
+    public function testAddWeeksStartOfWeek($class)
+    {
+        $this->assertSame(8, (new $class('2024-7-2'))->addWeeks(1)->startOfWeek()->day);
+    }
+
+    /**
+     * @dataProvider dateClassProvider
+     * @return void
+     */
+    public function testAddWeeksEndOfWeek($class)
+    {
+        $this->assertSame(14, (new $class('2024-7-2'))->addWeeks(1)->endOfWeek()->day);
+    }
 }
diff --git a/tests/TestCase/DateTime/AddTest.php b/tests/TestCase/DateTime/AddTest.php
index 61fddb3..8e06fed 100644
--- a/tests/TestCase/DateTime/AddTest.php
+++ b/tests/TestCase/DateTime/AddTest.php
@@ -276,9 +276,9 @@ class AddTest extends TestCase
      */
     public function testAddWeeksStartOfWeek($class)
     {
-        $this->assertSame(5, (new $class(2024, 7, 2,))->addWeeks(1)->startOfWeek()->day);
+        $this->assertSame(5, (new $class(2024, 7, 2))->addWeeks(1)->startOfWeek()->day);
 
-        $this->assertSame(14, $class::createFromDate(2024, 7, 2,)->addWeeks(1)->endOfWeek()->day);
+        $this->assertSame(14, $class::createFromDate(2024, 7, 2)->addWeeks(1)->endOfWeek()->day);
     }
 
     /**
Repository: BurntSushi/toml (go)
Issue: x = [] decodes into nil
The following program works differently between 0.3.1 and 0.4.1:

```
package main

import (
    "log"
    "reflect"

    "github.com/BurntSushi/toml"
)

func main() {
    blob := `
    x = []
    `
    var d map[string]interface{}
    if _, err := toml.Decode(blob, &d); err != nil {
        log.Fatal(err)
    }

    x := d["x"]
    log.Println(x, reflect.ValueOf(x).IsNil())
}
```

On 0.3.1,
```
[] false
```

On 0.4.1,
```
[] true
```

For my use case, this is a problem because I'm subsequently encoding the value into JSON and it writes `x = null` instead of the expected `x = []`. It also goes deeper than that, for instance `x = [[]]` would get JSONed as `x = [null]`.

Is this an intended change? Do you think it would be possible/correct to restore the previous behaviour?
Pull request description: Decode S=[] into a non-nil []interface{}.
This restores v0.3 behaviour and also makes it
consistent with how the same decodes into something
like struct { S []string }.

Closes #338

Patch:
diff --git a/parse.go b/parse.go
index 618cbe4..05535a8 100644
--- a/parse.go
+++ b/parse.go
@@ -350,6 +350,10 @@ func (p *parser) valueArray(it item) (interface{}, tomlType) {
 		array []interface{}
 		types []tomlType
 	)
+	// Initialize to a non-nil empty slice. This makes it
+	// consistent with how S = [] decodes into a non-nil slice
+	// inside something like struct { S []string }.
+	array = []interface{}{}
 	for it = p.next(); it.typ != itemArrayEnd; it = p.next() {
 		if it.typ == itemCommentStart {
 			p.expect(itemText)


Test patch:
diff --git a/decode_test.go b/decode_test.go
index c89b572..f826ecf 100644
--- a/decode_test.go
+++ b/decode_test.go
@@ -618,6 +618,17 @@ func TestDecodeSlices(t *testing.T) {
 	}
 }
 
+func TestDecodeInterfaceSlice(t *testing.T) {
+	var v map[string]interface{}
+	if _, err := Decode(`S = []`, &v); err != nil {
+		t.Errorf(err.Error())
+	}
+	// S = [] should decode into a non-nil []interface{} (see issue #338).
+	if reflect.ValueOf(v["S"]).IsNil() {
+		t.Errorf("S is nil")
+	}
+}
+
 func TestDecodePrimitive(t *testing.T) {
 	type S struct {
 		P Primitive
Repository: platers/obsidian-linter (ts)
Issue: FR: Capitalize Headings, The words in the Lowercase words list to be Uppercase when it is the first letter
I want to request that for the function of `Capitalize Headings`, the words listed in `the Lowercase Words` better be uppercase when it is the first letter.

For example:
## the Best of the Best 

should be
## The Best of the Best

Thanks!
Pull request description: Capitalize 1st a - Z Character in a Heading
Fixes #171 

There was an issue where if the first letter of a heading was not a letter that is a through z then it would not capitalize the first letter. This PR changes that and adds a test to make sure it handles that scenario.

Changes Made:
- Updated the regex to ignore non a through z characters that start a heading and capitalize the first a through z character in the heading
- Added a UT to make sure this does not break in the future


Patch:
diff --git a/src/rules.ts b/src/rules.ts
index f2dbf15..81dd85c 100644
--- a/src/rules.ts
+++ b/src/rules.ts
@@ -1137,7 +1137,7 @@ export const rules: Rule[] = [
               case 'First Letter':
                 lines[i] = lines[i]
                     .toLowerCase()
-                    .replace(/^#*\s([a-z])/, (string) => string.toUpperCase()); // capitalize first letter of heading
+                    .replace(/^#*\s+([^a-z])*([a-z])/, (string) => string.toUpperCase()); // capitalize first letter of heading
                 break;
             }
           }


Test patch:
diff --git a/src/test.ts b/src/test.ts
index 9643a72..a86622b 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -197,6 +197,17 @@ describe('Rules tests', () => {
         `;
       expect(rulesDict['capitalize-headings'].apply(before, {'Style': 'First Letter'})).toBe(after);
     });
+    it('Can capitalize only first letter that is a - Z', () => {
+      const before = dedent`
+        # 1. heading attempt
+        # 1 John
+        `;
+      const after = dedent`
+        # 1. Heading attempt
+        # 1 John
+        `;
+      expect(rulesDict['capitalize-headings'].apply(before, {'Style': 'First Letter'})).toBe(after);
+    });
     it('Can capitalize to all caps', () => {
       const before = dedent`
         # this Is A Heading