PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: platers/obsidian-linter (ts)

Issue:
Bug: Quotes are formatted in markdown links
- [x] I have verified that I am on the latest version of the Linter

## Describe the Bug

Links in the format `[link](test.it 'Test title')` become `[link](test.it ‘Test title’)` if `Enable Single Quote Style` is on and Single `Quote Style` set to `‘’`.

## How to Reproduce

Example to reproduce issue with

``` markdown
[link](https://test.it 'Test title')
```

## Expected Behavior

Single or double quotes used in Markdown links to set the link title should be kept `''` and `""`.

Expected output if applicable:

``` markdown
[link](https://test.it 'Test title')
```

## Device

- [x] Desktop
- [ ] Mobile

Pull request:
Make Sure `Quote Styles` Does Not Affect Markdown or Wiki Links
Fixes #929 

Changes Made:
- Ignored markdown and wiki links for `Quote Styles`
- Added a test for the scenario in question

Patch:
diff --git a/src/rules/quote-style.ts b/src/rules/quote-style.ts
index 957a3c7..e620d81 100644
--- a/src/rules/quote-style.ts
+++ b/src/rules/quote-style.ts
@@ -29,7 +29,7 @@ export default class QuoteStyle extends RuleBuilder<QuoteStyleOptions> {
       nameKey: 'rules.quote-style.name',
       descriptionKey: 'rules.quote-style.description',
       type: RuleType.CONTENT,
-      ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.yaml, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.html, IgnoreTypes.templaterCommand],
+      ruleIgnoreTypes: [IgnoreTypes.code, IgnoreTypes.inlineCode, IgnoreTypes.math, IgnoreTypes.yaml, IgnoreTypes.math, IgnoreTypes.inlineMath, IgnoreTypes.html, IgnoreTypes.link, IgnoreTypes.wikiLink, IgnoreTypes.templaterCommand],
     });
   }
   get OptionsClass(): new () => QuoteStyleOptions {


Test patch:
diff --git a/__tests__/quote-style.test.ts b/__tests__/quote-style.test.ts
index 61e6b2c..69ca87a 100644
--- a/__tests__/quote-style.test.ts
+++ b/__tests__/quote-style.test.ts
@@ -111,5 +111,17 @@ ruleTest({
         doubleQuoteStyle: DoubleQuoteStyles.SmartQuote,
       },
     },
+    { // accounts for https://github.com/platers/obsidian-linter/issues/929
+      testName: 'Make sure quotes in markdown links get ignored',
+      before: dedent`
+        [link](https://test.it 'Test title')
+      `,
+      after: dedent`
+        [link](https://test.it 'Test title')
+      `,
+      options: {
+        singleQuoteStyle: SingleQuoteStyles.SmartQuote,
+      },
+    },
   ],
 });
Repository: elliotchance/gedcom (go)

Issue:
gedcom2html: Spouses and Children are not listed
Hi Elliot. Not sure if feature not implemented, or a bug. This individual had two husbands and six children. If I go to the Individual page of one of the children, the parents are correctly listed, so the family is in the data!

![Annotation 2019-05-27 172435](https://user-images.githubusercontent.com/8319271/58431184-8cfea000-80a4-11e9-81de-e2bbd98f74ef.png)


Pull request:
Publish: Fix surname index and missing children
Two bugs fixed:

1. One bug was caused by taking the first letter of the name, which may not be the first letter of the surname. So these individuals were not appearing on the index.

2. Children with an unknown spouse were not being displayed becuase it was incorrectly comparing the family pointer instead of the individual pointer.

Fixes #276

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/elliotchance/gedcom/293)
<!-- Reviewable:end -->


