nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: pinojs/pino
Pull request #424 (2018-05-29 12:23:26)

Fix set level in browser logger
I forgot to test additional cases in #419 


Patch:
diff --git a/browser.js b/browser.js
index 97dcb49..a3f1cca 100644
--- a/browser.js
+++ b/browser.js
@@ -155,14 +155,14 @@ pino.levels = {
 pino.stdSerializers = stdSerializers
 
 function set (opts, logger, level, fallback) {
-  var val = logger.levelVal
-  logger[level] = val > pino.levels.values[level] ? noop
-    : (logger[level] ? logger[level] : (_console[level] || _console[fallback] || noop))
+  var proto = Object.getPrototypeOf(logger)
+  logger[level] = logger.levelVal > logger.levels.values[level] ? noop
+    : (proto[level] ? proto[level] : (_console[level] || _console[fallback] || noop))
 
-  wrap(opts, logger, logger.val, level)
+  wrap(opts, logger, level)
 }
 
-function wrap (opts, logger, val, level) {
+function wrap (opts, logger, level) {
   if (!opts.transmit && logger[level] === noop) return
 
   logger[level] = (function (write) {
@@ -190,7 +190,7 @@ function wrap (opts, logger, val, level) {
           transmitLevel: transmitLevel,
           transmitValue: pino.levels.values[opts.transmit.level || logger.level],
           send: opts.transmit.send,
-          val: val
+          val: logger.levelVal
         }, args)
       }
     }


Test patch:
diff --git a/test/browser.levels.test.js b/test/browser.levels.test.js
index 27f5efc..d63575d 100644
--- a/test/browser.levels.test.js
+++ b/test/browser.levels.test.js
@@ -29,6 +29,66 @@ test('set the level by string', function (t) {
   t.end()
 })
 
+test('set the level by string. init with silent', function (t) {
+  t.plan(4)
+  var expected = [
+    {
+      level: 50,
+      msg: 'this is an error'
+    },
+    {
+      level: 60,
+      msg: 'this is fatal'
+    }
+  ]
+  var instance = pino({
+    level: 'silent',
+    browser: {
+      write: function (actual) {
+        checkLogObjects(t, actual, expected.shift())
+      }
+    }
+  })
+
+  instance.level = 'error'
+  instance.info('hello world')
+  instance.error('this is an error')
+  instance.fatal('this is fatal')
+  t.end()
+})
+
+test('set the level by string. init with silent and transmit', function (t) {
+  t.plan(4)
+  var expected = [
+    {
+      level: 50,
+      msg: 'this is an error'
+    },
+    {
+      level: 60,
+      msg: 'this is fatal'
+    }
+  ]
+  var instance = pino({
+    level: 'silent',
+    browser: {
+      write: function (actual) {
+        checkLogObjects(t, actual, expected.shift())
+      }
+    },
+    transmit: {
+      send: function () {
+      }
+    }
+  })
+
+  instance.level = 'error'
+  instance.info('hello world')
+  instance.error('this is an error')
+  instance.fatal('this is fatal')
+  t.end()
+})
+
 test('set the level via constructor', function (t) {
   t.plan(4)
   var expected = [
Repository: ember-template-lint/ember-template-lint
Pull request #887 (2019-10-30 16:57:23)

Ensure `no-action` does not error when encountering literals (StringLiteral, BooleanLiteral, etc).
error from 
```hbs
 <PButton
      @naked={{true}}
 />
```
and in `getLocalName` from `rules/internal/scope`

`no-action` uses `isLocal` method, and it's fails for Bool, String, Undef, Null paths

// https://github.com/ember-template-lint/ember-template-lint/issues/881

* pathExpression has empty parts if it's `{{this}}`

rwjblue: Also, thank you for jumping on this so quickly!

Patch:
diff --git a/lib/rules/internal/scope.js b/lib/rules/internal/scope.js
index 84fdd0e5..5d16044d 100644
--- a/lib/rules/internal/scope.js
+++ b/lib/rules/internal/scope.js
@@ -10,11 +10,16 @@ function getLocalName(node) {
     case 'SubExpression':
     case 'MustacheStatement':
     case 'BlockStatement':
-      return node.path.parts[0];
+      return getLocalName(node.path);
 
+    case 'UndefinedLiteral':
+    case 'NullLiteral':
+    case 'BooleanLiteral':
+    case 'StringLiteral':
+      return undefined;
     case 'PathExpression':
     default:
-      return node.parts[0];
+      return node.parts.length ? node.parts[0] : undefined;
   }
 }
 
diff --git a/lib/rules/lint-no-action.js b/lib/rules/lint-no-action.js
index e538a8f4..fd581c43 100644
--- a/lib/rules/lint-no-action.js
+++ b/lib/rules/lint-no-action.js
@@ -16,6 +16,9 @@ module.exports = class NoAction extends Rule {
         return;
       }
       let maybeAction = node.path.original;
+      if (node.path.type === 'StringLiteral') {
+        return;
+      }
       if (maybeAction !== 'action') {
         return;
       }


Test patch:
diff --git a/test/unit/rules/lint-no-action-test.js b/test/unit/rules/lint-no-action-test.js
index ec5bfa30..ca58ed63 100644
--- a/test/unit/rules/lint-no-action-test.js
+++ b/test/unit/rules/lint-no-action-test.js
@@ -13,6 +13,12 @@ generateRuleTests({
     '<MyScope as |action|><Component @baz={{action}} /></MyScope>',
     '<button {{on "submit" @action}}>Click Me</button>',
     '<button {{on "submit" this.action}}>Click Me</button>',
+    // check for scope.getLocalName working for primitives and locals #881
+    '<PButton @naked={{true}} />',
+    '<PButton @naked={{undefined}} />',
+    '<PButton @naked={{null}} />',
+    '<PButton @naked={{this}} />',
+    '<PButton @naked={{"action"}} />',
   ],
 
   bad: [
Repository: ember-template-lint/ember-template-lint
Pull request #904 (2019-11-05 05:21:54)

Update `block-indentation` to ignore children of `<template>` and `<textarea>`
https://github.com/ember-template-lint/ember-template-lint/pull/902
https://github.com/ember-template-lint/ember-template-lint/issues/702


Patch:
diff --git a/lib/rules/lint-block-indentation.js b/lib/rules/lint-block-indentation.js
index 2822aec4..330a44f1 100644
--- a/lib/rules/lint-block-indentation.js
+++ b/lib/rules/lint-block-indentation.js
@@ -71,7 +71,7 @@ const VOID_TAGS = {
   track: true,
   wbr: true,
 };
-const IGNORED_ELEMENTS = new Set(['pre', 'script', 'style']);
+const IGNORED_ELEMENTS = new Set(['pre', 'script', 'style', 'template', 'textarea']);
 
 function isControlChar(char) {
   return char === '~' || char === '{' || char === '}';


Test patch:
diff --git a/test/unit/rules/lint-block-indentation-test.js b/test/unit/rules/lint-block-indentation-test.js
index d14abb3f..81d59d54 100644
--- a/test/unit/rules/lint-block-indentation-test.js
+++ b/test/unit/rules/lint-block-indentation-test.js
@@ -106,7 +106,16 @@ generateRuleTests({
     ].join('\n'),
     ['{{#if foo}}', '  &nbsp;bar', '{{/if}}'].join('\n'),
     '<pre>\nsome text</pre>',
+    '<script>\nsome text</script>',
+    '<template>\nsome text</template>',
+    '<textarea>\nsome text</textarea>',
+    '<textarea> \n<div>\nsome text   \n \n </div></textarea>',
+    '<style>\nsome text</style>',
     '<pre>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </pre>',
+    '<script>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </script>',
+    '<template>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </template>',
+    '<style>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </style>',
+    '<textarea>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </textarea>',
   ],
 
   bad: [
Repository: ember-template-lint/ember-template-lint
Pull request #905 (2019-11-05 05:49:46)

Ensure configuration ordering does not matter with `no-bare-strings`
https://github.com/ember-template-lint/ember-template-lint/issues/903

//cc @boris-petrov 


Patch:
diff --git a/lib/rules/lint-block-indentation.js b/lib/rules/lint-block-indentation.js
index 2822aec4..330a44f1 100644
--- a/lib/rules/lint-block-indentation.js
+++ b/lib/rules/lint-block-indentation.js
@@ -71,7 +71,7 @@ const VOID_TAGS = {
   track: true,
   wbr: true,
 };
-const IGNORED_ELEMENTS = new Set(['pre', 'script', 'style']);
+const IGNORED_ELEMENTS = new Set(['pre', 'script', 'style', 'template', 'textarea']);
 
 function isControlChar(char) {
   return char === '~' || char === '{' || char === '}';
diff --git a/lib/rules/lint-no-bare-strings.js b/lib/rules/lint-no-bare-strings.js
index 747bb1a1..93183ac1 100644
--- a/lib/rules/lint-no-bare-strings.js
+++ b/lib/rules/lint-no-bare-strings.js
@@ -132,7 +132,7 @@ function isValidConfigObjectFormat(config) {
 }
 
 function sanitizeConfigArray(whitelist = []) {
-  return whitelist.filter(option => option !== '');
+  return whitelist.filter(option => option !== '').sort((a, b) => b.length - a.length);
 }
 
 module.exports = class LogStaticStrings extends Rule {


Test patch:
diff --git a/test/unit/rules/lint-block-indentation-test.js b/test/unit/rules/lint-block-indentation-test.js
index d14abb3f..81d59d54 100644
--- a/test/unit/rules/lint-block-indentation-test.js
+++ b/test/unit/rules/lint-block-indentation-test.js
@@ -106,7 +106,16 @@ generateRuleTests({
     ].join('\n'),
     ['{{#if foo}}', '  &nbsp;bar', '{{/if}}'].join('\n'),
     '<pre>\nsome text</pre>',
+    '<script>\nsome text</script>',
+    '<template>\nsome text</template>',
+    '<textarea>\nsome text</textarea>',
+    '<textarea> \n<div>\nsome text   \n \n </div></textarea>',
+    '<style>\nsome text</style>',
     '<pre>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </pre>',
+    '<script>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </script>',
+    '<template>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </template>',
+    '<style>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </style>',
+    '<textarea>\n{{#foo}}\n {{#baz}}  hi!\n   {{derp}}{{/baz}}{{/foo}}\n </textarea>',
   ],
 
   bad: [
diff --git a/test/unit/rules/lint-no-bare-strings-test.js b/test/unit/rules/lint-no-bare-strings-test.js
index 473ba00a..4f21e5a7 100644
--- a/test/unit/rules/lint-no-bare-strings-test.js
+++ b/test/unit/rules/lint-no-bare-strings-test.js
@@ -29,6 +29,18 @@ generateRuleTests({
       config: ['/', '"'],
       template: '{{t "foo"}} / "{{name}}"',
     },
+    {
+      config: ['&', '&times;', '4', '3=12'],
+      template: '4 &times; 3=12',
+    },
+    {
+      config: ['&', '&times;', 'Tom', 'Jerry'],
+      template: 'Tom & Jerry',
+    },
+    {
+      config: ['&', '&times;'],
+      template: '& &times;',
+    },
     '{{t "foo"}}',
     '{{t "foo"}}, {{t "bar"}} ({{length}})',
     '(),.&+-=*/#%!?:[]{}',
Repository: ember-template-lint/ember-template-lint
Pull request #920 (2019-11-11 17:31:44)

Ensure `no-bare-strings` consider literals in mustaches (e.g. `{{"foo"}}`)
ref: https://github.com/ember-template-lint/ember-template-lint/issues/914


Patch:
diff --git a/lib/rules/lint-no-bare-strings.js b/lib/rules/lint-no-bare-strings.js
index d6b88bfe..ccc4b665 100644
--- a/lib/rules/lint-no-bare-strings.js
+++ b/lib/rules/lint-no-bare-strings.js
@@ -211,7 +211,11 @@ module.exports = class LogStaticStrings extends Rule {
           this._elementStack.pop();
         },
       },
-
+      MustacheStatement(node) {
+        if (!this._currentAttrNode) {
+          this._checkNodeAndLog(node.path, '', node.loc);
+        }
+      },
       AttrNode: {
         enter(node) {
           this._currentAttrNode = node;
@@ -276,6 +280,17 @@ module.exports = class LogStaticStrings extends Rule {
         let subNode = node.parts[i];
         this._checkNodeAndLog(subNode, additionalDescription, loc);
       }
+    } else if (node.type === 'StringLiteral') {
+      let bareStringText = this._getBareString(node.value);
+
+      if (bareStringText) {
+        this.log({
+          message: `Non-translated string used${additionalDescription}`,
+          line: loc.start.line,
+          column: loc.start.column,
+          source: bareStringText,
+        });
+      }
     }
   }
 };


Test patch:
diff --git a/test/unit/rules/lint-no-bare-strings-test.js b/test/unit/rules/lint-no-bare-strings-test.js
index 7fcf0c94..ca1bb23b 100644
--- a/test/unit/rules/lint-no-bare-strings-test.js
+++ b/test/unit/rules/lint-no-bare-strings-test.js
@@ -9,6 +9,7 @@ generateRuleTests({
 
   good: [
     '{{t "howdy"}}',
+    '<CustomInput @type={{"range"}} />',
     {
       config: [''],
       template: '\n {{translate "greeting"}}',
@@ -109,6 +110,16 @@ generateRuleTests({
   ],
 
   bad: [
+    {
+      template: '<p>{{"Hello!"}}</p>',
+      result: {
+        moduleId: 'layout.hbs',
+        message: 'Non-translated string used',
+        line: 1,
+        column: 3,
+        source: 'Hello!',
+      },
+    },
     {
       template: '\n howdy',
Repository: ember-template-lint/ember-template-lint
Pull request #934 (2019-11-18 16:57:37)

Support parsing a `--fix` flag
EDIT: I've reduced the scope of this PR to the `fix` flag. The next PR will introduce and implement the `verifyAndFix` function: https://github.com/ember-template-lint/ember-template-lint/pull/935

### Related
From this PR, I've extracted these two small PRs that may be reviewed / merged first: [first](https://github.com/ember-template-lint/ember-template-lint/pull/932), [second](https://github.com/ember-template-lint/ember-template-lint/pull/933).

dcyriller: Tests are failing 🙈. Because the tests that implement the failing tests are in the next PR of the serie. I will fix this tomorrow.

Patch:
diff --git a/bin/ember-template-lint.js b/bin/ember-template-lint.js
index 72a9aa27..9d49fde1 100755
--- a/bin/ember-template-lint.js
+++ b/bin/ember-template-lint.js
@@ -103,6 +103,9 @@ function parseArgv(_argv) {
         case '--filename':
           options.named.filename = toProcess.shift();
           break;
+        case '--fix':
+          options.named.fix = true;
+          break;
         case '--quiet':
           options.named.quiet = true;
           break;


Test patch:
diff --git a/test/unit/bin/ember-template-lint-test.js b/test/unit/bin/ember-template-lint-test.js
index a9e2dfde..75918a3d 100644
--- a/test/unit/bin/ember-template-lint-test.js
+++ b/test/unit/bin/ember-template-lint-test.js
@@ -561,6 +561,15 @@ describe('ember-template-lint executable', function() {
       expect(actual).to.deep.equal(expected);
     });
 
+    it('handles --fix', function() {
+      let argv = ['--fix'];
+
+      let actual = BinScript._parseArgv(argv);
+      let expected = { named: { fix: true }, positional: [] };
+
+      expect(actual).to.deep.equal(expected);
+    });
+
     it('handles --quiet', function() {
       let argv = ['--quiet'];
Repository: ember-template-lint/ember-template-lint
Pull request #944 (2019-11-21 23:05:06)

Fix `no-invalid-interactive` to allow `{{on "load"...}}` and `{{on "error"...}}` for `<img>`
ref: https://github.com/ember-template-lint/ember-template-lint/issues/940


Patch:
diff --git a/lib/rules/lint-no-invalid-interactive.js b/lib/rules/lint-no-invalid-interactive.js
index a2a90275..87354a1c 100644
--- a/lib/rules/lint-no-invalid-interactive.js
+++ b/lib/rules/lint-no-invalid-interactive.js
@@ -71,16 +71,19 @@ module.exports = class InvalidInteractive extends Rule {
         let modifierName = node.path.original;
 
         if (modifierName === 'action' || modifierName === 'on') {
-          // Allow {{action "foo" on="submit"}} on form tags
-          if (this._element.tag === 'form' && isSubmitEventBinding(node)) {
-            return;
+          if (this._element.tag === 'img') {
+            if (isOnLoadEventBinding(node) || isOnErrorEventBinding(node)) {
+              return;
+            }
           }
 
           // Allow {{action "foo" on="reset"}} on form tags
-          if (this._element.tag === 'form' && isResetEventBinding(node)) {
-            return;
+          // Allow {{action "foo" on="submit"}} on form tags
+          if (this._element.tag === 'form') {
+            if (isSubmitEventBinding(node) || isResetEventBinding(node)) {
+              return;
+            }
           }
-
           this.log({
             message: 'Interaction added to non-interactive element',
             line: node.loc && node.loc.start.line,
@@ -181,3 +184,11 @@ function isSubmitEventBinding(node) {
 function isResetEventBinding(node) {
   return isEventHandlerFor(node, 'reset');
 }
+
+function isOnErrorEventBinding(node) {
+  return isEventHandlerFor(node, 'error');
+}
+
+function isOnLoadEventBinding(node) {
+  return isEventHandlerFor(node, 'load');
+}


Test patch:
diff --git a/test/unit/rules/lint-no-invalid-interactive-test.js b/test/unit/rules/lint-no-invalid-interactive-test.js
index 4b58e39b..0a4ad70a 100644
--- a/test/unit/rules/lint-no-invalid-interactive-test.js
+++ b/test/unit/rules/lint-no-invalid-interactive-test.js
@@ -39,6 +39,7 @@ generateRuleTests({
       config: { additionalInteractiveTags: ['img'] },
       template: '<img onerror={{action "foo"}}>',
     },
+    '<img {{on "load" this.onLoad}} {{on "error" this.onError}}>',
   ],
 
   bad: [
Repository: arabold/docs-mcp-server
Pull request #33 (2025-04-13 21:58:23)

fix: resolve store path correctly when not in project root
## Description

Fixes an issue where the database store path was not being resolved correctly when the current working directory was not the project root.

### Changes

- Use `import.meta.dirname` for proper path resolution
- Implement store path resolution priority:
  1. Environment variable (`DOCS_MCP_STORE_PATH`)
  2. Legacy path (.store in project root)
  3. Standard system path
- Ensure database directory exists before initialization

### Testing

Verified that the store path is correctly resolved regardless of the current working directory:
- When running from project root
- When running from a subdirectory
- When using environment variable override
- When using legacy path


Patch:
diff --git a/src/store/DocumentManagementService.ts b/src/store/DocumentManagementService.ts
index cbbe25a..0dffd89 100644
--- a/src/store/DocumentManagementService.ts
+++ b/src/store/DocumentManagementService.ts
@@ -41,7 +41,9 @@ export class DocumentManagementService {
       logger.debug(`💾 Using database directory from DOCS_MCP_STORE_PATH: ${dbDir}`);
     } else {
       // 2. Check Old Local Path
-      const oldDbDir = path.join(process.cwd(), ".store");
+      const projectRoot = path.resolve(import.meta.dirname, "..");
+      const oldDbDir = path.join(projectRoot, ".store");
+      console.log("Old DB Directory:", oldDbDir);
       const oldDbPath = path.join(oldDbDir, "documents.db");
       const oldDbExists = existsSync(oldDbPath); // Check file existence specifically
 


Test patch:
diff --git a/src/store/DocumentManagementService.test.ts b/src/store/DocumentManagementService.test.ts
index 0195d82..610fc34 100644
--- a/src/store/DocumentManagementService.test.ts
+++ b/src/store/DocumentManagementService.test.ts
@@ -59,7 +59,8 @@ describe("DocumentManagementService", () => {
   let docService: DocumentManagementService; // For general tests
 
   // Define expected paths consistently
-  const expectedOldDbPath = path.join(process.cwd(), ".store", "documents.db");
+  const projectRoot = path.resolve(import.meta.dirname, "..");
+  const expectedOldDbPath = path.join(projectRoot, ".store", "documents.db");
   const expectedStandardDbPath = path.join(mockEnvPaths.data, "documents.db");
 
   beforeEach(() => {