PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: google/yamlfmt (go)
Issue: yamlfmt removes comment from yaml with only a comment
```
% cat comment.yml
# comment

% go tool yamlfmt -v comment.yml
The following files were modified:
comment.yml

% cat comment.yml
%
```

Version: 0.17.0
This happens with empty config.
Pull request description: formatters/basic: fix just comments edge case
Fixes #254 

When `yaml.v3` parses a document that's just comments, it ends up parsing no actual nodes and thus loses the comment information. This will now be treated as an edge case and return the original content, in essence not modifying it if the yaml parsed successfully but no nodes are parsed out.

Patch:
diff --git a/formatters/basic/formatter.go b/formatters/basic/formatter.go
index f8c9b7b..1e69bdb 100644
--- a/formatters/basic/formatter.go
+++ b/formatters/basic/formatter.go
@@ -64,6 +64,10 @@ func (f *BasicFormatter) Format(input []byte) ([]byte, error) {
 		documents = append(documents, docNode)
 	}
 
+	if len(documents) == 0 {
+		return input, nil
+	}
+
 	// Run all YAML features.
 	for _, d := range documents {
 		if err := f.YAMLFeatures.ApplyFeatures(d); err != nil {


Test patch:
diff --git a/formatters/basic/formatter_test.go b/formatters/basic/formatter_test.go
index 587b21d..84bec82 100644
--- a/formatters/basic/formatter_test.go
+++ b/formatters/basic/formatter_test.go
@@ -455,3 +455,17 @@ b:
 		t.Fatalf("expected: '%s', got: '%s'", expectedYml, result)
 	}
 }
+
+func TestJustComments(t *testing.T) {
+	config := basic.DefaultConfig()
+	f := newFormatter(config)
+
+	yml := `# hi`
+	expectedYml := `# hi`
+	result, err := f.Format([]byte(yml))
+	assert.NilErr(t, err)
+	resultStr := string(result)
+	if resultStr != expectedYml {
+		t.Fatalf("expected: '%s', got: '%s'", expectedYml, result)
+	}
+}
Repository: kayak/pypika (python)
Issue: OFFSET and LIMIT are applied in the wrong order
Example:

```python
    def test_select_with_limit_and_offset(self):
        q1 = Query.from_('abc').select('foo')[10:10]

        self.assertEqual('SELECT "foo" FROM "abc" OFFSET 10 LIMIT 10', str(q1))
```

The query should actually be `SELECT "foo" FROM "abc" LIMIT 10 OFFSET 10`
Pull request description: Re-ordered limit and offset in queries. Fixes #63.

Patch:
diff --git a/pypika/queries.py b/pypika/queries.py
index 3fc4a92..2871dd3 100644
--- a/pypika/queries.py
+++ b/pypika/queries.py
@@ -539,12 +539,12 @@ class QueryBuilder(Selectable, Term):
         if self._orderbys:
             querystring += self._orderby_sql(**kwargs)
 
-        if self._offset:
-            querystring += self._offset_sql()
-
         if self._limit:
             querystring += self._limit_sql()
 
+        if self._offset:
+            querystring += self._offset_sql()
+
         if subquery:
             querystring = '({query})'.format(query=querystring)
 


Test patch:
diff --git a/pypika/tests/test_selects.py b/pypika/tests/test_selects.py
index 06e4aba..45baea3 100644
--- a/pypika/tests/test_selects.py
+++ b/pypika/tests/test_selects.py
@@ -137,7 +137,7 @@ class SelectTests(unittest.TestCase):
     def test_select_with_limit_and_offset(self):
         q1 = Query.from_('abc').select('foo')[10:10]
 
-        self.assertEqual('SELECT "foo" FROM "abc" OFFSET 10 LIMIT 10', str(q1))
+        self.assertEqual('SELECT "foo" FROM "abc" LIMIT 10 OFFSET 10', str(q1))
 
     def test_mysql_query_uses_backtick_quote_chars(self):
         q = MySQLQuery.from_('abc').select('foo', 'bar')