PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: ABridoux/scout (swift)
Issue: Jaro-Winkler distance crashes with one character key
**Describe the bug**
The Jaro-Winkler distance computing crashed with an index out of bounds when a key with one character is encountered.
Pull request description: Closes #253

Patch:
diff --git a/Sources/Scout/Extensions/String+Jaro-Winkler.swift b/Sources/Scout/Extensions/String+Jaro-Winkler.swift
index 902c924c..f105fc7a 100644
--- a/Sources/Scout/Extensions/String+Jaro-Winkler.swift
+++ b/Sources/Scout/Extensions/String+Jaro-Winkler.swift
@@ -38,7 +38,7 @@ private struct JaroWinklerDistance {
         self.string1 = string1
         self.string2 = string2
 
-        maxSpacing = max(string1.count, string2.count) / 2 - 1
+        maxSpacing = max(0, max(string1.count, string2.count) / 2 - 1)
     }
 
     func computeMatches() -> [Int] {


Test patch:
diff --git a/Tests/ScoutTests/ExtensionsTests/String+Jaro-WinklerTests.swift b/Tests/ScoutTests/ExtensionsTests/String+Jaro-WinklerTests.swift
index 9a0cf573..c6d06fbd 100644
--- a/Tests/ScoutTests/ExtensionsTests/String+Jaro-WinklerTests.swift
+++ b/Tests/ScoutTests/ExtensionsTests/String+Jaro-WinklerTests.swift
@@ -33,4 +33,9 @@ final class String_JaroWinklerTests: XCTestCase {
         let result = target.bestJaroWinklerMatchIn(propositions: propositions)
         XCTAssertEqual(result, "version")
     }
+
+    func testMatchSingleCharacters_Equals0() {
+        let result = "b".jaroWinklerDistance(from: "a")
+        XCTAssertEqual(result, 0)
+    }
 }
Repository: laboratoriobridge/bold (ts)
Issue: [FileUploader] The file name overflows when annexing a file with a long name
### **Description**
When a file with a long name is annexed, the name extends beyond the component's borders.
 
### **Steps to reproduce the behavior**:
1. Annex a file with a long name (longer than ~70 characters);
2. See that the file name is displayed incorrectly.
 
### **Expected behavior**
If the file name is too long, it should break into multiple lines.
 
### **Screenshots**

![Image](https://github.com/user-attachments/assets/506b5436-1e35-40f4-abac-4995853b012e)

### **Desktop:**
 - OS: Ubuntu 22.04.5 LTS x86_64
 - Browser: Firefox
 - Version: 134.0.2
Pull request description: Truncate the filename in the Fileuploader component
* closes #889 



Patch:
diff --git a/src/components/FileUploader/FileUploader.tsx b/src/components/FileUploader/FileUploader.tsx
index c25dd35e3..57fc22c7b 100644
--- a/src/components/FileUploader/FileUploader.tsx
+++ b/src/components/FileUploader/FileUploader.tsx
@@ -90,7 +90,7 @@ export function FileInfo(props: FileInfoProps) {
       {!file.error && !file.uploading && (
         <Icon icon='checkDefault' fill='primary' size={1} style={{ marginRight: 5 }} />
       )}
-      <Text fontWeight='bold' style={{ marginRight: 10 }}>
+      <Text fontWeight='bold' style={classes.fileName}>
         {file.selectedFile.name}
       </Text>
       <Text>{format(file.selectedFile.size, 0)}</Text>
@@ -168,4 +168,8 @@ export const createStyles = (theme: Theme) => ({
     flexGrow: 1,
     marginLeft: '1rem',
   },
+  fileName: {
+    wordBreak: 'break-all',
+    marginRight: 10,
+  } as CSSProperties,
 })


Test patch:
diff --git a/src/components/FileUploader/__snapshots__/FileUploader.test.tsx.snap b/src/components/FileUploader/__snapshots__/FileUploader.test.tsx.snap
index 783aab33d..e7db6f579 100644
--- a/src/components/FileUploader/__snapshots__/FileUploader.test.tsx.snap
+++ b/src/components/FileUploader/__snapshots__/FileUploader.test.tsx.snap
@@ -119,6 +119,7 @@ exports[`should render correct without extension 1`] = `
   line-height: 1.5;
   color: #24252E;
   font-weight: bold;
+  word-break: break-all;
   margin-right: 10px;
 }
 
@@ -430,6 +431,7 @@ exports[`should render correctly at uploading state 1`] = `
   line-height: 1.5;
   color: #24252E;
   font-weight: bold;
+  word-break: break-all;
   margin-right: 10px;
 }
 
