PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: yannickcr/eslint-plugin-react (js)

Issue:
no-literals: only check strings
should the no-literals rule check if the `node.value` is a string? with the new `{ "noStrings": true }` option (https://github.com/yannickcr/eslint-plugin-react/pull/1202) I'm getting errors for explicitly set boolean and number props `booleanprop={true}` `numberprop={100}`

Pull request:
Fix false positives in no-literals
This rule should only check strings.

Fixes #1301

Patch:
diff --git a/lib/rules/jsx-no-literals.js b/lib/rules/jsx-no-literals.js
index 8b170543..797f5fc5 100644
--- a/lib/rules/jsx-no-literals.js
+++ b/lib/rules/jsx-no-literals.js
@@ -44,6 +44,7 @@ module.exports = {
 
     function getValidation(node) {
       const standard = !/^[\s]+$/.test(node.value) &&
+          typeof node.value === 'string' &&
           node.parent &&
           node.parent.type.indexOf('JSX') !== -1 &&
           node.parent.type !== 'JSXAttribute';
@@ -63,6 +64,12 @@ module.exports = {
         if (getValidation(node)) {
           reportLiteralNode(node);
         }
+      },
+
+      TemplateLiteral: function(node) {
+        if (isNoStrings && node.parent.type === 'JSXExpressionContainer') {
+          reportLiteralNode(node);
+        }
       }
 
     };


Test patch:
diff --git a/tests/lib/rules/jsx-no-literals.js b/tests/lib/rules/jsx-no-literals.js
index d506d877..78fdf65c 100644
--- a/tests/lib/rules/jsx-no-literals.js
+++ b/tests/lib/rules/jsx-no-literals.js
@@ -140,7 +140,43 @@ ruleTester.run('jsx-no-literals', rule, {
         </Foo>
       `,
       options: [{noStrings: true}]
+    }, {
+      code: '<Foo bar={true} />',
+      options: [{noStrings: true}]
+    }, {
+      code: '<Foo bar={false} />',
+      options: [{noStrings: true}]
+    }, {
+      code: '<Foo bar={100} />',
+      options: [{noStrings: true}]
+    }, {
+      code: '<Foo bar={null} />',
+      options: [{noStrings: true}]
+    }, {
+      code: '<Foo bar={{}} />',
+      options: [{noStrings: true}]
+    }, {
+      code: [
+        'class Comp1 extends Component {',
+        '  asdf() {}',
+        '  render() {',
+        '    return <Foo bar={this.asdf} />;',
+        '  }',
+        '}'
+      ].join('\n'),
+      options: [{noStrings: true}]
+    }, {
+      code: [
+        'class Comp1 extends Component {',
+        '  render() {',
+        '    let foo = `bar`;',
+        '    return <div />;',
+        '  }',
+        '}'
+      ].join('\n'),
+      options: [{noStrings: true}]
     }
+
   ],
 
   invalid: [
@@ -267,6 +303,18 @@ ruleTester.run('jsx-no-literals', rule, {
       `,
       options: [{noStrings: true}],
       errors: [{message: 'Strings not allowed in JSX files'}]
+    }, {
+      code: [
+        '<Foo>',
+        '  {`Test`}',
+        '</Foo>'
+      ].join('\n'),
+      options: [{noStrings: true}],
+      errors: [{message: 'Strings not allowed in JSX files'}]
+    }, {
+      code: '<Foo bar={`Test`} />',
+      options: [{noStrings: true}],
+      errors: [{message: 'Strings not allowed in JSX files'}]
     }
   ]
 });
Repository: platers/obsidian-linter (ts)

Issue:
[BUG] remove-multiple-spaces inconsistent...
I commonly see Linter leave multiple spaces after punctuation, and sometimes before:

<img width="647" alt="image" src="https://user-images.githubusercontent.com/42705243/173258829-4aac4451-e2f2-4e65-af05-f0721d3ce108.png">

possibly relevant configuration items:
remove-multiple-spaces ON
remove-trailing-spaces ON
two space linebreak ON
space between Chinese and English or numbers OFF

