PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: willowtreeapps/assertk (kotlin)

Issue:
Add `Assert<CharSequence>.doesNotContainMatch(regex: Regex)`
Like https://github.com/google/truth/blob/213a1569fe9ed49c4f3b87d923e7e29733f232e7/core/src/main/java/com/google/common/truth/StringSubject.java#L198-L213

Pull request:
Closes #515.

Patch:
diff --git a/assertk/src/commonMain/kotlin/assertk/assertions/charsequence.kt b/assertk/src/commonMain/kotlin/assertk/assertions/charsequence.kt
index ab0115fd..8d527586 100644
--- a/assertk/src/commonMain/kotlin/assertk/assertions/charsequence.kt
+++ b/assertk/src/commonMain/kotlin/assertk/assertions/charsequence.kt
@@ -117,6 +117,14 @@ fun Assert<CharSequence>.doesNotContain(expected: Iterable<CharSequence>, ignore
     expected("to not contain:${show(expected)} but was:${show(actual)}")
 }
 
+/**
+ * Asserts the char sequence does not contain the expected regular expression.
+ */
+fun Assert<CharSequence>.doesNotContainMatch(regex: Regex) = given { actual ->
+    if (!regex.containsMatchIn(actual)) return
+    expected("to not contain match:${show(regex)} but was:${show(actual)}")
+}
+
 /**
  * Asserts the char sequence starts with the expected char sequence.
  * @param ignoreCase true to compare ignoring case, the default if false.


Test patch:
diff --git a/assertk/src/commonTest/kotlin/test/assertk/assertions/CharSequenceTest.kt b/assertk/src/commonTest/kotlin/test/assertk/assertions/CharSequenceTest.kt
index 8eb64c0b..baaf942a 100644
--- a/assertk/src/commonTest/kotlin/test/assertk/assertions/CharSequenceTest.kt
+++ b/assertk/src/commonTest/kotlin/test/assertk/assertions/CharSequenceTest.kt
@@ -223,6 +223,22 @@ class CharSequenceTest {
     }
     //endregion
 
+    //region doesNotContainMatch
+    @Test
+    fun doesNotContainMatch_non_matching_value_passes() {
+        assertThat("abcd").doesNotContainMatch(Regex("\\d\\d\\d\\d"))
+    }
+
+    @Test
+    fun doesNotContainMatch_matching_value_fails() {
+        val regex = Regex("\\d\\d\\d\\d")
+        val error = assertFailsWith<AssertionError> {
+            assertThat("1234").doesNotContainMatch(regex)
+        }
+        assertEquals("expected to not contain match:${show(regex)} but was:<\"1234\">", error.message)
+    }
+    //endregion
+
     //region startsWith
     @Test
     fun startsWith_value_prefix_passes() {
Repository: amoffat/sh (python)

Issue:
Need way for await sh.command to return RunningCommand
I'm finally porting [Carthage](https://github.com/hadron/carthage)  from sh 1.x to sh 2.x. We had our own hack to enable async for sh, and we had a lot of code that did things like
```python
result = await sh.ssh(...)
```
And then for example looked at `result.stdout`.
So, part of this can be handled by setting `_return_cmd=True`, but the definition of `RunningCommand.__await__` is hard-coded to return `str(self)`.
Obviously, I can do something like
```python
result = sh.ssh(...)
await result
```
But that feels clumsy.
I'd like a kwarg that returns a RunningCommand even on async await.
My preference would be to try and convince you that `_return_cmd` should affect await as well as __call__, but if you are concerned about the API instability, I'm happy with anything that I can pass into bake.

Thanks for your consideration.


Pull request:
await command with _return_cmd True returns RunningCommand
If _return_cmd is True, have __await__ return the RunningCommand object rather than a string representation. Fixes #743

I'm having trouble getting the lint tox environment to pass; it fails even before my change wanting to reformat sh.py. I don't understand what the diff is trying to do so I don't know if it is a local environmental issue or something else.

Patch:
diff --git a/sh.py b/sh.py
index d52d8b6..b02d6e1 100644
--- a/sh.py
+++ b/sh.py
@@ -889,7 +889,10 @@ class RunningCommand:
     def __await__(self):
         async def wait_for_completion():
             await self.aio_output_complete.wait()
-            return str(self)
+            if self.call_args["return_cmd"]:
+                return self
+            else:
+                return str(self)
 
         return wait_for_completion().__await__()
 


Test patch:
diff --git a/tests/sh_test.py b/tests/sh_test.py
index 8a87fd6..0fe0311 100644
--- a/tests/sh_test.py
+++ b/tests/sh_test.py
@@ -1732,7 +1732,7 @@ print("hello")
         py = create_tmp_test("""exit(34)""")
 
         async def producer():
-            await python(py.name, _async=True)
+            await python(py.name, _async=True, _return_cmd=False)
 
         self.assertRaises(sh.ErrorReturnCode_34, asyncio.run, producer())
 
@@ -1786,6 +1786,22 @@ exit(34)
 
         self.assertRaises(sh.ErrorReturnCode_34, asyncio.run, producer())
 
+    def test_async_return_cmd(self):
+        py = create_tmp_test(
+            """
+import sys
+sys.exit(0)
+"""
+        )
+
+        async def main():
+            result = await python(py.name, _async=True, _return_cmd=True)
+            self.assertIsInstance(result, sh.RunningCommand)
+            result_str = await python(py.name, _async=True, _return_cmd=False)
+            self.assertIsInstance(result_str, str)
+
+        asyncio.run(main())
+
     def test_handle_both_out_and_err(self):
         py = create_tmp_test(
             """
Repository: alecthomas/gometalinter (go)

Issue:
Custom linters have nil PartitionStrategy 
Using the following config produces the following error.
The reason is that [`NewLinter`](https://github.com/alecthomas/gometalinter/blob/master/linters.go#L30) doesn't set the `PartitionStrategy`.

```json
{
  "Linters": { "license": "grep -rL 'Apache License' {path}:^(?P<path>.*?\\.go.*)"},
  "Severity": {"license": "error"},
  "Enable": ["license"]
}
```

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11ef957]

goroutine 1 [running]:
main.(*linterState).Partitions(0xc4201084b0, 0xc4201084b0, 0xc420049dd0, 0xc420096208, 0xc420010240, 0xc4200123e0)
        /go/src/github.com/alecthomas/gometalinter/execute.go:85 +0xb7
main.runLinters(0xc4201a7bc0, 0xc4200bb400, 0x28, 0x28, 0x8, 0x0, 0x0, 0x28, 0x28)
        /go/src/github.com/alecthomas/gometalinter/execute.go:126 +0xad8
main.main()
        /go/src/github.com/alecthomas/gometalinter/main.go:179 +0x39e

```

Pull request:
Set a default partition strategy for custom linters.
Fixes #332 

Apparently golang doesn't let you compare functions so testing for NotNil was the best I could find.

Patch:
diff --git a/linters.go b/linters.go
index fdb15bc..0002287 100644
--- a/linters.go
+++ b/linters.go
@@ -35,6 +35,9 @@ func NewLinter(config LinterConfig) (*Linter, error) {
 	if err != nil {
 		return nil, err
 	}
+	if config.PartitionStrategy == nil {
+		config.PartitionStrategy = partitionToMaxArgSize
+	}
 	return &Linter{
 		LinterConfig: config,
 		regex:        regex,
@@ -66,6 +69,7 @@ func parseLinterSpec(name string, spec string) *Linter {
 
 	config := defaultLinters[name]
 	config.Command, config.Pattern = parts[0], parts[1]
+	config.Name = name
 
 	linter, err := NewLinter(config)
 	kingpin.FatalIfError(err, "invalid linter %q", name)


Test patch:
diff --git a/linters_test.go b/linters_test.go
new file mode 100644
index 0000000..beb619b
--- /dev/null
+++ b/linters_test.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+)
+
+func TestNewLinterWithCustomLinter(t *testing.T) {
+	config := LinterConfig{
+		Command: "/usr/bin/custom",
+		Pattern: "path",
+	}
+	linter, err := NewLinter(config)
+	require.NoError(t, err)
+	assert.NotNil(t, linter.LinterConfig.PartitionStrategy)
+}
Repository: goccy/go-yaml (go)

Issue:
not parsed after newline in block string
複数行文字列を単体でパースしようと思うと、二行目以降が切り捨てられてしまうようです。

https://play.golang.org/p/iHIxeMMDhT5

親構造体で `UnmarshalYAML`を定義していて、文字列のフィールドを個別にUnmarshal()する必要がある場合に問題がおきました。

Pull request:
Fix parsing of literal token
resolve #33 #34 

Patch:
diff --git a/scanner/context.go b/scanner/context.go
index 2292f9b..d7f70df 100644
--- a/scanner/context.go
+++ b/scanner/context.go
@@ -123,6 +123,10 @@ func (c *Context) nextPos() int {
 func (c *Context) bufferedSrc() string {
 	src := strings.TrimLeft(string(c.buf), " ")
 	src = strings.TrimRight(src, " ")
+	if len(src) > 0 && src[len(src)-1] == '\n' && c.isDocument() && c.literalOpt == "-" {
+		// remove end '\n' character
+		src = src[:len(src)-1]
+	}
 	return src
 }
 
diff --git a/scanner/scanner.go b/scanner/scanner.go
index da73fce..907ede6 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -227,12 +227,14 @@ func (s *Scanner) scanComment(ctx *Context) (tk *token.Token, pos int) {
 }
 
 func (s *Scanner) scanLiteral(ctx *Context, c rune) {
+	ctx.addOriginBuf(c)
 	if ctx.isEOS() {
+		ctx.addBuf(c)
 		value := ctx.bufferedSrc()
 		ctx.addToken(token.New(value, string(ctx.obuf), s.pos()))
 		ctx.resetBuffer()
-	}
-	if c == '\n' {
+		s.progressColumn(ctx, 1)
+	} else if c == '\n' {
 		if ctx.isLiteral {
 			ctx.addBuf(c)
 		} else {
@@ -251,7 +253,6 @@ func (s *Scanner) scanLiteral(ctx *Context, c rune) {
 		ctx.addBuf(c)
 		s.progressColumn(ctx, 1)
 	}
-	ctx.addOriginBuf(c)
 }
 
 func (s *Scanner) scanLiteralHeader(ctx *Context) (pos int, err error) {
@@ -275,6 +276,7 @@ func (s *Scanner) scanLiteralHeader(ctx *Context) (pos int, err error) {
 					ctx.addToken(token.Folded(">"+opt, string(ctx.obuf), s.pos()))
 					ctx.isFolded = true
 				}
+				s.indentState = IndentStateKeep
 				ctx.resetBuffer()
 				ctx.literalOpt = opt
 				return


Test patch:
diff --git a/parser/parser_test.go b/parser/parser_test.go
index 49c09ac..2abd84b 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -393,6 +393,19 @@ a:
       [ 1, 2 ]
     }
   c: d
+`,
+		},
+		{
+			`
+|
+    hoge
+    fuga
+    piyo`,
+			`
+|
+    hoge
+    fuga
+    piyo
 `,
 		},
 	}