PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: brazilian-utils/brutils-python (python)
Issue: Melhorando a função format_cpf
Chama a função is_valid para checar o CPF, se True retorna o número com os símbolos, senão, retorna None. 
Pull request description: Melhorando a função format_cpf 
Closes #88 

Patch:
diff --git a/README.md b/README.md
index aeaa7b2..51a03ab 100644
--- a/README.md
+++ b/README.md
@@ -46,12 +46,12 @@ False
 
 ## format_cpf
 
-Formata o CPF.
+Formata o CPF. Retorna None se o CPF for inválido.
 
 ```python
 >>> from brutils import format_cpf
->>> format_cpf('00011122233')
-'000.111.222-33'
+>>> format_cpf('11144477735')
+'111.444.777-35'
 ```
 
 ## parse_cpf
diff --git a/README_EN.md b/README_EN.md
index 718d631..733d24d 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -46,12 +46,12 @@ False
 
 ## format_cpf
 
-Format CPF.
+Format CPF. Returns None if CPF is invalid.
 
 ```python
 >>> from brutils import format_cpf
->>> format_cpf('00011122233')
-'000.111.222-33'
+>>> format_cpf('11144477735')
+'111.444.777-35'
 ```
 
 ## parse_cpf
diff --git a/brutils/cpf.py b/brutils/cpf.py
index 218a674..74aa83d 100644
--- a/brutils/cpf.py
+++ b/brutils/cpf.py
@@ -39,10 +39,14 @@ def display(cpf):  # type: (str) -> str
 
 def format_cpf(cpf):  # type: (str) -> str
     """
-    Will format an adequately formatted numbers-only CPF string,
-    adding in standard formatting visual aid symbols for display.
+    Format an adequately formatted numbers-only CPF string,
+    Returns a cpf formatted with standard visual aid symbols.
+    Returns None if cpf is invalid.
     """
-    return display(cpf)
+
+    if not is_valid(cpf):
+        return None
+    return "{}.{}.{}-{}".format(cpf[:3], cpf[3:6], cpf[6:9], cpf[9:])
 
 
 # CALCULATORS


Test patch:
diff --git a/tests/test_cpf.py b/tests/test_cpf.py
index 8359055..f1e1550 100644
--- a/tests/test_cpf.py
+++ b/tests/test_cpf.py
@@ -2,6 +2,7 @@ from os import pardir
 from os.path import abspath, join, dirname
 from sys import path, version_info, dont_write_bytecode
 from inspect import getsourcefile
+from unittest.mock import patch
 
 dont_write_bytecode = True
 range = range if version_info.major >= 3 else xrange
@@ -46,10 +47,16 @@ class CPF(TestCase):
         assert display("000000000000") is None
 
     def test_format_cpf(self):
-        assert format_cpf("00000000011") == "000.000.000-11"
-        assert format_cpf("00000000000") is None
-        assert format_cpf("0000000000a") is None
-        assert format_cpf("000000000000") is None
+        with patch("brutils.cpf.is_valid", return_value=True) as mock_is_valid:
+            # When cpf is_valid, returns formatted cpf
+            assert format_cpf("11144477735") == "111.444.777-35"
+
+        # Checks if function is_valid_cpf is called
+        mock_is_valid.assert_called_once_with("11144477735")
+
+        with patch("brutils.cpf.is_valid", return_value=False) as mock_is_valid:
+            # When cpf isn't valid, returns None
+            assert format_cpf("11144477735") is None
 
     def test_hashdigit(self):
         assert hashdigit("000000000", 10) == 0
Repository: ota-meshi/eslint-plugin-regexp (ts)
Issue: `no-invisible-character`: false positive on space in `RegExp` constructor
```js
RegExp(' ') // => Unexpected invisible character. Use ' ' instead  regexp/no-invisible-character
```
Pull request description: Fix false positives for space in RegExp constructor in `regexp/no-invisible-character` rule
close #243

Patch:
diff --git a/lib/rules/no-invisible-character.ts b/lib/rules/no-invisible-character.ts
index 7f427b8..430c37b 100644
--- a/lib/rules/no-invisible-character.ts
+++ b/lib/rules/no-invisible-character.ts
@@ -68,6 +68,9 @@ export default createRule("no-invisible-character", {
 
             let index = 0
             for (const c of text) {
+                if (c === " ") {
+                    continue
+                }
                 const cp = c.codePointAt(0)!
                 if (isInvisible(cp)) {
                     const instead = toCharSetSource(cp, flags)


Test patch:
diff --git a/tests/lib/rules/no-invisible-character.ts b/tests/lib/rules/no-invisible-character.ts
index 5b625c3..161f8ec 100644
--- a/tests/lib/rules/no-invisible-character.ts
+++ b/tests/lib/rules/no-invisible-character.ts
@@ -19,6 +19,9 @@ tester.run("no-invisible-character", rule as any, {
         `
         const a = '' + '\t';
         new RegExp(a)`,
+        "new RegExp(' ')",
+        "new RegExp('a')",
+        "new RegExp('[ ]')",
     ],
     invalid: [
         {
Repository: phpbench/phpbench (php)
Issue: `percent_diff()` expression formatting
It would be nice if the `percent_diff()` would also add thousand separators like everything else does, because `13026.5%` is hard to read.
Pull request description: Fix formatting of number with zero decimal precision
Fixes #1008

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a46f73c6..dc67653f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ master
 
 Improvements:
 
-- Remove dependency on `webmozaty/path` (copied the class into PHPBench)
+- Remove dependency on `webmozart/path` (copied the class into PHPBench)
 - Update PHPStan to 1.0 and fix new errors #1006
 - Use `webmozart/glob` instead of `glob` for benchmark paths and config
   include paths #1005
@@ -14,6 +14,7 @@ Improvements:
 Bug fixes:
 
 - Fix bad exception call #1002 @TRowbotham
+- Fix comma formatting of numbers with no zero decimal precision #1008
 
 1.2.6
 -----
diff --git a/lib/Util/NumberFormat.php b/lib/Util/NumberFormat.php
index ed8c0e9e..ea4b6bd5 100644
--- a/lib/Util/NumberFormat.php
+++ b/lib/Util/NumberFormat.php
@@ -18,7 +18,7 @@ class NumberFormat
             $formated = rtrim($formated, '0');
 
             if (substr($formated, -1) === '.') {
-                return (string)$number;
+                return (string)number_format($number);
             }
         }
 


Test patch:
diff --git a/tests/Unit/Util/NumberFormatTest.php b/tests/Unit/Util/NumberFormatTest.php
index 1f70dde1..c93e0342 100644
--- a/tests/Unit/Util/NumberFormatTest.php
+++ b/tests/Unit/Util/NumberFormatTest.php
@@ -44,5 +44,7 @@ class NumberFormatTest extends TestCase
         yield [10.12, 3, false, '10.120'];
 
         yield [10.000, 3, false, '10.000'];
+
+        yield [1000, 3, true, '1,000'];
     }
 }