Repository: codecov/uploader
Pull request #872 (2022-09-01 19:04:28)

fix: use proper end for fixes

codecov[bot]: # [Codecov](https://app.codecov.io/gh/codecov/uploader/compare/872?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) Report
> Merging [#872](https://app.codecov.io/gh/codecov/uploader/compare/872?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) (9762b7e) into [main](https://codecov.io/gh/codecov/uploader/commit/a1ecb776c96a2a5786e812fa7d7ffdd8473246dc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) (a1ecb77) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.

```diff
@@           Coverage Diff           @@
##             main     #872   +/-   ##
=======================================
  Coverage   92.13%   92.14%           
=======================================
  Files          35       35           
  Lines        1221     1222    +1     
  Branches      249      249           
=======================================
+ Hits         1125     1126    +1     
  Misses         64       64           
  Partials       32       32           
```

| Flag | Coverage Δ | |
|---|---|---|
| alpine | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| alpine-proxy | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| alpine-without-git | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| linux | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| linux-without-git | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| macos | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| macos-without-git | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| windows | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |
| windows-without-git | `92.14% <100.00%> (+<0.01%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://app.codecov.io/gh/codecov/uploader/compare/872?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | |
|---|---|---|
| [src/helpers/fixes.ts](https://app.codecov.io/gh/codecov/uploader/compare/872/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2hlbHBlcnMvZml4ZXMudHM=) | `100.00% <100.00%> (ø)` | |
| [src/index.ts](https://app.codecov.io/gh/codecov/uploader/compare/872/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2luZGV4LnRz) | `75.60% <100.00%> (ø)` | |


Patch:
diff --git a/src/helpers/fixes.ts b/src/helpers/fixes.ts
index 6f031d6..2124465 100644
--- a/src/helpers/fixes.ts
+++ b/src/helpers/fixes.ts
@@ -62,6 +62,7 @@ async function getMatchedLines(file: string, matchers: RegExp[]): Promise<string
     for (const matcher of matchers) {
       if (line.match(matcher)) {
         matchedLines.push(lineNumber.toString())
+        break
       }
     }
     lineNumber++
diff --git a/src/index.ts b/src/index.ts
index 3c721d9..175c22c 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -329,7 +329,7 @@ export async function main(
     const fixes = await generateFixes(projectRoot)
     uploadFileChunks.push(Buffer.from(FIXES_HEADER))
     uploadFileChunks.push(Buffer.from(fixes))
-    uploadFileChunks.push(Buffer.from(MARKER_ENV_END))
+    uploadFileChunks.push(Buffer.from(MARKER_FILE_END))
     info('Finished generating file fixes')
   }
 


Test patch:
diff --git a/test/index.test.ts b/test/index.test.ts
index fb965a7..ea701a0 100644
--- a/test/index.test.ts
+++ b/test/index.test.ts
@@ -522,7 +522,7 @@ describe('Uploader Core', () => {
       upstream: ''
     })
     expect(console.log).toHaveBeenCalledWith(
-      expect.stringMatching(/# path=fixes\ntest\/fixtures\/fixes\/example.php:4,6,11,15,19,20\ntest\/fixtures\/gcov\/main.c:2,4,11,12,13,14,16,20/)
+      expect.stringMatching(/# path=fixes\ntest\/fixtures\/fixes\/example.php:4,6,11,15,19,20\ntest\/fixtures\/gcov\/main.c:2,4,11,12,13,14,16,20\n<<<<<< EOF/)
     )
   })
 })