From e36ce1d6cf1ad96ec3b4f675a6decf956df3dc72 Mon Sep 17 00:00:00 2001 From: Bryan MacFarlane Date: Mon, 30 Mar 2020 10:46:01 -0400 Subject: [PATCH] tabs or spaces --- __tests__/setup-go.test.ts | 22 +++++++++++----------- matchers.json | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index 18e32e0..7efffbc 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -379,7 +379,7 @@ describe('setup-go', () => { expect(annotation.message).toBe('missing return at end of function'); }); - it('matches on unix path with whitespace', async () => { + it('matches on unix path with spaces', async () => { let line = ' ./assert.go:5:2: missing return at end of function '; let annotation = testMatch(line); expect(annotation).toBeDefined(); @@ -389,6 +389,16 @@ describe('setup-go', () => { expect(annotation.message).toBe('missing return at end of function'); }); + it('matches on unix path with tabs', async () => { + let line = '\t./assert.go:5:2: missing return at end of function '; + let annotation = testMatch(line); + expect(annotation).toBeDefined(); + expect(annotation.line).toBe(5); + expect(annotation.column).toBe(2); + expect(annotation.file).toBe('./assert.go'); + expect(annotation.message).toBe('missing return at end of function'); + }); + it('matches on relative windows path', async () => { let line = '.\\main.go:13:2: undefined: fmt.Printl'; let annotation = testMatch(line); @@ -409,16 +419,6 @@ describe('setup-go', () => { expect(annotation.message).toBe('undefined: fmt.Printl'); }); - it('only matches leading dots on unix path', async () => { - let line = 'x./assert.go:5:2: missing return at end of function'; - let annotation = testMatch(line); - expect(annotation).toBeDefined(); - expect(annotation.line).toBe(5); - expect(annotation.column).toBe(2); - expect(annotation.file).toBe('./assert.go'); - expect(annotation.message).toBe('missing return at end of function'); - }); - // 1.13.1 => 1.13.1 // 1.13 => 1.13.0 // 1.10beta1 => 1.10.0-beta1, 1.10rc1 => 1.10.0-rc1 diff --git a/matchers.json b/matchers.json index 3ba2244..675fdb7 100644 --- a/matchers.json +++ b/matchers.json @@ -4,7 +4,7 @@ "owner": "go", "pattern": [ { - "regexp": "(\\.{0,2}[\\/\\\\].+\\.go):(?:(\\d+):(\\d+):)? (.*)", + "regexp": "^\\s*(\\.{0,2}[\\/\\\\].+\\.go):(?:(\\d+):(\\d+):)? (.*)", "file": 1, "line": 2, "column": 3,