PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: platers/obsidian-linter (ts)
Issue: Linter Breaks the wikilinks on titles
Hi! I found an issue using the linter plugin, in some titles where I have a wiki link and then use the linter, and it replaces the wiki link.
Ex.
`# Fundamentals of [[Docker]]`
after the linter runs
`# Fundamentals of Placeholder_link 57849`
I run the linter and replaces `[[Docker]]` by `Placeholder_link 57849`

(Edited) Linter version 1.3.0
Pull request description: Fix Issue with First Letter Capitalization and Header
@platers 

Fixes #201 

It seems that when the placeholder is added to the title and capitalization is set to first letter capitalization, the header changes the placeholder to no longer be all caps which meant that the replace would not work. In order to fix this, I made the replace case insensitive.

Changes Made:
- Updated the replace to be case insensitive for the links
- Added a test to verify that links stay as they were in the headings

Please let me know if we want the test placed elsewhere or a different kind of test or fix to be used.

Patch:
diff --git a/src/utils.ts b/src/utils.ts
index 4e00f53..fd36d83 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -123,7 +123,9 @@ export function ignoreCodeBlocksYAMLAndLinks(text: string, func: (text: string)
 
   if (linkMatches) {
     for (const link of linkMatches) {
-      text = text.replace(linkPlaceHolder, link);
+      // Regex was added to fix capitalization issue  where another rule made the text not match the original place holder's case
+      // see https://github.com/platers/obsidian-linter/issues/201
+      text = text.replace(new RegExp(linkPlaceHolder, 'i'), link);
     }
   }
 


Test patch:
diff --git a/src/test.ts b/src/test.ts
index 6eb3489..c1586e1 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -721,4 +721,19 @@ describe('Links', () => {
 
     expect(rulesDict['trailing-spaces'].apply(before)).toBe(after);
   });
+  it('Link in heading is still present with first letter capitalization rules on', () => {
+    const before = dedent`
+    # Heading [[docker]]
+    # Heading [docker](docker)
+    # Heading ![docker](docker)
+    `;
+
+    const after = dedent`
+    # Heading [[docker]]
+    # Heading [docker](docker)
+    # Heading ![docker](docker)
+    `;
+
+    expect(rulesDict['capitalize-headings'].apply(before, {'Style': 'First Letter'})).toBe(after);
+  });
 });
Repository: protofire/solhint (js)
Issue: Should count CRLF as one character
solhint 1.5.1 counts CRLF as two characters.  Should only be one.
Pull request description: Handle CRLF newlines
Closes #109.

Patch:
diff --git a/lib/rules/best-practises/max-line-length.js b/lib/rules/best-practises/max-line-length.js
index 8cafae0..01bdc4b 100644
--- a/lib/rules/best-practises/max-line-length.js
+++ b/lib/rules/best-practises/max-line-length.js
@@ -1,5 +1,7 @@
 const BaseChecker = require('./../base-checker')
 
+const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u
+
 const ruleId = 'max-line-length'
 const meta = {
   type: 'best-practises',
@@ -31,7 +33,7 @@ class MaxLineLengthChecker extends BaseChecker {
   }
 
   enterSourceUnit(ctx) {
-    const lines = ctx.parser._input.tokenSource._input.strdata.split('\n')
+    const lines = ctx.parser._input.tokenSource._input.strdata.split(lineBreakPattern)
 
     lines.map(line => line.length).forEach(this.validateLineLength.bind(this))
   }


Test patch:
diff --git a/test/rules/best-practises/max-line-length.js b/test/rules/best-practises/max-line-length.js
index f99acdd..f1ed707 100644
--- a/test/rules/best-practises/max-line-length.js
+++ b/test/rules/best-practises/max-line-length.js
@@ -22,4 +22,36 @@ describe('Linter - max-line-length', () => {
 
     assertNoErrors(report)
   })
+
+  it('should not raise error when line is exactly the max length', () => {
+    const code = ' '.repeat(120)
+
+    const report = linter.processStr(code, {
+      rules: { 'max-line-length': 'error' }
+    })
+
+    assertNoErrors(report)
+  })
+
+  it('should not count newlines', () => {
+    const line = ' '.repeat(120)
+    const code = `${line}\n${line}\n`
+
+    const report = linter.processStr(code, {
+      rules: { 'max-line-length': 'error' }
+    })
+
+    assertNoErrors(report)
+  })
+
+  it('should not count windows newlines', () => {
+    const line = ' '.repeat(120)
+    const code = `${line}\n\r${line}\n\r`
+
+    const report = linter.processStr(code, {
+      rules: { 'max-line-length': 'error' }
+    })
+
+    assertNoErrors(report)
+  })
 })