Pull request:
Make Remove Multiple Whitespace Remove Multiple Spaces Around Non-Letters
Fixes #226 

There was an issue reported where sometimes multiple whitespace values were not getting removed. After looking at the logic, it was determined that the issue was the use of `\b` instead of more generic value of `[^\s]` which matches on any character that is not a new line character as opposed to just word endings (punctuation and others did not seem to match all of the time).

Changes Made:
- Updated remove multiple whitespace regex
- Added UTs around the issue

Patch:
diff --git a/src/rules.ts b/src/rules.ts
index b0be9c2..cf13373 100644
--- a/src/rules.ts
+++ b/src/rules.ts
@@ -646,7 +646,7 @@ export const rules: Rule[] = [
       RuleType.CONTENT,
       (text: string) => {
         return ignoreCodeBlocksYAMLAndLinks(text, (text) => {
-          return text.replace(/\b {2,}\b/g, ' ');
+          return text.replace(/([^\s])( ){2,}([^\s])/g, '$1 $3');
         });
       },
       [


Test patch:
diff --git a/src/test.ts b/src/test.ts
index 2929fb5..7a959db 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -929,3 +929,45 @@ describe('Links', () => {
     expect(rulesDict['capitalize-headings'].apply(before, {'Style': 'First letter'})).toBe(after);
   });
 });
+
+describe('Remove Multiple Spaces', () => {
+  it('Make sure spaces at the end of the line are ignored', () => {
+    const before = dedent`
+    # Hello world
+
+    Paragraph contents are here  
+    Second paragraph contents here  
+    `;
+
+    const after = dedent`
+    # Hello world
+
+    Paragraph contents are here  
+    Second paragraph contents here  
+    `;
+
+    expect(rulesDict['remove-multiple-spaces'].apply(before)).toBe(after);
+  });
+  it('Make sure spaces at the start of the line are ignored', () => {
+    const before = '  Paragraph contents are here\n  Second paragraph here...';
+
+    const after = '  Paragraph contents are here\n  Second paragraph here...';
+
+    expect(rulesDict['remove-multiple-spaces'].apply(before)).toBe(after);
+  });
+  it('Make sure non-letter followed or preceeded by 2 spaces has them cut down to 1 space', () => {
+    const before = dedent`
+    # Hello world
+
+    Paragraph contents  (something). Something else  .
+    `;
+
+    const after = dedent`
+    # Hello world
+
+    Paragraph contents (something). Something else .
+    `;
+
+    expect(rulesDict['remove-multiple-spaces'].apply(before)).toBe(after);
+  });
+});
Repository: semantic-release/gitlab (js)

Issue:
Release asset URLs are incorrect
> This fix caused the downloaded files to be unavailable. 
> The assets files url now contains the Project ID instead of the project name, which made the files inaccessible. Manually fixing the link means that the file is available for download. 
> Perhaps this is our problem with self-hosted GitLab. We decided to roll back to semantic-release/gitlab ver 12.0.3
> 

_Originally posted by @JedaiRussia in https://github.com/semantic-release/gitlab/issues/576#issuecomment-1670059770_
            

Pull request:
fix: use project path for API calls again
The numeric project ID is not working for all cases and I don't have the capacity right now to think about a generic solution.

People that have issues with the project path can override `CI_PROJECT_PATH` for the semantic-release invocation. 

Reverts semantic-release/gitlab#576

Closes #579 

/cc @JedaiRussia @gaborauth 

Patch:
diff --git a/lib/get-repo-id.js b/lib/get-repo-id.js
index f2aa251..f56cf82 100644
--- a/lib/get-repo-id.js
+++ b/lib/get-repo-id.js
@@ -1,9 +1,9 @@
 import parseUrl from "parse-url";
 import escapeStringRegexp from "escape-string-regexp";
 
