PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: warpnet/salt-lint (python)

Issue:
Error 206 triggered with nested literal brace
**Describe the bug**
Error 206 is erroneously reported for the following construction

**To Reproduce**
```
[206] [LOW] Jinja variables should have spaces before and after: '{{ var_name }}'
test.sls:3
    - name: '{${{ key }}}'
```


**Expected behavior**
No issue on this line.


**Desktop (please complete the following information):**

- OS: Windows 10
- Version 0.6.1



Pull request:
Fix false positive for spaces in Jinja variable
Fix false positive when detecting missing spaces in the Jinja variable when the Jinja statement is nested in literal braces.

Closes #257

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8336c91..6630714 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ All notable changes in **salt-lint** are documented below.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ## [Unreleased]
+### Fixed
+- False positive when detecting missing spaces in Jinja variables when the Jinja statement is nested in literal braces ([#272](https://github.com/warpnet/salt-lint/pull/272)).
 
 ## [0.7.0] (2021-11-01)
 ### Added
diff --git a/saltlint/rules/JinjaVariableHasSpacesRule.py b/saltlint/rules/JinjaVariableHasSpacesRule.py
index 03433b6..52cff83 100644
--- a/saltlint/rules/JinjaVariableHasSpacesRule.py
+++ b/saltlint/rules/JinjaVariableHasSpacesRule.py
@@ -14,7 +14,9 @@ class JinjaVariableHasSpacesRule(JinjaRule):
     severity = 'LOW'
     version_added = 'v0.0.1'
 
-    bracket_regex = re.compile(r"{{[^ \-\+\d]|{{[-\+][^ ]|[^ \-\+\d]}}|[^ {][-\+\d]}}")
+    bracket_regex = re.compile(
+        r"{{[^ {}\-\+\d]|{{[-\+][^ {}]|[^ {}\-\+\d]}}|[^ {}][-\+\d]}}"
+    )
 
     def match(self, file, line):
         return self.bracket_regex.search(line)


Test patch:
diff --git a/tests/unit/TestJinjaVariableHasSpaces.py b/tests/unit/TestJinjaVariableHasSpaces.py
index 4e53f33..80c9906 100644
--- a/tests/unit/TestJinjaVariableHasSpaces.py
+++ b/tests/unit/TestJinjaVariableHasSpaces.py
@@ -51,6 +51,10 @@ DOUBLE_QUOTED_INTEGER_LEADING_SPACE_IS_INVALID = '''
 {{"{{0}}" }}
 '''
 
+NESTED_LITERAL_BRACES = '''
+    - name: '{${{ key }}}'
+'''
+
 class TestJinjaVariableHasSpaces(unittest.TestCase):
     collection = RulesCollection()
 
@@ -98,3 +102,12 @@ class TestJinjaVariableHasSpaces(unittest.TestCase):
     def test_variable_bad_ends_with_integer_right(self):
         results = self.runner.run_state(BAD_VARIABLE_ENDING_IN_INTEGER_RIGHT)
         self.assertEqual(1, len(results))
+
+    def test_nested_literal_braces(self):
+        """
+        Check if Jinja variables inside nested literal braces are identified
+        correctly. See related GitHub issue:
+        https://github.com/warpnet/salt-lint/issues/257
+        """
+        results = self.runner.run_state(NESTED_LITERAL_BRACES)
+        self.assertEqual(0, len(results))
Repository: analysis-dev/diktat (kotlin)

Issue:
Make KDocs on overriden functions/properties not mandatory
Or even false by default, because dokka uses parent class documentation when generating docs.

Pull request:
### What's done:
  * Fixed bugs

This pull request closes #551

Patch:
diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/kdoc/KdocMethods.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/kdoc/KdocMethods.kt
index 32749a224d..a22c3f71e8 100644
--- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/kdoc/KdocMethods.kt
+++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/kdoc/KdocMethods.kt
@@ -51,6 +51,7 @@ import com.pinterest.ktlint.core.ast.ElementType.WHEN_CONDITION_WITH_EXPRESSION
 import org.cqfn.diktat.ruleset.utils.findChildAfter
 import org.cqfn.diktat.ruleset.utils.findChildBefore
 import org.cqfn.diktat.ruleset.utils.getAllChildrenWithType
+import org.cqfn.diktat.ruleset.utils.isOverridden
 import org.jetbrains.kotlin.com.intellij.lang.ASTNode
 import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafPsiElement
 import org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.PsiWhiteSpaceImpl
@@ -83,7 +84,7 @@ class KdocMethods(private val configRules: List<RulesConfig>) : Rule("kdoc-metho
         isFixMode = autoCorrect
         emitWarn = emit
 
-        if (node.elementType == FUN && node.getFirstChildWithType(MODIFIER_LIST).isAccessibleOutside()) {
+        if (node.elementType == FUN && node.getFirstChildWithType(MODIFIER_LIST).isAccessibleOutside() && !node.isOverridden()) {
             val config = configRules.getCommonConfiguration().value
             val fileName = node.getRootNode().getFileName()
             val isTestMethod = node.hasTestAnnotation() || isLocatedInTest(fileName.splitPathToDirs(), config.testAnchors)


Test patch:
diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocMethodsTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocMethodsTest.kt
index 5d73e6a727..603bf10b9a 100644
--- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocMethodsTest.kt
+++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocMethodsTest.kt
@@ -339,4 +339,19 @@ class KdocMethodsTest : LintTestBase(::KdocMethods) {
                 LintError(2, 3, ruleId, "${KDOC_TRIVIAL_KDOC_ON_FUNCTION.warnText()} Returns X", false)
         )
     }
+
+
+    @Test
+    @Tag(WarningNames.MISSING_KDOC_ON_FUNCTION)
+    fun `should not trigger on override funcs`() {
+        lintMethod(
+                """
+                    |class Some : A {
+                    |   override fun foo() {}
+                    |   
+                    |   override fun bar(t: T): U { return U() }
+                    |}
+                """.trimMargin()
+        )
+    }
 }
Repository: fterh/heimdall (ts)

Issue:
Email without sender name should not enclose sender email in brackets

Pull request:
Improve how sender's name and email address are represented
Closes #30.

Patch:
diff --git a/lib/forwardInbound.ts b/lib/forwardInbound.ts
index 9d59083..0924877 100644
--- a/lib/forwardInbound.ts
+++ b/lib/forwardInbound.ts
@@ -6,6 +6,16 @@ import repackageReceivedAttachments from "./repackageReceivedAttachments";
 import sendEmail from "./sendEmail";
 import senderAddressEncodeDecode from "./senderAddressEncodeDecode";
 
+export const representNameAndEmailAddress = (
+  name: string,
+  emailAddress: string
+): string => {
+  if (name === "") {
+    return emailAddress;
+  }
+  return `${name} [${emailAddress}]`;
+};
+
 /**
  * Generates forwarded email's "from" header information
  * that encapsualtes original sender's name and email address.
@@ -30,7 +40,7 @@ export const generateFromHeader = (
   }
 
   return {
-    name: `${replyToName} [${replyToEmailAddress}]`,
+    name: representNameAndEmailAddress(replyToName, replyToEmailAddress),
     address: senderAddressEncodeDecode.encodeEmailAddress(
       aliasValue,
       replyToEmailAddress


Test patch:
diff --git a/tests/lib/forwardInbound.test.ts b/tests/lib/forwardInbound.test.ts
index a46e6dd..19b5a14 100644
--- a/tests/lib/forwardInbound.test.ts
+++ b/tests/lib/forwardInbound.test.ts
@@ -1,5 +1,8 @@
 import { email as myEmail, operationalDomain } from "../../lib/env";
-import forwardInbound, { generateFromHeader } from "../../lib/forwardInbound";
+import forwardInbound, {
+  generateFromHeader,
+  representNameAndEmailAddress
+} from "../../lib/forwardInbound";
 // @ts-ignore: We're using Jest's ES6 class mocks (https://jestjs.io/docs/en/es6-class-mocks)
 import { didReceiveEmailSpy } from "../../lib/models/Alias";
 import { INVALID_ALIAS } from "../../lib/models/__mocks__/Alias";
@@ -162,3 +165,9 @@ it("should not throw if the alias does not exist", async () => {
 
   await expect(res).resolves.toBeUndefined();
 });
+
+it("should not bracket the email address if there is no name", () => {
+  expect(representNameAndEmailAddress("", "user@domain.com")).toBe(
+    "user@domain.com"
+  );
+});
Repository: pmndrs/valtio (ts)

Issue:
Bug with history (again?)
Hello again, I think I found something.

[sandbox link](https://codesandbox.io/s/react-typescript-forked-6leim?file=/src/App.tsx)

I'm trying to implement transition (jump) between different states in my project and found one issue.

If I try to undo or redo a state in a loop it doesn't work as expected.

PS: Loop is just an example for this issue, I know I can get the value directly from the snapshots array.

Expected:
Case 1:
initial value 0
UpdateValue (x3) -> undo by step (x3) -> redo by step (x3) -> 3

Case 2:
initial value 0
UpdateValue (x3) -> undo all -> redo all -> 3

-----------------------------------------------------------------------------

Actual:
Case 1:
initial value 0
UpdateValue (x3) -> undo by step (x3) -> redo by step (x3) -> 3        <- fine

Case 2:
initial value 0
UpdateValue (x3) -> undo all -> redo all -> 0                                          <- bad

Pull request:
fix(utils): multiple redos at once with proxyWithHistory
close #323

Patch:
diff --git a/src/utils/proxyWithHistory.ts b/src/utils/proxyWithHistory.ts
index 93f7872..a49acf7 100644
--- a/src/utils/proxyWithHistory.ts
+++ b/src/utils/proxyWithHistory.ts
@@ -62,7 +62,7 @@ export const proxyWithHistory = <V>(initialValue: V, skipSubscribe = false) => {
     subscribe: () =>
       subscribe(proxyObject, (ops) => {
         if (
-          ops.some(
+          ops.every(
             (op) =>
               op[1][0] === 'value' &&
               (op[0] !== 'set' || op[2] !== proxyObject.history.wip)


Test patch:
diff --git a/tests/history.test.tsx b/tests/history.test.tsx
index 23f7dda..1f86cb8 100644
--- a/tests/history.test.tsx
+++ b/tests/history.test.tsx
@@ -180,3 +180,50 @@ it('count in nested object', async () => {
   fireEvent.click(getByText('undo'))
   await findByText('count: 0')
 })
+
+it('multiple redos at once (#323)', async () => {
+  const state = proxyWithHistory({ nested: { count: 0 } })
+
+  const Counter = () => {
+    const snap = useSnapshot(state)
+    return (
+      <>
+        <div>count: {snap.value.nested.count}</div>
+        <button onClick={() => ++state.value.nested.count}>inc</button>
+        <button
+          onClick={() => {
+            state.undo()
+            state.undo()
+          }}>
+          undo twice
+        </button>
+        <button
+          onClick={() => {
+            state.redo()
+            state.redo()
+          }}>
+          redo twice
+        </button>
+      </>
+    )
+  }
+
+  const { getByText, findByText } = render(
+    <StrictMode>
+      <Counter />
+    </StrictMode>
+  )
+
+  await findByText('count: 0')
+
+  fireEvent.click(getByText('inc'))
+  await findByText('count: 1')
+  fireEvent.click(getByText('inc'))
+  await findByText('count: 2')
+
+  fireEvent.click(getByText('undo twice'))
+  await findByText('count: 0')
+
+  fireEvent.click(getByText('redo twice'))
+  await findByText('count: 2')
+})
Repository: raphlinus/pulldown-cmark (rust)

Issue:
[fuzz result] incorrect run length matching in emphasis
Consider this examples, specifically the parts that are underlined with `-`s

```
**a.*.**a*.**.
 -          -
```

The [dingus](https://spec.commonmark.org/dingus/?text=**a.*.**a*.**.%0A%0A*a.*.**a*.**.) and pandoc both match the underlines delimiters together, but pulldown-cmark isn't.

This looks like a bug in lower bound tracking, because lower bounds are being tracked by delimiter length instead of being tracked by run length.

Pull request:
Fix emphasis run length delimiter lower limit bug
Fixes #741

Patch:
diff --git a/specs/regression.txt b/specs/regression.txt
index 2ecd229..a3f2ddc 100644
--- a/specs/regression.txt
+++ b/specs/regression.txt
@@ -1484,4 +1484,12 @@ an unmatched asterisk.</p>
 <em>{</em>{</p>
 <p><em>x</em>
 <em>{</em>{</p>
-````````````````````````````````
\ No newline at end of file
+````````````````````````````````
+
+ISSUE 741
+
+```````````````````````````````` example
+**a.*.**a*.**.
+.
+<p>*<em>a.*.<em><em>a</em>.</em></em>.</p>
+````````````````````````````````
diff --git a/src/parse.rs b/src/parse.rs
index 167acdf..97d5579 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -583,7 +583,7 @@ impl<'input, 'callback> Parser<'input, 'callback> {
                     let both = can_open && can_close;
                     if can_close {
                         while let Some(el) =
-                            self.inline_stack.find_match(&mut self.tree, c, count, run_length, both)
+                            self.inline_stack.find_match(&mut self.tree, c, run_length, both)
                         {
                             // have a match!
                             if let Some(prev_ix) = prev {
@@ -1116,11 +1116,10 @@ impl InlineStack {
         &mut self,
         tree: &mut Tree<Item>,
         c: u8,
-        count: usize,
         run_length: usize,
         both: bool,
     ) -> Option<InlineEl> {
-        let lowerbound = min(self.stack.len(), self.get_lowerbound(c, count, both));
+        let lowerbound = min(self.stack.len(), self.get_lowerbound(c, run_length, both));
         let res = self.stack[lowerbound..]
             .iter()
             .cloned()
@@ -1139,7 +1138,7 @@ impl InlineStack {
             self.truncate(matching_ix);
             Some(matching_el)
         } else {
-            self.set_lowerbound(c, count, both, self.stack.len());
+            self.set_lowerbound(c, run_length, both, self.stack.len());
             None
         }
     }


Test patch:
diff --git a/tests/suite/regression.rs b/tests/suite/regression.rs
index f844ff5..6ee23f9 100644
--- a/tests/suite/regression.rs
+++ b/tests/suite/regression.rs
@@ -1752,4 +1752,14 @@ an unmatched asterisk.</p>
 "##;
   
     test_markdown_html(original, expected, false, false, false);
-}
\ No newline at end of file
+}
+
+#[test]
+fn regression_test_115() {
+    let original = r##"**a.*.**a*.**.
+"##;
+    let expected = r##"<p>*<em>a.*.<em><em>a</em>.</em></em>.</p>
+"##;
+  
+    test_markdown_html(original, expected, false, false, false);
+}
Repository: VeryGoodOpenSource/dart_frog (dart)

Issue:
fix: bad state: The 'read' method can only be called once
**Description**

Seeing the following:

```sh
Asynchronous error
Bad state: The 'read' method can only be called once on a shelf.Request/shelf.Response object.

package:shelf/shelf_io.dart 143:11  handleRequest
```

When running the example and visiting `http://localhost:8080` in the browser.

Pull request:
<!--
  Thanks for contributing!

  Provide a description of your changes below and a general summary in the title

  Please look at the following checklist to ensure that your PR can be accepted quickly:
-->

## Status

**READY**

## Description

<!--- Describe your changes in detail -->
- fix(dart_frog): support multiple routeNotFound.read calls (closes #27)

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ] ✨ New feature (non-breaking change which adds functionality)
- [X] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
- [ ] 🧹 Code refactor
- [ ] ✅ Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore

Patch:
diff --git a/packages/dart_frog/lib/src/router.dart b/packages/dart_frog/lib/src/router.dart
index 0241ff090..c1b106036 100644
--- a/packages/dart_frog/lib/src/router.dart
+++ b/packages/dart_frog/lib/src/router.dart
@@ -103,6 +103,9 @@ class _RouteNotFoundResponse extends Response {
   static const _message = 'Route not found';
   static final _messageBytes = utf8.encode(_message);
 
+  @override
+  shelf.Response get _response => super._response.change(body: _messageBytes);
+
   @override
   Stream<List<int>> bytes() => Stream<List<int>>.value(_messageBytes);
 


Test patch:
diff --git a/packages/dart_frog/test/src/serve_test.dart b/packages/dart_frog/test/src/serve_test.dart
index e4ec1bff8..dd80691ac 100644
--- a/packages/dart_frog/test/src/serve_test.dart
+++ b/packages/dart_frog/test/src/serve_test.dart
@@ -13,5 +13,17 @@ void main() {
       expect(response.statusCode, equals(HttpStatus.ok));
       await server.close();
     });
+
+    test('can return multiple 404s', () async {
+      final server = await serve(Router(), 'localhost', 3001);
+      final client = HttpClient();
+      var request = await client.getUrl(Uri.parse('http://localhost:3001'));
+      var response = await request.close();
+      expect(response.statusCode, equals(HttpStatus.notFound));
+      request = await client.getUrl(Uri.parse('http://localhost:3001'));
+      response = await request.close();
+      expect(response.statusCode, equals(HttpStatus.notFound));
+      await server.close();
+    });
   });
 }