@@ -656,6 +658,7 @@ exports[`should render correctly complete state 1`] = `
   line-height: 1.5;
   color: #24252E;
   font-weight: bold;
+  word-break: break-all;
   margin-right: 10px;
 }
Repository: node-influx/node-influx (ts)
Issue: Placeholders / bind parameters should support number variables
## Expected Behavior

Placeholders / bind parameters should both number and string variables.

## Actual Behavior

Placeholders / bind parameters support only string variables

## Steps/Code to Reproduce the Problem

```
influx.query(
  'select * from response_times where host = $host and time > $from', 
  { 
    placeholders: { host: 'example', from: 1609459200000000000 } 
  }
);
```

## Specifications

- Version: 5.9.1
- Platform: macOS
Pull request description: fix: #587 Placeholders / bind parameters support for number variables
Fixes #587

## Proposed Changes

Placeholders / bind parameters support for number variables

## Checklist

- [x] A test has been added if appropriate
- [x] `npm test` completes successfully
- [x] Commit messages are in [semantic format](https://seesparkbox.com/foundry/semantic_commit_messages)


Patch:
diff --git a/src/index.ts b/src/index.ts
index 01cded4..5243646 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -205,7 +205,7 @@ export interface IQueryOptions {
    * Any placeholders used by the query. Using these is strongly recommended
    * to avoid injection attacks.
    */
-  placeholders?: Record<string, string>;
+  placeholders?: Record<string, string | number>;
 }
 
 export interface IParseOptions {


Test patch:
diff --git a/test/unit/influx.test.ts b/test/unit/influx.test.ts
index b20fa56..05dbb25 100644
--- a/test/unit/influx.test.ts
+++ b/test/unit/influx.test.ts
@@ -981,23 +981,26 @@ describe("influxdb", () => {
         expectQuery(
           "json",
           {
-            q: "select * from series_0 WHERE time > now() - $<since>",
+            q: "select * from series_0 WHERE time > now() - $<since> AND value >= $<minimumValue>",
             epoch: undefined,
             rp: "asdf",
             db: "my_db",
-            params: '{"since":"10s"}',
+            params: '{"since":"10s","minimumValue":12}',
           },
           "GET",
           dbFixture("selectFromOne")
         );
 
         return influx.query(
-          ["select * from series_0 WHERE time > now() - $<since>"],
+          [
+            "select * from series_0 WHERE time > now() - $<since> AND value >= $<minimumValue>",
+          ],
           {
             precision: "n",
             retentionPolicy: "asdf",
             placeholders: {
               since: "10s",
+              minimumValue: 12,
             },
           }
         );
Repository: platers/obsidian-linter (ts)
Issue: Bug: move-footnotes-to-the-bottom 
## Describe the Bug

A clear and concise description of what the bug is.

## How to Reproduce

``` markdown
xxx[^1]

[^1]:[b](http://b.com)

- [a](http://a.com)
```

after save

actual result:

```
xxx[^1]

- [b](http://b.com)

[^1]:[a](http://a.com)
```


## Expected Behavior


``` markdown
xxx[^1]

- [a](http://a.com)

[^1]:[b](http://b.com)
```

## Screenshots

If applicable, add screenshots to help explain your problem.

## Device

- [x] Desktop
- [ ] Mobile

## Additional Context

Add any other context about the problem here.

Pull request description: Update Move Footnote Logic to Not Ignore Tags and Links to Prevent Out of Order Values
Fixes #389 

Changes Made:
- Added a test to let us know if we recreate this issue down the road
- Updated the logic for moving footnotes to the bottom to no longer ignore tags or links to make sure that we can properly move links and tags to the bottom of a file when footnotes include them as their content

Patch:
diff --git a/src/rules/move-footnotes-to-the-bottom.ts b/src/rules/move-footnotes-to-the-bottom.ts
index ad047ac..a0cb2fd 100644
--- a/src/rules/move-footnotes-to-the-bottom.ts
+++ b/src/rules/move-footnotes-to-the-bottom.ts
@@ -22,7 +22,7 @@ export default class MoveFootnotesToTheBottom extends RuleBuilder<MoveFootnotesT
     return RuleType.FOOTNOTE;
   }
   apply(text: string, options: MoveFootnotesToTheBottomOptions): string {
-    return ignoreListOfTypes([IgnoreTypes.code, IgnoreTypes.yaml, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.tag], text, (text) => {
+    return ignoreListOfTypes([IgnoreTypes.code, IgnoreTypes.yaml], text, (text) => {
       return moveFootnotesToEnd(text);
     });
   }


Test patch:
diff --git a/__tests__/move-footnotes-to-the-bottom.test.ts b/__tests__/move-footnotes-to-the-bottom.test.ts
index 88e10dd..226c04d 100644
--- a/__tests__/move-footnotes-to-the-bottom.test.ts
+++ b/__tests__/move-footnotes-to-the-bottom.test.ts
@@ -155,6 +155,24 @@ ruleTest({
         [^2]: footnote B (last in document)
       `,
     },
+    {
+      // accounts for https://github.com/platers/obsidian-linter/issues/389
+      testName: 'Make sure that links that are the footnote text get moved to the bottom correctly',
+      before: dedent`
+        xxx[^1]
+
+        [^1]:[b](http://b.com)
+
+        - [a](http://a.com)
+      `,
+      after: dedent`
+        xxx[^1]
+
+        - [a](http://a.com)
+
+        [^1]:[b](http://b.com)
+      `,
+    },
   ],
 });
Repository: jsonata-js/jsonata (js)
Issue: $parseInteger fails with "#" picture string
I'm doing this from Node Red, which is using JSONata 1.6, so this may have been fixed, but I cannot confirm.

`$parseInteger("50", "#")` produces the following error:

`Invalid JSONata expression: matchSpec.parse is not a function`.

After some investigation I found `$formatInteger(50, "#")` is not handled, but produces a better error message:

`Invalid JSONata expression: Formatting an integer as a sequence starting with "#" is not supported by this implementation`

This looks like error D3130, and since this error still exists in 1.7, I'm guessing the other error still occurs too. Is it possible to improve the error message?

Pull request description: check for unsupported sequence in parseInteger
`$parseInteger` is missing a check that is in `$formatInteger`

resolves #387 

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>

Patch:
diff --git a/src/datetime.js b/src/datetime.js
index f611aba..a0d8535 100644
--- a/src/datetime.js
+++ b/src/datetime.js
@@ -1030,6 +1030,12 @@ const dateTime = (function () {
                         }
                         return parseInt(digits);
                     };
+                    break;
+                case formats.SEQUENCE:
+                    throw {
+                        code: 'D3130',
+                        value: formatSpec.token
+                    };
             }
 
         }