-export default ({ envCi: { service } = {}, env: { CI_PROJECT_ID } }, gitlabUrl, repositoryUrl) =>
-  service === "gitlab" && CI_PROJECT_ID
-    ? CI_PROJECT_ID
+export default ({ envCi: { service } = {}, env: { CI_PROJECT_PATH } }, gitlabUrl, repositoryUrl) =>
+  service === "gitlab" && CI_PROJECT_PATH
+    ? CI_PROJECT_PATH
     : parseUrl(repositoryUrl)
         .pathname.replace(new RegExp(`^${escapeStringRegexp(parseUrl(gitlabUrl).pathname)}`), "")
         .replace(/^\//, "")


Test patch:
diff --git a/test/get-repo-id.test.js b/test/get-repo-id.test.js
index 202e393..f7f09fc 100644
--- a/test/get-repo-id.test.js
+++ b/test/get-repo-id.test.js
@@ -41,18 +41,18 @@ test("Parse repo id with organization and subgroup", (t) => {
 test("Get repo id from GitLab CI", (t) => {
   t.is(
     getRepoId(
-      { envCi: { service: "gitlab" }, env: { CI_PROJECT_ID: "123" } },
+      { envCi: { service: "gitlab" }, env: { CI_PROJECT_PATH: "other-owner/other-repo" } },
       "https://gitlbab.com",
       "https://gitlab.com/owner/repo.git"
     ),
-    "123"
+    "other-owner/other-repo"
   );
 });
 
-test("Ignore CI_PROJECT_ID if not on GitLab CI", (t) => {
+test("Ignore CI_PROJECT_PATH if not on GitLab CI", (t) => {
   t.is(
     getRepoId(
-      { envCi: { service: "travis" }, env: { CI_PROJECT_ID: "123" } },
+      { envCi: { service: "travis" }, env: { CI_PROJECT_PATH: "other-owner/other-repo" } },
       "https://gitlbab.com",
       "https://gitlab.com/owner/repo.git"
     ),
Repository: CSCfi/rems (clojure)

Issue:
Show all members of an application in lists
Application lists should show all the members of an application in the members column and not just the applicant or the column should be renamed to "applicant".

- [x] fix localization text to say "Applicant"

Pull request:
closes #1126 

instead, change test for overriding translations to use a translation
that changes American spelling to British spelling, less likely
to cause confusion.

Patch:
diff --git a/example-theme/extra-translations/en.edn b/example-theme/extra-translations/en.edn
index aa97c35102..5b4c9eb9b8 100644
--- a/example-theme/extra-translations/en.edn
+++ b/example-theme/extra-translations/en.edn
@@ -1,3 +1,3 @@
 {:t
  {:administration {:catalogue-items "Catalogue"}
-  :actions {:applicant "Members"}}}
+  :create-license {:license-text "Licence text"}}}


Test patch:
diff --git a/test/clj/rems/test_locales.clj b/test/clj/rems/test_locales.clj
index 8e4c59b8ed..c886b605ec 100644
--- a/test/clj/rems/test_locales.clj
+++ b/test/clj/rems/test_locales.clj
@@ -94,7 +94,7 @@
                                                    :translations-directory "translations/"
                                                    :theme-path "./example-theme/theme.edn"})]
       (is (= "Catalogue" (getx-in translations [:en :t :administration :catalogue-items])))
-      (is (= "Members" (getx-in translations [:en :t :actions :applicant])))))
+      (is (= "Licence text" (getx-in translations [:en :t :create-license :license-text])))))
   (testing "extra translations don't override keys that are not defined in extras"
     (let [translations (locales/load-translations {:languages [:en]
                                                    :translations-directory "translations/"
Repository: diegoholiveira/jsonlogic (go)

Issue:
filter body returns error when used with array-form var
Using the full `{"var": [...]}` syntax instead of the syntax sugar `{"var": "..."}` causes an error when present in a `filter` body. As an example, the following rule (adapted from the test suite) will fail:

```json
	{
		"filter": [
			{"var": ["people"]},
			{"==": [
				{"var": [".age"]},
				{"min": {"map": [
					{"var": ["people"]},
					{"var": [".age"]}
				]}}
			]}
		]
	}
```
with the data:
```json
	{
		"people": [
			{"age":18, "name":"John"},
			{"age":20, "name":"Luke"},
			{"age":18, "name":"Mark"}
		]
	}
```

I believe the cause is this line: https://github.com/diegoholiveira/jsonlogic/blob/master/vars.go#L15

Pull request:
Ensure value is string before trying to convert it
closes #70 

Patch:
diff --git a/jsonlogic.go b/jsonlogic.go
index babe7f8..48a0320 100644
--- a/jsonlogic.go
+++ b/jsonlogic.go
@@ -6,6 +6,7 @@ import (
 	"io"
 	"sort"
 	"strings"
+	// "runtime/debug"
 
 	"github.com/mitchellh/copystructure"
 )
diff --git a/vars.go b/vars.go
index 46294d5..d619e6e 100644
--- a/vars.go
+++ b/vars.go
@@ -12,7 +12,7 @@ func solveVars(values, data interface{}) interface{} {
 
 		for key, value := range values.(map[string]interface{}) {
 			if key == "var" {
-				if value == "" || strings.HasPrefix(value.(string), ".") {
+				if isString(value) && (value == "" || strings.HasPrefix(value.(string), ".")) {
 					logic["var"] = value
 					continue
 				}


Test patch:
diff --git a/jsonlogic_test.go b/jsonlogic_test.go
index 07b0b02..aa9e548 100644
--- a/jsonlogic_test.go
+++ b/jsonlogic_test.go
@@ -741,6 +741,30 @@ func TestIssue58_example(t *testing.T) {
 	assert.JSONEq(t, expected, result.String())
 }
 
+func TestIssue70(t *testing.T) {
+	data := strings.NewReader(`{"people": [
+		{"age":18, "name":"John"},
+		{"age":20, "name":"Luke"},
+		{"age":18, "name":"Mark"}
+]}`)
+	logic := strings.NewReader(`{"filter": [
+	{"var": ["people"]},
+	{"==": [{"var": ["age"]}, 18]}
+]}`)
+
+	var result bytes.Buffer
+	err := Apply(logic, data, &result)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	expected := `[
+    {"age": 18, "name": "John"},
+    {"age": 18, "name": "Mark"}
+]`
+	assert.JSONEq(t, expected, result.String())
+}
+
 func TestIssue71_example_empty_min(t *testing.T) {
 	data := strings.NewReader(`{}`)
 	logic := strings.NewReader(`{"min":[]}`)
Repository: node-nock/nock (js)

Issue:
`content-length: 0` is not matched correctly
The problem is this line

https://github.com/node-nock/nock/blob/8c7cf84a42a77ef4066bfd89208357493b9fb59c/lib/interceptor.js#L166

We check above if either `reqHeader` or `header` is undefined so we don’t need the `if (reqHeader && header) {` anymore. As both `reqHeader` and `header` are `0` the condition will not be fulfilled and the `reqheaderMatches` method returns false, although the values are exactly the same.

I’ll add a pull request with a test case to resolve it

Pull request:
match headers with falsy values
closes #966

Patch:
diff --git a/lib/interceptor.js b/lib/interceptor.js
index 5de6e2e..426263f 100755
--- a/lib/interceptor.js
+++ b/lib/interceptor.js
@@ -163,7 +163,7 @@ Interceptor.prototype.reqheaderMatches = function reqheaderMatches(options, key)
         return true;
     }
 
-    if (reqHeader && header) {
+    if (!_.isUndefined(reqHeader) && !_.isUndefined(header)) {
         if (_.isFunction(reqHeader)) {
             return reqHeader(header);
         } else if (common.matchStringOrRegexp(header, reqHeader)) {


Test patch:
diff --git a/tests/test_intercept.js b/tests/test_intercept.js
index 20113fa..9866eac 100755
--- a/tests/test_intercept.js
+++ b/tests/test_intercept.js
@@ -4129,6 +4129,29 @@ test('mocking succeeds even when mocked and specified request header names have
 
 });
 
+test('mocking succeeds when mocked and specified request headers have falsy values (#966)', function(t) {
+  var scope = nock('http://example.com', {
+    reqheaders: {
+      "x-foo": 0
+    }
+  })
+    .post('/resource')
+    .reply(200, { status: "ok" });
+
+  mikealRequest({
+    method: 'POST',
+    uri: 'http://example.com/resource',
+    headers: {
+      "X-Foo": 0
+    }
+  }, function(err, res, body) {
+    t.error(err);
+    t.equal(res.statusCode, 200);
+    t.end();
+  });
+
+});
+
 test('mocking succeeds even when host request header is not specified', function(t) {
   var scope = nock('http://example.com')
     .post('/resource')
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 338
Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

Given an integer `n`, find the next biggest integer with the same number of 1-bits on. For example, given the number `6` (`0110` in binary), return `9` (`1001`).

Pull request:
Day338
Resolves #675 

Patch:
diff --git a/README.md b/README.md
index ceba8f4..2ab56a5 100644
--- a/README.md
+++ b/README.md
@@ -329,5 +329,6 @@ problems from
 * [Day 323](https://github.com/vaskoz/dailycodingproblem-go/issues/656)
 * [Day 324](https://github.com/vaskoz/dailycodingproblem-go/issues/658)
 * [Day 325](https://github.com/vaskoz/dailycodingproblem-go/issues/660)
+* [Day 338](https://github.com/vaskoz/dailycodingproblem-go/issues/675)
 * [Day 339](https://github.com/vaskoz/dailycodingproblem-go/issues/676)
 * [Day 340](https://github.com/vaskoz/dailycodingproblem-go/issues/679)
diff --git a/day338/problem.go b/day338/problem.go
new file mode 100644
index 0000000..19d743d
--- /dev/null
+++ b/day338/problem.go
@@ -0,0 +1,16 @@
+package day338
+
+// NextIntSameSetBits returns the next greater
+// integer with the same set bits.
+func NextIntSameSetBits(n int) int {
+	res := 0
+	if n != 0 {
+		rightMostBitInt := n & -n
+		nextHigherSetBitInt := n + rightMostBitInt
+		d := n ^ nextHigherSetBitInt
+		d /= rightMostBitInt
+		d >>= 2
+		res = nextHigherSetBitInt | d
+	}
+	return res
+}


Test patch:
diff --git a/day338/problem_test.go b/day338/problem_test.go
new file mode 100644
index 0000000..043a99c
--- /dev/null
+++ b/day338/problem_test.go
@@ -0,0 +1,28 @@
+package day338
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	n, next int
+}{
+	{6, 9},
+	{156, 163},
+}
+
+func TestNextIntSameSetBits(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if next := NextIntSameSetBits(tc.n); next != tc.next {
+			t.Errorf("Expected %v, got %v", tc.next, next)
+		}
+	}
+}
+
+func BenchmarkNextIntSameSetBits(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			NextIntSameSetBits(tc.n)
+		}
+	}
+}
Repository: reactiflux/discord-irc (js)

Issue:
Sends empty message to IRC when an attachment is added
Not sure how robust discord.js is but when someone attaches a file of any format it will just send a blank message to IRC. It would be cool to pull the name of the attachment and put something like "<USER> Attached file 'filename.ext'." if that's not possible maybe just have it say something like "<USER> Attached a file, please log into Discord to view it."

Pull request:
Send attachment URL to IRC
Also closes #14.

Patch:
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5cfbf4e..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
-  - '0.12'
-  - '4'
-  - '5'
diff --git a/lib/bot.js b/lib/bot.js
index 74f943e..aa24c73 100644
--- a/lib/bot.js
+++ b/lib/bot.js
@@ -143,6 +143,13 @@ class Bot {
         const prelude = `Command sent from Discord by ${username}:`;
         this.ircClient.say(ircChannel, prelude);
         this.ircClient.say(ircChannel, text);
+      } else if (message.attachments && message.attachments.length) {
+        message.attachments.forEach(a => {
+          const urlMessage =
+            `${coloredUsername} posted an attachment to ${channelName} on Discord: ${a.url}`;
+          logger.debug('Sending attachment URL to IRC', ircChannel, urlMessage);
+          this.ircClient.say(ircChannel, urlMessage);
+        });
       } else {
         text = `<${coloredUsername}> ${text}`;
         logger.debug('Sending message to IRC', ircChannel, text);


Test patch:
diff --git a/test/bot.test.js b/test/bot.test.js
index 3aadbe9..5707b03 100644
--- a/test/bot.test.js
+++ b/test/bot.test.js
@@ -84,6 +84,30 @@ describe('Bot', function() {
     ClientStub.prototype.say.should.have.been.calledWith('#irc', expected);
   });
 
+  it('should send attachment URL to IRC', function() {
+    const attachmentUrl = 'https://image/url.jpg';
+    const message = {
+      content: '',
+      attachments: [{
+        url: attachmentUrl
+      }],
+      mentions: [],
+      channel: {
+        name: 'discord'
+      },
+      author: {
+        username: 'otherauthor',
+        id: 'not bot id'
+      }
+    };
+
+    this.bot.sendToIRC(message);
+    // Wrap in colors:
+    const expected = `\u000304${message.author.username}\u000f posted an attachment to ` +
+      `#${message.channel.name} on Discord: ${attachmentUrl}`;
+    ClientStub.prototype.say.should.have.been.calledWith('#irc', expected);
+  });
+
   it('should not send its own messages to irc', function() {
     const message = {
       author: {
Repository: ponder-sh/ponder (ts)

Issue:
bug: duplicate SQL table names are not validated
We implicitly validate against duplicate JS table names, but because you can pass a custom SQL table name to `onchainTable` we can end up with duplicates. This breaks important invariants including a known crash when reverting operations after a reorg.

We should add an explicit validation during the build step.

Pull request:
add validation for duplicate table names
Closes #1638 

Patch:
diff --git a/.changeset/fifty-moose-speak.md b/.changeset/fifty-moose-speak.md
new file mode 100644
index 00000000..480f0fa6
--- /dev/null
+++ b/.changeset/fifty-moose-speak.md
@@ -0,0 +1,5 @@
+---
+"ponder": patch
+---
+
+Added validation for schemas with duplicate table names.
diff --git a/packages/core/src/build/schema.ts b/packages/core/src/build/schema.ts
index 13e400f1..7f22181e 100644
--- a/packages/core/src/build/schema.ts
+++ b/packages/core/src/build/schema.ts
@@ -1,7 +1,7 @@
 import { getSql } from "@/drizzle/kit/index.js";
 import { BuildError } from "@/internal/errors.js";
 import type { Schema } from "@/internal/types.js";
-import { SQL, getTableColumns, is } from "drizzle-orm";
+import { SQL, getTableColumns, getTableName, is } from "drizzle-orm";
 import {
   PgBigSerial53,
   PgBigSerial64,
@@ -16,6 +16,8 @@ import {
 export const buildSchema = ({ schema }: { schema: Schema }) => {
   const statements = getSql(schema);
 
+  const tableNames = new Set<string>();
+
   for (const [name, s] of Object.entries(schema)) {
     if (is(s, PgTable)) {
       let hasPrimaryKey = false;
@@ -81,6 +83,14 @@ export const buildSchema = ({ schema }: { schema: Schema }) => {
         }
       }
 
+      if (tableNames.has(getTableName(s))) {
+        throw new Error(
+          `Schema validation failed: table name '${getTableName(s)}' is used multiple times.`,
+        );
+      } else {
+        tableNames.add(getTableName(s));
+      }
+
       if (getTableConfig(s).primaryKeys.length > 1) {
         throw new Error(
           `Schema validation failed: '${name}' has multiple primary keys.`,


Test patch:
diff --git a/packages/core/src/build/schema.test.ts b/packages/core/src/build/schema.test.ts
index d251c677..1a26356f 100644
--- a/packages/core/src/build/schema.test.ts
+++ b/packages/core/src/build/schema.test.ts
@@ -220,3 +220,16 @@ test("buildScheama() success with enum", () => {
 
   buildSchema({ schema });
 });
+
+test("buildScheama() duplicate table name", () => {
+  const schema = {
+    account: onchainTable("account", (p) => ({
+      address: p.hex().primaryKey(),
+    })),
+    account2: onchainTable("account", (p) => ({
+      address: p.hex().primaryKey(),
+    })),
+  };
+
+  expect(() => buildSchema({ schema })).toThrowError();
+});