nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: postcss/postcss
Pull request #572 (2015-09-21 13:46:36)

parse nested at-rules without trailing semicolon
Code changes from postcss/postcss-scss#8. Fixes postcss/postcss-scss#7


Patch:
diff --git a/lib/parser.es6 b/lib/parser.es6
index 63c0152e..1fe747dd 100644
--- a/lib/parser.es6
+++ b/lib/parser.es6
@@ -275,6 +275,9 @@ export default class Parser {
             } else if ( token[0] === '{' ) {
                 open = true;
                 break;
+            } else if ( token[0] === '}') {
+                this.end(token);
+                break;
             } else {
                 params.push(token);
             }


Test patch:
diff --git a/test/parse.es6 b/test/parse.es6
index 98d502a6..0c5c022c 100644
--- a/test/parse.es6
+++ b/test/parse.es6
@@ -63,6 +63,12 @@ describe('postcss.parse()', () => {
         expect(root.first.first.value).to.eql('())');
     });
 
+    it('parses nested at-rules without trailing semicolon', () => {
+        let root = parse('a { @import "a.css" }');
+        expect(root.first.first.name).to.eql('import');
+        expect(root.first.first.params).to.eql('"a.css"');
+    });
+
     describe('errors', () => {
 
         it('throws on unclosed blocks', () => {
Repository: postcss/postcss
Pull request #636 (2015-11-13 13:10:01)

Allow passing a previous map with no mappings (empty string)
Also, stop passing mappings:[] in tests -- that was source map rev. 2 syntax, and the source-map package doesn't support those.

TrySound: @papandreou Fix tests

Patch:
diff --git a/lib/previous-map.es6 b/lib/previous-map.es6
index c5118b95..9eeca8c2 100644
--- a/lib/previous-map.es6
+++ b/lib/previous-map.es6
@@ -92,6 +92,7 @@ export default class PreviousMap {
 
     isMap(map) {
         if ( typeof map !== 'object' ) return false;
-        return map.mappings || map._mappings;
+        return typeof map.mappings === 'string' ||
+            typeof map._mappings === 'string';
     }
 }


Test patch:
diff --git a/test/previous-map.es6 b/test/previous-map.es6
index 81c606c2..1aeaaa0c 100644
--- a/test/previous-map.es6
+++ b/test/previous-map.es6
@@ -11,7 +11,7 @@ let mapObj = {
     file:     null,
     sources:  [],
     names:    [],
-    mappings: []
+    mappings: ''
 };
 let map = JSON.stringify(mapObj);
 
@@ -50,7 +50,7 @@ describe('PreviousMap', () => {
             file:     'b',
             sources:  ['a'],
             names:    [],
-            mappings: []
+            mappings: ''
         };
 
         let opts = { map: { prev: map2 } };
@@ -118,7 +118,7 @@ describe('PreviousMap', () => {
             version:  3,
             sources:  ['a'],
             names:    [],
-            mappings: []
+            mappings: ''
         };
 
         let opts = { map: { prev: map2 } };
@@ -129,4 +129,13 @@ describe('PreviousMap', () => {
         expect(file1).to.not.eql(file2);
     });
 
+    it('should accept an empty mappings string', () => {
+        let emptyMap = {
+            version:  3,
+            sources:  [],
+            names:    [],
+            mappings: ''
+        };
+        parse('body{}', { map: { prev: emptyMap } } );
+    });
 });
Repository: postcss/postcss
Pull request #671 (2015-12-12 15:54:02)

Fix warning toString method with specified index

ai: Nice fix. But also we need to support `word` option too. I will make it tomorrow.
TrySound: @ai Maybe just pass this as an options?

Patch:
diff --git a/lib/warning.es6 b/lib/warning.es6
index 8826124d..c792173f 100644
--- a/lib/warning.es6
+++ b/lib/warning.es6
@@ -16,7 +16,11 @@ export default class Warning {
 
     toString() {
         if ( this.node ) {
-            return this.node.error(this.text, { plugin: this.plugin }).message;
+            return this.node.error(this.text, {
+                plugin: this.plugin,
+                index:  this.index,
+                word:   this.word
+            }).message;
         } else if ( this.plugin ) {
             return this.plugin + ': ' + this.text;
         } else {


Test patch:
diff --git a/test/warning.es6 b/test/warning.es6
index 5c7bc6ff..f43644d6 100644
--- a/test/warning.es6
+++ b/test/warning.es6
@@ -35,6 +35,28 @@ describe('Warning', () => {
             expect(warning.toString()).to.eql(`plugin: ${ file }:1:1: text`);
         });
 
+        it('outputs warning with index', () => {
+            let file    = path.resolve('a.css');
+            let root    = parse('@rule param {}', { from: file });
+            let warning = new Warning('text', {
+                plugin: 'plugin',
+                node:   root.first,
+                index:  7
+            });
+            expect(warning.toString()).to.eql(`plugin: ${ file }:1:8: text`);
+        });
+
+        it('outputs warning with word', () => {
+            let file    = path.resolve('a.css');
+            let root    = parse('@rule param {}', { from: file });
+            let warning = new Warning('text', {
+                plugin: 'plugin',
+                node:   root.first,
+                word:   'am'
+            });
+            expect(warning.toString()).to.eql(`plugin: ${ file }:1:10: text`);
+        });
+
         it('generates warning without source', () => {
             let decl    = new Declaration({ prop: 'color', value: 'black' });
             let warning = new Warning('text', { node: decl });
Repository: postcss/postcss
Pull request #743 (2016-02-22 14:34:48)

Allow options passing to Result#warn from Node#warn.
Perhaps just an oversight from when I first implemented this method.

This change makes it easier to implement this feature - https://github.com/ben-eb/stylehacks/issues/4.


Patch:
diff --git a/docs/api.md b/docs/api.md
index cecc6610..36806b91 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -1099,7 +1099,7 @@ Arguments:
   * `index` (number): an index inside a node’s string that should be highlighted
     as the source of the error.
 
-### `node.warn(result, message)`
+### `node.warn(result, text, opts)`
 
 This method is provided as a convenience wrapper for [`Result#warn()`].
 
@@ -1116,7 +1116,17 @@ var plugin = postcss.plugin('postcss-deprecated', function () {
 Arguments:
 
 * `result`: The [`Result`] instance that will receive the warning.
-* `message (string)`: error description.
+* `text (string)`: warning message. It will be used in the `text` property of
+  the message object.
+* `opts (object) optional`: properties to assign to the message object.
+  * `word (string)`: word inside a node’s string that should be highlighted
+    as the source of the warning.
+  * `index` (number): index inside a node’s string that should be highlighted
+    as the source of the warning.
+  * `plugin`: name of the plugin that created this warning. `Result#warn()` will
+    automatically fill it with the `plugin.postcssPlugin` value.
+
+Note that `opts.node` is automatically passed to [`Result#warn()`] for you.
 
 ### `node.next()` and `node.prev()`
 
diff --git a/lib/node.es6 b/lib/node.es6
index 05611243..71bb19d0 100644
--- a/lib/node.es6
+++ b/lib/node.es6
@@ -46,8 +46,8 @@ export default class Node {
         }
     }
 
-    warn(result, message) {
-        return result.warn(message, { node: this });
+    warn(result, text, opts) {
+        return result.warn(text, { node: this, ...opts });
     }
 
     remove() {


Test patch:
diff --git a/test/node.es6 b/test/node.es6
index 1668e20b..163163e4 100644
--- a/test/node.es6
+++ b/test/node.es6
@@ -68,6 +68,19 @@ describe('Node', () => {
             expect(result.warnings()[0].text).to.eql('FIRST!');
             expect(result.warnings()[0].plugin).to.eql('warner');
         });
+
+        it('accepts options', () => {
+            let warner = postcss.plugin('warner', () => {
+                return (css, result) => {
+                    css.first.warn(result, 'FIRST!', { index: 1 });
+                };
+            });
+
+            let result = postcss([ warner() ]).process('a{}');
+            expect(result.warnings().length).to.eql(1);
+            expect(result.warnings()[0].index).to.eql(1);
+        });
+
     });
 
     describe('remove()', () => {
Repository: postcss/postcss
Pull request #798 (2016-05-01 00:07:09)

Reverse token adding in spacesFromEnd
I ran into a strange bug while trying to fix this: https://github.com/stylelint/stylelint/issues/1148

Turns out the rule's `raws.between` seemed to have its tokens reversed. From the source code 

```css
a /*x*/
{}
```` 

I'd expect the rule's `raws.between` to be `" /*x*/\n"`. But instead I was getting `"\n/*x*/ "`.

I was able to reproduce this with a test in PostCSS. And I found what I think may have been a logic flaw in the `spacesFromEnd` function that is used to create `raws.between`. I adjusted that logic to get my test to pass, and all existing tests continue to pass. (The build failure seems to be related to code coverage reporting.)


Patch:
diff --git a/lib/parser.es6 b/lib/parser.es6
index 8919df36..90fe9c68 100644
--- a/lib/parser.es6
+++ b/lib/parser.es6
@@ -365,12 +365,13 @@ export default class Parser {
     }
 
     spacesFromEnd(tokens) {
-        let next;
+        let lastTokenType;
         let spaces = '';
         while ( tokens.length ) {
-            next = tokens[tokens.length - 1][0];
-            if ( next !== 'space' && next !== 'comment' ) break;
-            spaces += tokens.pop()[1];
+            lastTokenType = tokens[tokens.length - 1][0];
+            if ( lastTokenType !== 'space' &&
+                lastTokenType !== 'comment' ) break;
+            spaces = tokens.pop()[1] + spaces;
         }
         return spaces;
     }


Test patch:
diff --git a/test/rule.es6 b/test/rule.es6
index 9ddf7343..c250252e 100644
--- a/test/rule.es6
+++ b/test/rule.es6
@@ -43,6 +43,11 @@ describe('Rule', () => {
             expect(rule.selector).to.eql('em,\nstrong');
         });
 
+        it('saves raw string between selector and block', () => {
+            let root = parse('a /*x*/\n{}');
+            expect(root.first.raw('between')).to.eql(' /*x*/\n');
+        });
+
         it('uses between to detect separator', () => {
             let rule = new Rule({ selector: 'b', raws: { between: '' } });
             rule.selectors = ['b', 'strong'];
Repository: sid88in/serverless-appsync-plugin
Pull request #599 (2023-05-05 14:47:51)

fix: make oidc clientId optional
[Documentation](https://github.com/sid88in/serverless-appsync-plugin/blob/master/doc/authentication.md#oidc) states that `clientId` is optional for OIDC, however, the validation in place makes it required. This PR fixes this by making `clientId` optional.

mogusbi-motech: @bboure @sid88in is there anything else that needs doing to get this reviewed and merged? This is currently blocking me from upgrading my apps to v2
bboure: Thank you @mogusbi-motech 
Sorry I missed your PR

This LGTM

thanks! 🎉 

Patch:
diff --git a/src/validation.ts b/src/validation.ts
index abbf8fb..6c10beb 100644
--- a/src/validation.ts
+++ b/src/validation.ts
@@ -133,7 +133,7 @@ export const appSyncSchema = {
         iatTTL: { type: 'number' },
         authTTL: { type: 'number' },
       },
-      required: ['issuer', 'clientId'],
+      required: ['issuer'],
     },
     iamAuth: {
       type: 'object',


Test patch:
diff --git a/src/__tests__/validation/__snapshots__/auth.test.ts.snap b/src/__tests__/validation/__snapshots__/auth.test.ts.snap
index 5912f9c..520b0ea 100644
--- a/src/__tests__/validation/__snapshots__/auth.test.ts.snap
+++ b/src/__tests__/validation/__snapshots__/auth.test.ts.snap
@@ -32,10 +32,7 @@ exports[`Valdiation Invalid should validate a Lambda with invalid functionName a
 
 exports[`Valdiation Invalid should validate a Lambda with missing config 1`] = `"/authentication: must have required property 'config'"`;
 
-exports[`Valdiation Invalid should validate a OIDC with empty config 1`] = `
-"/authentication/config: must have required property 'issuer'
-/authentication/config: must have required property 'clientId'"
-`;
+exports[`Valdiation Invalid should validate a OIDC with empty config 1`] = `"/authentication/config: must have required property 'issuer'"`;
 
 exports[`Valdiation Invalid should validate a OIDC with invalid config 1`] = `
 "/authentication/config/issuer: must be string
diff --git a/src/__tests__/validation/auth.test.ts b/src/__tests__/validation/auth.test.ts
index 1360951..6cc4cdf 100644
--- a/src/__tests__/validation/auth.test.ts
+++ b/src/__tests__/validation/auth.test.ts
@@ -61,6 +61,20 @@ describe('Valdiation', () => {
           },
         } as AppSyncConfigInput,
       },
+      {
+        name: 'OIDC without a clientId',
+        config: {
+          ...basicConfig,
+          authentication: {
+            type: 'OPENID_CONNECT',
+            config: {
+              issuer: 'https://auth.example.com',
+              iatTTL: 3600,
+              authTTL: 3600,
+            },
+          },
+        } as AppSyncConfigInput,
+      },
       {
         name: 'IAM',
         config: {
Repository: software-mansion/TypeGPU
Pull request #1461 (2025-07-07 10:27:55)

fix: Prevent autocasting lhs of assignment expressions
This needs to get merged before 0.6.0 as it's a pretty bad bug

<img width="779" alt="Screenshot 2025-07-07 at 12 26 56" src="https://github.com/user-attachments/assets/3295c205-01c2-4312-8d6a-b1ade60450ee" />


reczkok: Don't ask me about the 5 commits - sensitive topic (my formatter wouldn't allow me not to remove the spaces and the new review experience does not allow batch suggestion merges)

Patch:
diff --git a/packages/typegpu/src/tgsl/wgslGenerator.ts b/packages/typegpu/src/tgsl/wgslGenerator.ts
index 558c89a7..4608252c 100644
--- a/packages/typegpu/src/tgsl/wgslGenerator.ts
+++ b/packages/typegpu/src/tgsl/wgslGenerator.ts
@@ -139,7 +139,15 @@ export function generateExpression(
     const lhsExpr = generateExpression(ctx, lhs);
     const rhsExpr = generateExpression(ctx, rhs);
 
-    const converted = convertToCommonType(ctx, [lhsExpr, rhsExpr]) as
+    const forcedType = expression[0] === NODE.assignmentExpr
+      ? [lhsExpr.dataType as AnyData]
+      : [];
+
+    const converted = convertToCommonType(
+      ctx,
+      [lhsExpr, rhsExpr],
+      forcedType,
+    ) as
       | [Snippet, Snippet]
       | undefined;
     const [convLhs, convRhs] = converted || [lhsExpr, rhsExpr];


Test patch:
diff --git a/packages/typegpu/tests/tgsl/wgslGenerator.test.ts b/packages/typegpu/tests/tgsl/wgslGenerator.test.ts
index d8626bcb..62c8799a 100644
--- a/packages/typegpu/tests/tgsl/wgslGenerator.test.ts
+++ b/packages/typegpu/tests/tgsl/wgslGenerator.test.ts
@@ -542,6 +542,26 @@ describe('wgslGenerator', () => {
     );
   });
 
+  it('does not autocast lhs of an assignment', () => {
+    const testFn = tgpu.fn([], d.u32)(() => {
+      let a = d.u32(12);
+      const b = d.f32(2.5);
+      a = b;
+
+      return a;
+    });
+
+    expect(parseResolved({ testFn })).toBe(
+      parse(`
+      fn testFn() -> u32 {
+        var a = u32(12);
+        var b = f32(2.5);
+        a = u32(b);
+        return a;
+      }`),
+    );
+  });
+
   it('generates correct code for array expressions with struct elements', () => {
     const TestStruct = d.struct({
       x: d.u32,