diff --git a/src/jsonata.js b/src/jsonata.js
index b43355b..7cebe55 100644
--- a/src/jsonata.js
+++ b/src/jsonata.js
@@ -1970,7 +1970,7 @@ var jsonata = (function() {
         "D3110": "The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",
         "D3120": "Syntax error in expression passed to function eval: {{value}}",
         "D3121": "Dynamic error evaluating the expression passed to function eval: {{value}}",
-        "D3130": "Formatting an integer as a sequence starting with {{value}} is not supported by this implementation",
+        "D3130": "Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",
         "D3131": "In a decimal digit pattern, all digits must be from the same decimal group",
         "D3132": "Unknown component specifier {{value}} in date/time picture string",
         "D3133": "The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",


Test patch:
diff --git a/test/test-suite/groups/function-parseInteger/parseInteger.json b/test/test-suite/groups/function-parseInteger/parseInteger.json
index 09eb121..5729f75 100644
--- a/test/test-suite/groups/function-parseInteger/parseInteger.json
+++ b/test/test-suite/groups/function-parseInteger/parseInteger.json
@@ -478,5 +478,13 @@
         "expr": "$parseInteger('FZPH', 'A')",
         "data": {},
         "result": 123456
+    },
+    {
+        "function": "#parseInteger",
+        "category": "errors",
+        "description": "unsupported picture string",
+        "expr": "$parseInteger('50', '#')",
+        "data": {},
+        "code": "D3130"
     }
 ]
Repository: validatorjs/validator.js (js)
Issue: a phone number validate wrong from zh-CN
I have a phone number 16565600001 (河北-衡水) can not validated，maybe need a upgrade
in isMobilePhone.js line 100
```
'zh-CN': /^((\+|00)86)?1([3568][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
```
Pull request description: Fixes #1303
Fix issue #1303

