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

Issue:
EmptyKtFile should be able to ignore package declaration
Rule: EmptyKtFile

## Expected Behavior of the rule

There should be a way to exclude the package declaration. A package declaration says "where" a kotlin file is in the package hierarchy, and is generally not considered content of the file.

## Context

There are rules like MissingPackageDeclaration as well as IDE automations that may cause empty kotlin files to end up with a package delcaration. Without this feature, the `EmptyKtFile` is practically useless in many projects.

Pull request:
Fixes https://github.com/detekt/detekt/issues/6788

Patch:
diff --git a/detekt-rules-empty/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFile.kt b/detekt-rules-empty/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFile.kt
index 3a08c057dfd6..c02f6381c50b 100644
--- a/detekt-rules-empty/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFile.kt
+++ b/detekt-rules-empty/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFile.kt
@@ -13,7 +13,13 @@ import org.jetbrains.kotlin.psi.KtFile
 class EmptyKotlinFile(config: Config) : EmptyRule(config) {
 
     override fun visitKtFile(file: KtFile) {
-        if (file.text.isNullOrBlank()) {
+        var text = file.text
+        val packageDirective = file.packageDirective
+        if (packageDirective != null) {
+            val range = packageDirective.textRange
+            text = text.removeRange(range.startOffset, range.endOffset)
+        }
+        if (text.isNullOrBlank()) {
             report(
                 CodeSmell(
                     issue,


Test patch:
diff --git a/detekt-rules-empty/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFileSpec.kt b/detekt-rules-empty/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFileSpec.kt
new file mode 100644
index 000000000000..9497369d2a24
--- /dev/null
+++ b/detekt-rules-empty/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKotlinFileSpec.kt
@@ -0,0 +1,37 @@
+package io.gitlab.arturbosch.detekt.rules.empty
+
+import io.gitlab.arturbosch.detekt.api.Config
+import io.gitlab.arturbosch.detekt.test.assertThat
+import io.gitlab.arturbosch.detekt.test.compileAndLint
+import io.gitlab.arturbosch.detekt.test.lint
+import org.junit.jupiter.api.Test
+
+class EmptyKotlinFileSpec {
+    private val subject = EmptyKotlinFile(Config.empty)
+
+    private val codeWithPackageStatement = """
+            package my.packagee
+    """.trimIndent()
+
+    private val codeWithFunction = """
+            package my.packagee
+            
+            fun myFunction() {}
+    """.trimIndent()
+
+    @Test
+    fun `reports empty if file is blank`() {
+        val code = ""
+        assertThat(subject.lint(code)).hasSize(1)
+    }
+
+    @Test
+    fun `does report file with package statement`() {
+        assertThat(subject.compileAndLint(codeWithPackageStatement)).hasSize(1)
+    }
+
+    @Test
+    fun `does not report file with code`() {
+        assertThat(subject.compileAndLint(codeWithFunction)).hasSize(0)
+    }
+}
Repository: polarsignals/frostdb (go)

Issue:
why the test case " Benchmark_Table_Insert_100Rows_100Iters_100Writers" cannot pass  tests? 
Hi, frostdb is a great project, I use newest frostdb to benchmark table instert, i found  Benchmark_Table_Insert_100Rows_100Iters_100Writers(table_test.go) can't pass, output below wrong:
    table_test.go:278: 
        	Error Trace:	/media/vdc/workspace/src/github.com/polarsignals/frostdb/table_test.go:278
        	            				/media/vdc/workspace/src/github.com/polarsignals/frostdb/table_test.go:177
        	Error:      	Not equal: 
        	            	expected: 1000000
        	            	actual  : 528400
        	Test:       	Benchmark_Table_Insert_100Rows_100Iters_100Writers
--- FAIL: Benchmark_Table_Insert_100Rows_100Iters_100Writers-8

Benchmark_Table_Insert_1000Rows_10Iters_10Writers and Benchmark_Table_Insert_100Rows_1000Iters_1Writers  are passed

Pull request:
fix missing compaction parts
Fixes #584 

Patch:
diff --git a/parts/part.go b/parts/part.go
index e7cd9f5..0d5cb29 100644
--- a/parts/part.go
+++ b/parts/part.go
@@ -306,6 +306,7 @@ func FindMaximumNonOverlappingSet(schema *dynparquet.Schema, parts []*Part) ([]*
 	}
 	nonOverlapping := make([]*Part, 0, len(parts))
 	overlapping := make([]*Part, 0, len(parts))
+	var missing *Part
 	for i := 1; i < len(parts); i++ {
 		start, err := parts[i].Least()
 		if err != nil {
@@ -334,6 +335,10 @@ func FindMaximumNonOverlappingSet(schema *dynparquet.Schema, parts []*Part) ([]*
 			// The current part must be removed. Don't update prevEnd or prev,
 			// this will be used in the next iteration and must stay the same.
 			overlapping = append(overlapping, parts[i])
+
+			if i == len(parts)-1 { // This is the last iteration mark this one as missing
+				missing = parts[prev]
+			}
 		}
 	}
 	if len(overlapping) == 0 || overlapping[len(overlapping)-1] != parts[len(parts)-1] {
@@ -342,6 +347,8 @@ func FindMaximumNonOverlappingSet(schema *dynparquet.Schema, parts []*Part) ([]*
 		// previous part is in the overlapping slice). The last part must be
 		// appended to nonOverlapping.
 		nonOverlapping = append(nonOverlapping, parts[len(parts)-1])
+	} else if missing != nil {
+		overlapping = append(overlapping, missing)
 	}
 	return nonOverlapping, overlapping, nil
 }


Test patch:
diff --git a/parts/part_test.go b/parts/part_test.go
index f0e4f64..622957f 100644
--- a/parts/part_test.go
+++ b/parts/part_test.go
@@ -74,6 +74,12 @@ func TestFindMaximumNonOverlappingSet(t *testing.T) {
 			expectedNonOverlapping: []rng{{1, 3}, {4, 5}, {6, 7}},
 			expectedOverlapping:    []rng{{2, 4}},
 		},
+		{
+			name:                   "OnlyTwoOverlap",
+			ranges:                 []rng{{1, 3}, {2, 4}},
+			expectedNonOverlapping: []rng{},
+			expectedOverlapping:    []rng{{2, 4}, {1, 3}},
+		},
 	} {
 		t.Run(tc.name, func(t *testing.T) {
 			parts := make([]*Part, len(tc.ranges))