Patch:
diff --git a/html/individual_index_header.go b/html/individual_index_header.go
index ef0b597..2e040b5 100644
--- a/html/individual_index_header.go
+++ b/html/individual_index_header.go
@@ -49,7 +49,7 @@ func GetIndexLetters(document *gedcom.Document, livingVisibility LivingVisibilit
 }
 
 func getIndexLetter(individual *gedcom.IndividualNode) rune {
-	name := strings.ToLower(individual.Name().String())
+	name := strings.ToLower(individual.Name().Surname())
 
 	switch {
 	case name == "", name[0] < 'a', name[0] > 'z':
diff --git a/individual_node.go b/individual_node.go
index d314b78..2b245e8 100644
--- a/individual_node.go
+++ b/individual_node.go
@@ -103,11 +103,11 @@ func (node *IndividualNode) Spouses() (spouses IndividualNodes) {
 			continue
 		}
 
-		if husband.Pointer() == node.Pointer() {
+		if husband.IsIndividual(node) {
 			spouses = append(spouses, wife.Individual())
 		}
 
-		if wife.Pointer() == node.Pointer() {
+		if wife.IsIndividual(node) {
 			spouses = append(spouses, husband.Individual())
 		}
 	}


Test patch:
diff --git a/html/publish_test.go b/html/publish_test.go
index 65029b8..166e007 100644
--- a/html/publish_test.go
+++ b/html/publish_test.go
@@ -28,7 +28,7 @@ var publisherTests = map[string]struct {
 			LivingVisibility: html.LivingVisibilityShow,
 		},
 		files: []string{
-			"individuals-e.html",
+			"individuals-c.html",
 			"elliot-chance.html",
 			"places.html",
 			"families.html",
Repository: brazilian-utils/brutils-python (python)

Issue:
Melhorar format_cnpj e o seus testes
1. Chamar a função `is_valid` e formatar o cnpj, sem utilizar o método display.
Código referência:
https://github.com/brazilian-utils/brutils-python/blob/756f1267b78ed597a7b65fd344a8ae2c6bf6a0b9/brutils/cpf.py#L38-L48

2. Melhorar os testes da função format_cnpj:

Código referência:
https://github.com/brazilian-utils/brutils-python/blob/756f1267b78ed597a7b65fd344a8ae2c6bf6a0b9/tests/test_cpf.py#L47-L57

Pull request:
Refatorando a função `cnpj.format` e melhorando seus testes
Alterações:
* Garante que a função `format` chama o método `is_valid` para validação do CNPJ e não utiliza o método display;
* Testes ajustados para a nova função (CNPJ);
* Alteração do código do `cpf.format` para definir o tamanho máximo do input

closes #115 

Patch:
diff --git a/brutils/cnpj.py b/brutils/cnpj.py
index 913a41e..0b7fd73 100644
--- a/brutils/cnpj.py
+++ b/brutils/cnpj.py
@@ -38,7 +38,13 @@ def format_cnpj(cnpj):  # type: (str) -> str
     Will format an adequately formatted numbers-only CNPJ string,
     adding in standard formatting visual aid symbols for display.
     """
-    return display(cnpj)
+
+    if not is_valid(cnpj):
+        return None
+
+    return "{}.{}.{}/{}-{}".format(
+        cnpj[:2], cnpj[2:5], cnpj[5:8], cnpj[8:12], cnpj[12:14]
+    )
 
 
 # CALCULATORS
diff --git a/brutils/cpf.py b/brutils/cpf.py
index ea93e75..e030ed7 100644
--- a/brutils/cpf.py
+++ b/brutils/cpf.py
@@ -45,7 +45,7 @@ def format_cpf(cpf):  # type: (str) -> str
     if not is_valid(cpf):
         return None
 
-    return "{}.{}.{}-{}".format(cpf[:3], cpf[3:6], cpf[6:9], cpf[9:])
+    return "{}.{}.{}-{}".format(cpf[:3], cpf[3:6], cpf[6:9], cpf[9:11])
 
 
 # OPERATIONS


Test patch:
diff --git a/tests/test_cnpj.py b/tests/test_cnpj.py
index 9b26234..25e7375 100644
--- a/tests/test_cnpj.py
+++ b/tests/test_cnpj.py
@@ -45,10 +45,18 @@ class CNPJ(TestCase):
         assert display("0000000000000") is None
 
     def test_format_cnpj(self):
-        assert format_cnpj("00000000000109") == "00.000.000/0001-09"
-        assert format_cnpj("00000000000000") is None
-        assert format_cnpj("0000000000000a") is None
-        assert format_cnpj("0000000000000") is None
+        with patch("brutils.cnpj.is_valid", return_value=True) as mock_is_valid:
+            # When cnpj is_valid, returns formatted cnpj
+            assert format_cnpj("01838723000127") == "01.838.723/0001-27"
+
+        # Checks if function is_valid_cnpj is called
+        mock_is_valid.assert_called_once_with("01838723000127")
+
+        with patch(
+            "brutils.cnpj.is_valid", return_value=False
+        ) as mock_is_valid:
+            # When cnpj isn't valid, returns None
+            assert format_cnpj("01838723000127") is None
 
     def test_validate(self):
         assert validate("34665388000161")
Repository: Modernizr/Modernizr (js)

Issue:
Add support for ResizeObserver
As far as I know this feature-detect does not exist. I'll be happy to create a PR for this if needed.

Pull request:
Add support for ResizeObserver
Adds a simple test testing ResizeObserver existence on window.

Fixes #2581 

Patch:
diff --git a/feature-detects/window/resizeobserver.js b/feature-detects/window/resizeobserver.js
new file mode 100644
index 00000000..c95e2b63
--- /dev/null
+++ b/feature-detects/window/resizeobserver.js
@@ -0,0 +1,29 @@
+/*!
+{
+  "name": "ResizeObserver",
+  "property": "resizeobserver",
+  "caniuse": "resizeobserver",
+  "tags": ["ResizeObserver"],
+  "authors": ["Christian Andersson"],
+  "notes": [{
+    "name": "W3C Spec",
+    "href": "https://www.w3.org/TR/resize-observer/"
+  }, {
+    "name": "MDN Docs",
+    "href": "https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver"
+  }, {
+    "name": "Web.dev Article",
+    "href": "https://web.dev/resize-observer/"
+  }, {
+    "name": "Digital Ocean tutorial",
+    "href": "https://www.digitalocean.com/community/tutorials/js-resize-observer"
+  }]
+}
+!*/
+
+/* DOC
+Detects support for ResizeObserver.
+*/
+define(['Modernizr'], function(Modernizr) {
+  Modernizr.addTest('resizeobserver', 'ResizeObserver' in window);
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index db4cf435..60ab7d74 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -310,6 +310,7 @@
     "window/atob-btoa",
     "window/framed",
     "window/matchmedia",
+    "window/resizeobserver",
     "workers/blobworkers",
     "workers/dataworkers",
     "workers/sharedworkers",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index 60259ba1..c4fabe10 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -130,6 +130,7 @@ window.caniusecb = function(caniuse) {
       queryselector: 'queryselector',
       regions: 'css-regions',
       requestanimationframe: 'requestanimationframe',
+      resizeobserver: 'resizeobserver',
       rgba: 'css3-colors',
       ruby: 'ruby',
       sandbox: 'iframe-sandbox',
Repository: tatethurston/nextjs-routes (ts)

Issue:
Generated types are prefixed with "pages/"
My `pages` folder is in the project root. The generated types file looks like this:
```ts
export type Route =
    | { pathname: "pages/_app"; query?: Query | undefined }
    | { pathname: "pages/_document"; query?: Query | undefined }
    | { pathname: "pages/_error"; query?: Query | undefined }
```

hence, I get type errors as the correct paths don't have the `pages/` prefix.

Pull request:
fix page directory prefix
fixes #76

Patch:
diff --git a/README.md b/README.md
index e3319fb..8a36abe 100644
--- a/README.md
+++ b/README.md
@@ -206,7 +206,7 @@ You can pass the following options to `withRoutes` in your `next.config.js`:
 
 ```js
 const withRoutes = require("nextjs-routes/config")({
-  outDir: "types"
+  outDir: "types",
 });
 ```
 
diff --git a/src/core.ts b/src/core.ts
index 24af37f..7588f1d 100644
--- a/src/core.ts
+++ b/src/core.ts
@@ -232,7 +232,7 @@ export function writeNextjsRoutes(options: NextJSRoutesOptions): void {
     const ext = file.slice(file.lastIndexOf(".") + 1);
     return pageExtensions.has(ext);
   });
-  const routes = nextRoutes(files, outputFilepath);
+  const routes = nextRoutes(files, opts.pagesDirectory);
   const generated = generate(routes);
 
   writeFileSync(outputFilepath, generated);


Test patch:
diff --git a/e2e/package-lock.json b/e2e/package-lock.json
index 721362b..dc45e76 100644
--- a/e2e/package-lock.json
+++ b/e2e/package-lock.json
@@ -20,7 +20,7 @@
     },
     "../dist": {
       "name": "nextjs-routes",
-      "version": "0.1.0",
+      "version": "0.1.1",
       "dev": true,
       "license": "MIT",
       "dependencies": {
Repository: sandersn/downlevel-dts (js)

Issue:
Incorrect downlevelling of `export * as foo from 'bar'`
### Input code:

```ts
export * as TSESTree from './ts-estree';
```

### Expected output:

```ts
import * as TSESTree from './ts-estree';
export { TSESTree };
```

### Actual output:

```ts
import * as TSESTree_1 from './ts-estree';
export { TSESTree_1 as TSESTree } from './ts-estree';
```


See also

Test input:

https://github.com/sandersn/downlevel-dts/blob/ca924f6fdb2abc875b6884dea541327c57fe443d/test/test.d.ts#L27-L28

Incorrect test output:

https://github.com/sandersn/downlevel-dts/blob/ca924f6fdb2abc875b6884dea541327c57fe443d/baselines/ts3.4/test.d.ts#L24-L26

Pull request:
fix: correct downlevel of `export * as ns`
Fixes #41 

Patch:
diff --git a/index.js b/index.js
index 00c3ed7..b7485ae 100644
--- a/index.js
+++ b/index.js
@@ -138,8 +138,7 @@ function doTransform(checker, k) {
           ts.createExportDeclaration(
             undefined,
             undefined,
-            ts.createNamedExports([ts.createExportSpecifier(tempName, n.exportClause.name)]),
-            n.moduleSpecifier
+            ts.createNamedExports([ts.createExportSpecifier(tempName, n.exportClause.name)])
           )
         )
       ];


Test patch:
diff --git a/baselines/ts3.4/test.d.ts b/baselines/ts3.4/test.d.ts
index 3468baa..48acbe3 100644
--- a/baselines/ts3.4/test.d.ts
+++ b/baselines/ts3.4/test.d.ts
@@ -23,7 +23,7 @@ export namespace N {
 import { C as CD } from "./src/test";
 import * as rex_1 from "./src/test";
 //another comment
-export { rex_1 as rex } from "./src/test";
+export { rex_1 as rex };
 export interface E {
     a: number;
     b: number;
Repository: diegoholiveira/jsonlogic (go)

Issue:
failing to check array items by index (from an empty array)
First of all, that's a great lib, thank you all for your hard work on this!

When we try to access an specific condition in an empty array, we get _index out of range_.
How can we check if the array is not empty before accessing their items?

[Quick playground example](https://go.dev/play/p/nxtgY9mj90L)

```go
logic := strings.NewReader(`{"if":[ false, {"var":"values.0.categories"}, "else" ]}`)
data := strings.NewReader(`{ "values": [] }`)

var result bytes.Buffer
if err := jsonlogic.Apply(logic, data, &result); err != nil {
    fmt.Printf("failed, %v", err)
}

fmt.Println(result.String())
```

In the example above, even forcing the _false_ in the `if` condition, it's still evaluating the _true_ part, causing the index out of range.  
Shouldn't return the `"else"` value , even returning the error?
This is what the [JSON Logic playground](https://jsonlogic.com/play.html) returns:

![image](https://github.com/diegoholiveira/jsonlogic/assets/21963/6bac49af-48d8-4943-b718-7412f907fb6e)

Is there any other way to get the value of a property from an array's item (like `categories` from the first position in my example)?

Thank you

Pull request:
Verify array before try to access any position
closes #74 

Patch:
diff --git a/vars.go b/vars.go
index d619e6e..3558899 100644
--- a/vars.go
+++ b/vars.go
@@ -91,7 +91,12 @@ func getVar(value, data interface{}) interface{} {
 		}
 
 		if isSlice(data) {
-			_value = data.([]interface{})[int(toNumber(part))]
+			pos := int(toNumber(part))
+			container := data.([]interface{})
+			if pos >= len(container) {
+				return _default
+			}
+			_value = container[pos]
 		}
 
 		if _value == nil {


Test patch:
diff --git a/jsonlogic_test.go b/jsonlogic_test.go
index aa9e548..e7516fe 100644
--- a/jsonlogic_test.go
+++ b/jsonlogic_test.go
@@ -807,6 +807,16 @@ func TestIssue71_example_max(t *testing.T) {
 	assert.JSONEq(t, expected, result.String())
 }
 
+func TestIssue74(t *testing.T) {
+	logic := strings.NewReader(`{"if":[ false, {"var":"values.0.categories"}, "else" ]}`)
+	data := strings.NewReader(`{ "values": [] }`)
+
+	var result bytes.Buffer
+	_ = Apply(logic, data, &result)
+	expected := `"else"`
+	assert.JSONEq(t, expected, result.String())
+}
+
 func TestJsonLogicWithSolvedVars(t *testing.T) {
 	rule := json.RawMessage(`{
 		"or":[
Repository: ant-design/ant-design-mobile (ts)

Issue:
当form设置了initialValues时会导致Form.Subscribe 里面的方法执行两次
### Version of antd-mobile

5.29.0

### Operating system and its version

iOS

### Browser and its version

Google Chrome 版本 111.0.5563.146（正式版本） (arm64)

### Sandbox to reproduce

https://codesandbox.io/s/weathered-glade-3jnry8?file=/app.tsx:1305-1316

### What happened?

希望只执行一次

### Relevant log output

_No response_

Pull request:
fix(Form): opt form Form.Subscribe do not call useless rerender
resolve #6088

Patch:
diff --git a/src/components/form/form-subscribe.tsx b/src/components/form/form-subscribe.tsx
index 8e69be967..3b3a77de1 100644
--- a/src/components/form/form-subscribe.tsx
+++ b/src/components/form/form-subscribe.tsx
@@ -19,9 +19,18 @@ export interface FormSubscribeProps {
 export const FormSubscribe: FC<FormSubscribeProps> = props => {
   const update = useUpdate()
   const form = useContext(FieldContext)
+
+  const value = form.getFieldsValue(props.to)
+
+  // Memo to avoid useless render
+  const childNode = React.useMemo(
+    () => props.children(value, form),
+    [JSON.stringify(value)]
+  )
+
   return (
     <>
-      {props.children(form.getFieldsValue(props.to), form)}
+      {childNode}
       {props.to.map(namePath => (
         <Watcher
           key={namePath.toString()}


Test patch:
diff --git a/src/components/form/tests/form.test.tsx b/src/components/form/tests/form.test.tsx
index 5b44e9fbf..cb9c0ba7f 100644
--- a/src/components/form/tests/form.test.tsx
+++ b/src/components/form/tests/form.test.tsx
@@ -303,4 +303,31 @@ describe('Form', () => {
       expect(onChange).toHaveBeenCalled()
     })
   })
+
+  describe('Form.Subscribe', () => {
+    test('no useless render', () => {
+      let renderTimes = 0
+
+      const { container } = render(
+        <Form initialValues={{ name: 'bamboo' }}>
+          <Form.Subscribe to={['name']}>
+            {({ name }) => {
+              renderTimes += 1
+
+              expect(name).toEqual('bamboo')
+
+              return (
+                <Form.Item name='name'>
+                  <Input />
+                </Form.Item>
+              )
+            }}
+          </Form.Subscribe>
+        </Form>
+      )
+
+      expect(container.querySelector('input')?.value).toEqual('bamboo')
+      expect(renderTimes).toEqual(1)
+    })
+  })
 })