Patch:
diff --git a/src/lib/isIBAN.js b/src/lib/isIBAN.js
index 5b6da59..3652dce 100644
--- a/src/lib/isIBAN.js
+++ b/src/lib/isIBAN.js
@@ -40,6 +40,7 @@ const ibanRegexThroughCountryCode = {
   IE: /^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,
   IL: /^(IL[0-9]{2})\d{19}$/,
   IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,
+  IR: /^(IR[0-9]{2})0\d{2}0\d{18}$/,
   IS: /^(IS[0-9]{2})\d{22}$/,
   IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
   JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/,
diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js
index a1cea99..a194ba2 100644
--- a/src/lib/isMobilePhone.js
+++ b/src/lib/isMobilePhone.js
@@ -90,7 +90,7 @@ const phones = {
   'tr-TR': /^(\+?90|0)?5\d{9}$/,
   'uk-UA': /^(\+?38|8)?0\d{9}$/,
   'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-6|89]))|(9([0-9])))([0-9]{7})$/,
-  'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
+  'zh-CN': /^((\+|00)86)?1([3568][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
   'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
 };
 /* eslint-enable max-len */


Test patch:
diff --git a/test/validators.js b/test/validators.js
index ddceede..db9bc39 100755
--- a/test/validators.js
+++ b/test/validators.js
@@ -3825,6 +3825,7 @@ describe('Validators', () => {
         'TR320010009999901234567890',
         'BR1500000000000010932840814P2',
         'LB92000700000000123123456123',
+        'IR200170000000339545727003',
       ],
       invalid: [
         'XX22YYY1234567890123',
@@ -4954,6 +4955,7 @@ describe('Validators', () => {
           '+8619812341234',
           '+8619112341234',
           '17269427292',
+          '16565600001',
           '+8617269427292',
           '008617269427292',
         ],
Repository: mgechev/revive (go)
Issue: Panic when contains empty type block declaration
**Describe the bug**
revive panics when the source code contains
`
type ()
`

**To Reproduce**
Steps to reproduce the behavior:
1. I install revive v1.2.4
2. Write Program with `type ()` declaration
3. Run `revive -config revive.toml -formatter friendly ./...`


Panic happened in the line:
github.com/mgechev/revive@v1.2.4/rule/redefines-builtin-id.go:92 

**Expected behavior**
Should not panics without any meaningful messages.


**Desktop (please complete the following information):**
 - OS: [e.g. Ubuntu 20.04]
 - go1.19.4 linux/amd64

Pull request description: fix issue #792
Closes #792 


Patch:
diff --git a/rule/redefines-builtin-id.go b/rule/redefines-builtin-id.go
index 23dd85a..b3ff084 100644
--- a/rule/redefines-builtin-id.go
+++ b/rule/redefines-builtin-id.go
@@ -89,6 +89,9 @@ func (w *lintRedefinesBuiltinID) Visit(node ast.Node) ast.Visitor {
 	case *ast.GenDecl:
 		switch n.Tok {
 		case token.TYPE:
+			if len(n.Specs) < 1 {
+				return nil
+			}
 			typeSpec, ok := n.Specs[0].(*ast.TypeSpec)
 			if !ok {
 				return nil


Test patch:
diff --git a/testdata/redefines-builtin-id.go b/testdata/redefines-builtin-id.go
index 0593799..22e5975 100644
--- a/testdata/redefines-builtin-id.go
+++ b/testdata/redefines-builtin-id.go
@@ -29,3 +29,6 @@ var any int // MATCH /redefinition of the built-in type any/
 const any = 1 // MATCH /redefinition of the built-in type any/
 
 var i, copy int // MATCH /redefinition of the built-in function copy/
+
+// issue #792
+type ()
Repository: zegl/kube-score (go)
Issue: Failing when use ExternalName in Service
```
---
apiVersion: v1
kind: Service
metadata:
  name: wp-site
  namespace: site
spec:
  externalName: wp.example.com
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  type: ExternalName
```

**Output:**

```
v1/Service wp-site in site
    [OK] Stable version
    [CRITICAL] Service Targets Pod
        * The services selector does not match any pods
```
Pull request description: service: ignore services of type ExternalName in the service-targets-pod test
Fixes #53

Patch:
diff --git a/score/service/service.go b/score/service/service.go
index db23c2d..3fd4bf1 100644
--- a/score/service/service.go
+++ b/score/service/service.go
@@ -29,6 +29,12 @@ func ScoreServiceTargetsPod(pods []corev1.Pod, podspecers []ks.PodSpecer) func(c
 		score.Name = "Service Targets Pod"
 		score.ID = "service-targets-pod"
 
+		// Services of type ExternalName does not have a selector
+		if service.Spec.Type == corev1.ServiceTypeExternalName {
+			score.Grade = scorecard.GradeAllOK
+			return
+		}
+
 		hasMatch := false
 
 		for _, podLables := range podsInNamespace[service.Namespace] {


Test patch:
diff --git a/score/service_test.go b/score/service_test.go
index 5398fba..bb971e0 100644
--- a/score/service_test.go
+++ b/score/service_test.go
@@ -41,3 +41,7 @@ func TestServiceTargetsPodDeploymentSameNamespace(t *testing.T) {
 func TestServiceTargetsPodDeploymentDifferentNamespace(t *testing.T) {
 	testExpectedScore(t, "service-target-deployment-different-namespace.yaml", "Service Targets Pod", 1)
 }
+
+func TestServiceExternalName(t *testing.T) {
+	testExpectedScore(t, "service-externalname.yaml", "Service Targets Pod", 10)
+}
diff --git a/score/testdata/service-externalname.yaml b/score/testdata/service-externalname.yaml
new file mode 100644
index 0000000..41e96d2
--- /dev/null
+++ b/score/testdata/service-externalname.yaml
@@ -0,0 +1,13 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: wp-site
+  namespace: site
+spec:
+  externalName: wp.example.com
+  ports:
+  - name: http
+    port: 80
+    protocol: TCP
+    targetPort: 80
+  type: ExternalName