Repository: protofire/solhint (js)
Issue: Linter counts immutable vars as state vars
Hi, 

For the `max-states-count` rule, the linter counts `immutable` vars as state variable declarations, which shouldnt be the case, right? 

See: 
![image](https://user-images.githubusercontent.com/36712489/96455015-ec6eca00-121c-11eb-982f-4be9fda267c1.png)

Pull request description: Avoid counting `immutable` for the `max-state-count` rule
closes #258

Patch:
diff --git a/lib/rules/best-practises/max-states-count.js b/lib/rules/best-practises/max-states-count.js
index cd59ca3..7082662 100644
--- a/lib/rules/best-practises/max-states-count.js
+++ b/lib/rules/best-practises/max-states-count.js
@@ -55,7 +55,9 @@ class MaxStatesCountChecker extends BaseChecker {
   ContractDefinition(node) {
     const countOfVars = _(node.subNodes)
       .filter(({ type }) => type === 'StateVariableDeclaration')
-      .flatMap(subNode => subNode.variables.filter(variable => !variable.isDeclaredConst))
+      .flatMap(({ variables }) =>
+        variables.filter(({ isDeclaredConst, isImmutable }) => !isDeclaredConst && !isImmutable)
+      )
       .value().length
 
     if (countOfVars > this.maxStatesCount) {


Test patch:
diff --git a/test/rules/best-practises/max-states-count.js b/test/rules/best-practises/max-states-count.js
index 6a8fdc6..079328c 100644
--- a/test/rules/best-practises/max-states-count.js
+++ b/test/rules/best-practises/max-states-count.js
@@ -45,4 +45,18 @@ describe('Linter - max-states-count', () => {
 
     assertNoErrors(report)
   })
+
+  it('should not count immutable variables', () => {
+    const code = contractWith(`
+      uint public immutable a;
+      uint public b;
+      uint public c;
+
+      function f() {}
+    `)
+
+    const report = linter.processStr(code, { rules: { 'max-states-count': ['error', 2] } })
+
+    assertNoErrors(report)
+  })
 })
Repository: PyCQA/pyflakes (python)
Issue: F401 (imported but unused) false positive on Foo when using def x(a: Foo, /, *, b: Bar)
```python
from datetime import datetime as Foo, time as Bar


def x(a: Foo, /, *, b: Bar):
    pass
```

Running this on the file results in:

```
› flake8 --version  
3.7.9 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.8.1 on Linux
› pyflakes --version
2.1.1 Python 3.8.1 on Linux
› flake8 example.py 
example.py:1:1: F401 'datetime.datetime as Foo' imported but unused
› pyflakes example.py
example.py:1: 'datetime.datetime as Foo' imported but unused
```
Pull request description: Fix annotation of posonlyarg
Resolves #507

Patch:
diff --git a/pyflakes/checker.py b/pyflakes/checker.py
index c8ccf56..d157008 100644
--- a/pyflakes/checker.py
+++ b/pyflakes/checker.py
@@ -1799,6 +1799,10 @@ class Checker(object):
             addArgs(node.args.args)
             defaults = node.args.defaults
         else:
+            if PY38_PLUS:
+                for arg in node.args.posonlyargs:
+                    args.append(arg.arg)
+                    annotations.append(arg.annotation)
             for arg in node.args.args + node.args.kwonlyargs:
                 args.append(arg.arg)
                 annotations.append(arg.annotation)


Test patch:
diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py
index 289535d..1fa4f5e 100644
--- a/pyflakes/test/test_type_annotations.py
+++ b/pyflakes/test/test_type_annotations.py
@@ -418,3 +418,11 @@ class TestTypeAnnotations(TestCase):
                 Y = 2
                 return Y
         """, m.UndefinedName)
+
+    @skipIf(version_info < (3, 8), 'new in Python 3.8')
+    def test_positional_only_argument_annotations(self):
+        self.flakes("""
+        from x import C
+
+        def f(c: C, /): ...
+        """)