nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: bxcodec/faker
Pull request #11 (2017-10-27 07:53:55)

Fixing Package Deps

codecov[bot]: # [Codecov](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=h1) Report
> Merging [#11](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=desc) into [master](https://codecov.io/gh/bxcodec/faker/commit/34279ecfa8aa282b3967012a8c4181e3f447de4d?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/bxcodec/faker/pull/11/graphs/tree.svg?src=pr&token=cLPGB7MHVc&width=650&height=150)](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master    #11   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         289    289           
=====================================
  Hits          289    289
```


| [Impacted Files](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [phone.go](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=tree#diff-cGhvbmUuZ28=) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=footer). Last update [34279ec...87d04fc](https://codecov.io/gh/bxcodec/faker/pull/11?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/phone.go b/phone.go
index 5acfd95..8c7fb5c 100644
--- a/phone.go
+++ b/phone.go
@@ -2,9 +2,10 @@ package faker
 
 import (
 	"fmt"
-	"github.com/agoalofalife/faker/support/slice"
 	"math/rand"
 	"strings"
+
+	"github.com/bxcodec/faker/support/slice"
 )
 
 var phone Phoner
@@ -36,8 +37,8 @@ type Phone struct{}
 // 201-886-0269
 func (p Phone) PhoneNumber() string {
 	randInt, _ := RandomInt(1, 10)
-	str:= strings.Join(slice.SliceIntToString(randInt), "")
-	return fmt.Sprintf("%s-%s-%s", str[:3],str[3:6], str[6:10])
+	str := strings.Join(slice.SliceIntToString(randInt), "")
+	return fmt.Sprintf("%s-%s-%s", str[:3], str[3:6], str[6:10])
 }
 
 // example : (888) 937-7238


Test patch:
diff --git a/phone_test.go b/phone_test.go
index 80010d6..f650630 100644
--- a/phone_test.go
+++ b/phone_test.go
@@ -27,6 +27,6 @@ func TestE164PhoneNumber(t *testing.T) {
 	}
 }
 
-func TestSetPhoner(t *testing.T)  {
+func TestSetPhoner(t *testing.T) {
 	SetPhoner(Phone{})
 }
Repository: bxcodec/faker
Pull request #33 (2018-08-22 18:23:12)

Add extending faker by custom providers
Hello. This pull request added ability to add new tag in faker with custom providers. Existing tag cannot be rewritten


Patch:
diff --git a/faker.go b/faker.go
index 329305c..5b33236 100644
--- a/faker.go
+++ b/faker.go
@@ -109,6 +109,9 @@ var ErrValueNotPtr = "Not a pointer value"
 // Error when tag not supported
 var ErrTagNotSupported = "Tag unsupported"
 
+// ErrTagAlreadyExists - error when tag exists and call AddProvider
+var ErrTagAlreadyExists = "Tag exists"
+
 // Error when passed more arguments
 var ErrMoreArguments = "Passed more arguments than is possible : (%d)"
 
@@ -143,6 +146,17 @@ func FakeData(a interface{}) error {
 	return nil
 }
 
+// AddProvider extend faker with tag to generate fake data with specified custom algoritm
+func AddProvider(tag string, provider interface{}) error {
+	if _, ok := mapperTag[tag]; ok {
+		return errors.New(ErrTagAlreadyExists)
+	}
+
+	mapperTag[tag] = provider
+
+	return nil
+}
+
 func getValue(t reflect.Type) (reflect.Value, error) {
 	k := t.Kind()
 


Test patch:
diff --git a/faker_test.go b/faker_test.go
index 42a636b..5a6f796 100644
--- a/faker_test.go
+++ b/faker_test.go
@@ -388,5 +388,40 @@ func TestSkipField(t *testing.T) {
 	if a.ShouldBeSkipped != 0 {
 		t.Error("Expected that field will be skipped")
 	}
+}
+
+func TestExtend(t *testing.T) {
+	// This test is to ensure that faker can be extended new providers
+
+	a := struct {
+		ID string `faker:"test"`
+	}{}
+
+	err := AddProvider("test", func() string {
+		return "test"
+	})
+
+	if err != nil {
+		t.Error("Expected Not Error, But Got: ", err)
+	}
+
+	err = FakeData(&a)
 
+	if err != nil {
+		t.Error("Expected Not Error, But Got: ", err)
+	}
+
+	if a.ID != "test" {
+		t.Error("ID should be equal test value")
+	}
+}
+
+func TestTagAlreadyExists(t *testing.T) {
+	// This test is to ensure that existing tag cannot be rewritten
+
+	err := AddProvider(Email, func() {})
+
+	if err == nil || err.Error() != ErrTagAlreadyExists {
+		t.Error("Expected ErrTagAlreadyExists Error,  But Got: ", err)
+	}
 }
Repository: echobind/bisonapp
Pull request #286 (2022-11-03 18:28:51)

chore: use yarn install --immutable instead of --frozen-lockfile.
## Changes

- `--frozen-lockfile` is deprecated. It will be removed in a future release. c.f. https://yarnpkg.com/cli/install.
- Rename `main.js.yml.ejs` to `main.yml.ejs` (why does it need `.js` in the filename?)


## Checklist

- [ ] Requires dependency update?
- [ ] Generating a new app works



Patch:
diff --git a/packages/create-bison-app/template/.github/workflows/main.js.yml.ejs b/packages/create-bison-app/template/.github/workflows/main.yml.ejs
similarity index 98%
rename from packages/create-bison-app/template/.github/workflows/main.js.yml.ejs
rename to packages/create-bison-app/template/.github/workflows/main.yml.ejs
index c0fbf40..90da9fb 100644
--- a/packages/create-bison-app/template/.github/workflows/main.js.yml.ejs
+++ b/packages/create-bison-app/template/.github/workflows/main.yml.ejs
@@ -41,7 +41,7 @@ jobs:
       # Yarn install
       - name: Install packages
         run: |
-          yarn install --frozen-lockfile
+          yarn install --immutable
 
       # Setup & configure database
       - name: Setup test database
diff --git a/packages/create-bison-app/template/README.md.ejs b/packages/create-bison-app/template/README.md.ejs
index c5bc649..b56e494 100644
--- a/packages/create-bison-app/template/README.md.ejs
+++ b/packages/create-bison-app/template/README.md.ejs
@@ -1,6 +1,6 @@
 <p align="center" style="text-align:center">
   <h1><%= name %></h1>
-  <p><img alt="CI STATUS" src="https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/main.js.yml/badge.svg"/></p>
+  <p><img alt="CI STATUS" src="https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/main.yml/badge.svg"/></p>
 </p>
 
 # Getting Started Tutorial


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index b15d827..39b886e 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -86,7 +86,7 @@ jobs:
           node-version: ${{ matrix.node-version }}
 
       - name: Install bison app packages
-        run: yarn install
+        run: yarn install --immutable
 
       - name: Build production bison app
         run: yarn build
diff --git a/packages/create-bison-app/test/tasks/copyFiles.test.js b/packages/create-bison-app/test/tasks/copyFiles.test.js
index 7780b6c..1992e9c 100644
--- a/packages/create-bison-app/test/tasks/copyFiles.test.js
+++ b/packages/create-bison-app/test/tasks/copyFiles.test.js
@@ -64,7 +64,7 @@ describe("copyFiles", () => {
     });
 
     it("copies and renames .github", async () => {
-      const files = ["workflows/main.js.yml", "PULL_REQUEST_TEMPLATE.md"];
+      const files = ["workflows/main.yml", "PULL_REQUEST_TEMPLATE.md"];
 
       files.forEach((file) => {
         const filePath = path.join(targetFolder, ".github", file);
Repository: chanind/hanzi-writer
Pull request #65 (2018-02-25 13:06:34)

fixing character highlight bug on second quiz
This PR fixes a bug where the whole character becomes highlighted when the users restarts a quiz after first finishing a quiz successfully. The stroke highlight opacities were not being reset properly before.


Patch:
diff --git a/src/quizActions.js b/src/quizActions.js
index a50d47db..3b2814da 100644
--- a/src/quizActions.js
+++ b/src/quizActions.js
@@ -5,9 +5,13 @@ const { objRepeat } = require('./utils');
 const startQuiz = (character, fadeDuration) => {
   return characterActions.hideCharacter('main', character, fadeDuration)
     .concat([
+      new Mutation('character.highlight', {
+        opacity: 1,
+        strokes: objRepeat({ opacity: 0, force: true }, character.strokes.length),
+      }),
       new Mutation('character.main', {
         opacity: 1,
-        strokes: objRepeat({ opacity: 0 }, character.strokes.length),
+        strokes: objRepeat({ opacity: 0, force: true }, character.strokes.length),
       }),
     ]);
 };


Test patch:
diff --git a/src/__tests__/Quiz-test.js b/src/__tests__/Quiz-test.js
index 2a1f2f03..f9de5211 100644
--- a/src/__tests__/Quiz-test.js
+++ b/src/__tests__/Quiz-test.js
@@ -85,6 +85,31 @@ describe('Quiz', () => {
         expect(renderState.state.character.main.strokes[strokeNum].opacity).toBe(0);
       });
     });
+
+    it('sets all highlight stroke opacities to 0', async () => {
+      const renderState = createRenderState();
+      renderState.updateState({
+        character: {
+          highlight: {
+            opacity: 0,
+            strokes: {
+              0: { opacity: 1 },
+              1: { opacity: 1 },
+            },
+          },
+        },
+      });
+
+      const quiz = new Quiz(char, renderState, new Positioner());
+      quiz.startQuiz(Object.assign({}, opts));
+      clock.tick(1000);
+      await resolvePromises();
+
+      expect(renderState.state.character.highlight.opacity).toBe(1);
+      Object.keys(renderState.state.character.main.strokes).forEach(strokeNum => {
+        expect(renderState.state.character.highlight.strokes[strokeNum].opacity).toBe(0);
+      });
+    });
   });
 
   describe('startUserStroke', () => {