From 6ecb7a315536f470f35e66b48319d069c5cae01a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2019 15:15:51 -0700 Subject: [PATCH 01/30] chore(deps): update golang.org/x/tools commit hash to 43c5e4c (#204) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a069d28..ea9456c 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 // indirect - golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060 + golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 ) diff --git a/go.sum b/go.sum index 9519d8b..55e4c44 100644 --- a/go.sum +++ b/go.sum @@ -150,3 +150,5 @@ golang.org/x/tools v0.0.0-20190731224408-1e85ed8060aa h1:crSxYKs/4ckOznRS/ORDRJi golang.org/x/tools v0.0.0-20190731224408-1e85ed8060aa/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060 h1:ixdNsWPlaysKGPShUO+OF5eF/dSQOGTB86mRds+STrY= golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 h1:KjL1/OdjgZDxA88tw0sTsLRhErqk6G8l5JmoZSrEZvY= +golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= From 3f1f88837df7a6b6013bb6fc036beeda3c759017 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2019 15:23:01 -0700 Subject: [PATCH 02/30] chore(deps): update golang.org/x/tools commit hash to 1d17272 (#205) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ea9456c..b01d80c 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 // indirect - golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 + golang.org/x/tools v0.0.0-20190802221608-1d1727260058 ) diff --git a/go.sum b/go.sum index 55e4c44..5a4faa8 100644 --- a/go.sum +++ b/go.sum @@ -152,3 +152,5 @@ golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060 h1:ixdNsWPlaysKGPShUO+OF5e golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 h1:KjL1/OdjgZDxA88tw0sTsLRhErqk6G8l5JmoZSrEZvY= golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190802221608-1d1727260058 h1:1rd4qUHYwgnGfHkj0tTCdwukGPP6YfNkvXfG15qMmlc= +golang.org/x/tools v0.0.0-20190802221608-1d1727260058/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= From b47d9fcb1c54177334fb27caa34577ad123a8958 Mon Sep 17 00:00:00 2001 From: Minko Gechev Date: Fri, 2 Aug 2019 19:36:37 -0700 Subject: [PATCH 03/30] Update deploy script (#195) * Update deploy script * Try to deploy --- .docs-deploy-key.pem.enc | Bin 0 -> 1712 bytes .travis.yml | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .docs-deploy-key.pem.enc diff --git a/.docs-deploy-key.pem.enc b/.docs-deploy-key.pem.enc new file mode 100644 index 0000000000000000000000000000000000000000..17ff416139ad1ccebf47896f79cf13077fa5c8dd GIT binary patch literal 1712 zcmV;h22c5pJOQ(zMES~=j6|XIrQo7Xp!iOQ*Z2(7a6vhV{G-A%t(W_lT}S$%fQ0b4 zmoGDcWG_BbYk(A`*9?M>J*W?GX$)as_$CwC6S`iCamD>aQF-)e5OyLF|M)3+3cM|E zxWGByQDXENQp7N6dRm8@DKuXM{tJ(S4{@NL?Kxd zh$_dqp)eR))h7>-;XT2#@2tU$Zy#CcF=cOU>Yjh6!~pDZf2XCDEVhIja=Nj=CKz%qxN=`@?Q;U5&#f6P%5Dw%E?78?On;nxq(&%sZT zV@@55f`>NxkH1@Br<7XeJ}vgrzqQ2QkK=RpmJ8qZ?CERzlHlY7?qT5G+aQG-P`Tsi zbdA7x3_tTMO?R8#tQw(QN4s&_T`e4ihDWe97Uo|pd6tX!&WBIBN^UnpUwzyM22R@f zhnilmxGLbIK^a>z(miI|aLmG|ERuU?htNgp;d$t}-tH|s5FH(kpY7g5R3tA&RhM@3 zrX5GV!E9NE7H2ooZE(t@zFiDV%zXmsjXkOcL^|7UxGdKi*K6&TNU2Nxw^^U|n0*n2w3iv9Y0tfc#$P*n$ zPL*31F+>WvVX8O41h}Q6IYKC(%^|{$9D#c=~u-hUV9ZNrnR0HygO|Wr`W9(>TtXz~j z#q2nsr9)a$ZWu#h1C|X~CGoL<2Fn`w%Y!ud{M?4;e{yO;H7=kHc!RPR0vI^g7(vbY z5u%&m&LJCw`)F_(Oix-$&5z=`Fl+<{7DB1I+>g;W(qwDm;zhNv>Y!R1J$EV41uJRQ!JIYdf-) zdXz98 z8u=rl1jS*NyI;7_B?2c9Ker&N1{u5b8W93S^bbDTn3=t~4pIhC4ZHs=%TAZz*UPSLOU5!y? zIICiz#h^t6godp{;)F?(i`77{TQA$1TmRifCL8}OwMV4+N&X4tC*=j#^!@^ojISRy z80D$y@}G-zgwCqHF$`A?joRD3qkEaV?zPEty3sUU;e|owbhnb8$ZZ8SG{)|kfyIZT z^OQ%cQv{eIFmmr!;#0^py(mB!;VY7@sM)I@YeA>lG&{Z4qn)7VZTfBTLm8YLN6uKX z_)&i)P7;g3E`Gs=%<-sT2XMl-VnZ$eJ!+*>)_Wn!_^ z%=>O2BN?a2-R23le}RKBlmxkP1NaO~ExuO&XizHBU-IlW5neTW6^}d)^J=0C-#w>#DhOPCn$*j~6AIj

J%i;g4DF5m!sj$oi% zK>lBUJaortN3fBWK6va@!u#32O#JyFfE0ZmWY9{AhlE~z7yw6FesL_zF5U`B`2H&) zIX?LvKD54(P5N7tLxz%Cqt)L_^dk~sLCe#P Date: Sun, 4 Aug 2019 08:14:47 -0700 Subject: [PATCH 04/30] chore(deps): update golang.org/x/sys commit hash to 51ab0e2 (#206) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b01d80c..a346f7c 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,6 @@ require ( github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 - golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 // indirect + golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect golang.org/x/tools v0.0.0-20190802221608-1d1727260058 ) diff --git a/go.sum b/go.sum index 5a4faa8..6ff0126 100644 --- a/go.sum +++ b/go.sum @@ -69,6 +69,8 @@ golang.org/x/sys v0.0.0-20190731002446-1393eb018365 h1:skmasgLtLOsII4VBh/TRzNotE golang.org/x/sys v0.0.0-20190731002446-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 h1:sL449jA3eITt86CGRvhic5g9AuQEnaqaasKTT+ieDng= golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa h1:u4+etSxig55nONLlLw1yeSpq0xuJ+LL180APqMS+cKs= +golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 9649b1c2a1273c8e18d4006682b361edc5e1791f Mon Sep 17 00:00:00 2001 From: SalvadorC Date: Mon, 5 Aug 2019 18:21:20 +0200 Subject: [PATCH 05/30] fix 208 struct-tag linter false positive (#209) --- fixtures/struct-tag.go | 4 +++- rule/struct-tag.go | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fixtures/struct-tag.go b/fixtures/struct-tag.go index b53c883..e4aa074 100644 --- a/fixtures/struct-tag.go +++ b/fixtures/struct-tag.go @@ -20,7 +20,9 @@ type decodeAndValidateRequest struct { OptionalStruct *optionalStruct `json:"optionalStruct,omitempty"` OptionalQuery string `json:"-" querystring:"queryfoo"` optionalQuery string `json:"-" querystring:"queryfoo"` // MATCH /tag on not-exported field optionalQuery/ - + // No-reg test for bug https://github.com/mgechev/revive/issues/208 + Tiret string `json:"-,"` + BadTiret string `json:"other,"` // MATCH /option can not be empty in JSON tag/ } type RangeAllocation struct { diff --git a/rule/struct-tag.go b/rule/struct-tag.go index 8335e0d..57cf810 100644 --- a/rule/struct-tag.go +++ b/rule/struct-tag.go @@ -86,7 +86,7 @@ func (w lintStructTagRule) checkTaggedField(f *ast.Field) { w.addFailure(f.Tag, "field's type and default value's type mismatch") } case "json": - msg, ok := w.checkJSONTag(tag.Options) + msg, ok := w.checkJSONTag(tag.Name, tag.Options) if !ok { w.addFailure(f.Tag, msg) } @@ -161,10 +161,15 @@ func (w lintStructTagRule) checkBSONTag(options []string) (string, bool) { return "", true } -func (w lintStructTagRule) checkJSONTag(options []string) (string, bool) { +func (w lintStructTagRule) checkJSONTag(name string, options []string) (string, bool) { for _, opt := range options { switch opt { case "omitempty", "string": + case "": + // special case for JSON key "-" + if name != "-" { + return "option can not be empty in JSON tag", false + } default: return fmt.Sprintf("unknown option '%s' in JSON tag", opt), false } From 7b27ac88b96df8ef9f1f79d0a0d9f0d6be5592d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0imon?= Date: Mon, 5 Aug 2019 18:50:10 +0200 Subject: [PATCH 06/30] Add Codeac.io - Automated code review tool (#207) * + Codeac.io service * @ fix typo * + CI section * @ fix typo --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4bc968b..18d07b4 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Here's how `revive` is different from `golint`: - [`lorawan-stack`](https://github.com/TheThingsNetwork/lorawan-stack) - The Things Network Stack for LoRaWAN V3 - [`gofight`](https://github.com/appleboy/gofight) - Testing API Handler written in Golang. - [`ggz`](https://github.com/go-ggz/ggz) - An URL shortener service written in Golang +- [`Codeac.io`](https://www.codeac.io?ref=revive) - Automated code review service integrates with GitHub, Bitbucket and GitLab (even self-hosted) and helps you fight technical debt. *Open a PR to add your project*. @@ -53,6 +54,7 @@ Here's how `revive` is different from `golint`: - [revive](#revive) - [Usage](#usage) - [Text Editors](#text-editors) + - [Continuous Integration](#continuous-integration) - [Bazel](#bazel) - [Installation](#installation) - [Command Line Flags](#command-line-flags) @@ -108,6 +110,10 @@ call ale#linter#Define('go', { \}) ``` +### Continuous Integration + +[Codeac.io](https://www.codeac.io?ref=revive) - Automated code review service integrates with GitHub, Bitbucket and GitLab (even self-hosted) and helps you fight technical debt. Check your [pull-requests](https://www.codeac.io/documentation/pull-requests.html?ref=revive) with [revive](https://www.codeac.io/documentation/revive-configuration.html?ref=revive) automatically. (free for open-source projects) + ### Installation ```bash From 86af3e62d54516ba742a253c0a338dc577ee07ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 11:13:46 -0700 Subject: [PATCH 07/30] Update golang.org/x/tools commit hash to 2756c52 (#210) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a346f7c..8d8ead5 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190802221608-1d1727260058 + golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c ) diff --git a/go.sum b/go.sum index 6ff0126..639eb25 100644 --- a/go.sum +++ b/go.sum @@ -156,3 +156,5 @@ golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 h1:KjL1/OdjgZDxA88tw0sTsLR golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190802221608-1d1727260058 h1:1rd4qUHYwgnGfHkj0tTCdwukGPP6YfNkvXfG15qMmlc= golang.org/x/tools v0.0.0-20190802221608-1d1727260058/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c h1:OuZqaJqdZ4bwoAmF0dp2CPC31S0OJcomd1xu/8gUbc8= +golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= From f84c9db7a43c37350def905bd3dcbeee4e7aec17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 15:15:16 -0700 Subject: [PATCH 08/30] Update golang.org/x/tools commit hash to e1fc249 (#211) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8d8ead5..0c6af21 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c + golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 ) diff --git a/go.sum b/go.sum index 639eb25..2067e0a 100644 --- a/go.sum +++ b/go.sum @@ -158,3 +158,5 @@ golang.org/x/tools v0.0.0-20190802221608-1d1727260058 h1:1rd4qUHYwgnGfHkj0tTCdwu golang.org/x/tools v0.0.0-20190802221608-1d1727260058/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c h1:OuZqaJqdZ4bwoAmF0dp2CPC31S0OJcomd1xu/8gUbc8= golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 h1:q95h9w5HTgvUhihWulmmjEj9VXMyjYYTbLXSGH/PSZQ= +golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= From fcce099ac1ee10091625c066d8aa3398a4a2cdf3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2019 08:21:16 -0700 Subject: [PATCH 09/30] Update golang.org/x/tools commit hash to c5a2fd3 (#212) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0c6af21..53616a5 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 + golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a ) diff --git a/go.sum b/go.sum index 2067e0a..72758ad 100644 --- a/go.sum +++ b/go.sum @@ -160,3 +160,5 @@ golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c h1:OuZqaJqdZ4bwoAmF0dp2CPC golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 h1:q95h9w5HTgvUhihWulmmjEj9VXMyjYYTbLXSGH/PSZQ= golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a h1:q82O/ALiK+6pdKJSLYhLbQ1K/u/RlRKO4FZCOwjNHTs= +golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= From e43a9dc28a0033dff1f888ff24f9bddda0c66099 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2019 14:09:43 -0700 Subject: [PATCH 10/30] Update golang.org/x/tools commit hash to 6743d40 (#213) --- go.mod | 2 +- go.sum | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 53616a5..3c04453 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a + golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b ) diff --git a/go.sum b/go.sum index 72758ad..eb50538 100644 --- a/go.sum +++ b/go.sum @@ -162,3 +162,6 @@ golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 h1:q95h9w5HTgvUhihWulmmjEj golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a h1:q82O/ALiK+6pdKJSLYhLbQ1K/u/RlRKO4FZCOwjNHTs= golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b h1:lMRfmFqmmlmIt6E6VL6KNO1kVqvxo60HhKvCbkeVsqY= +golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From f356ad975bdc8c469908f1f9058a3963d84d2b4c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 22:57:51 -0700 Subject: [PATCH 11/30] Update golang.org/x/tools commit hash to e713427 (#214) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3c04453..76e6c87 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b + golang.org/x/tools v0.0.0-20190808223956-e713427fea3f ) diff --git a/go.sum b/go.sum index eb50538..248c911 100644 --- a/go.sum +++ b/go.sum @@ -164,4 +164,6 @@ golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a h1:q82O/ALiK+6pdKJSLYhLbQ1 golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b h1:lMRfmFqmmlmIt6E6VL6KNO1kVqvxo60HhKvCbkeVsqY= golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190808223956-e713427fea3f h1:qhn0c1Z/sEzZTkX8XlGrQ8dkwxl+Rab/LLBI/tGvsOI= +golang.org/x/tools v0.0.0-20190808223956-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From a5c15acc084b9778307bff45e7b1a6913a03e931 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2019 08:58:14 -0700 Subject: [PATCH 12/30] Update golang.org/x/tools commit hash to 6d4652c (#215) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 76e6c87..940a9c1 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect - golang.org/x/tools v0.0.0-20190808223956-e713427fea3f + golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 ) diff --git a/go.sum b/go.sum index 248c911..4168136 100644 --- a/go.sum +++ b/go.sum @@ -166,4 +166,6 @@ golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b h1:lMRfmFqmmlmIt6E6VL6KNO1 golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190808223956-e713427fea3f h1:qhn0c1Z/sEzZTkX8XlGrQ8dkwxl+Rab/LLBI/tGvsOI= golang.org/x/tools v0.0.0-20190808223956-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 h1:Lsfy/gJCZ5VDaOHEgAXbjOl0GNOc3+VlziUHXQ6C/dU= +golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 917f93bdfef88641daf66dafa6f4b8dc2a0e0f9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2019 07:47:17 -0700 Subject: [PATCH 13/30] Update golang.org/x/sys commit hash to 9eafafc (#216) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 940a9c1..366b27a 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,6 @@ require ( github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 - golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa // indirect + golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e // indirect golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 ) diff --git a/go.sum b/go.sum index 4168136..8ed16ab 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 h1:sL449jA3eITt86CGRvhic5g9A golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa h1:u4+etSxig55nONLlLw1yeSpq0xuJ+LL180APqMS+cKs= golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e h1:vCY7fCIz2/pUXnhP1XqeBajIdo0oVil6Mt+jFN/Fw/8= +golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From acd18ac2f68d2618a52d4caf0454da606a1179ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:02:58 -0700 Subject: [PATCH 14/30] Update golang.org/x/tools commit hash to 4147ede (#218) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 366b27a..bcdfe67 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e // indirect - golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 + golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b ) diff --git a/go.sum b/go.sum index 8ed16ab..b65ed62 100644 --- a/go.sum +++ b/go.sum @@ -170,4 +170,6 @@ golang.org/x/tools v0.0.0-20190808223956-e713427fea3f h1:qhn0c1Z/sEzZTkX8XlGrQ8d golang.org/x/tools v0.0.0-20190808223956-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 h1:Lsfy/gJCZ5VDaOHEgAXbjOl0GNOc3+VlziUHXQ6C/dU= golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b h1:baoDOzi0CqGsU/O31eEwzex3OtpnPw0nUqIYaxg8PWA= +golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From a08e03e0bd250eb9fa1ac486187d4fc683b33ff0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2019 16:05:24 -0700 Subject: [PATCH 15/30] Update golang.org/x/tools commit hash to 9dba7ca (#219) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bcdfe67..8a304c8 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e // indirect - golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b + golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 ) diff --git a/go.sum b/go.sum index b65ed62..7f7ecd5 100644 --- a/go.sum +++ b/go.sum @@ -172,4 +172,6 @@ golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 h1:Lsfy/gJCZ5VDaOHEgAXbjOl golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b h1:baoDOzi0CqGsU/O31eEwzex3OtpnPw0nUqIYaxg8PWA= golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 h1:qpvBGLLwQ/jTyctOcuFhgTolz38tMqwQkR+DmgcQlUY= +golang.org/x/tools v0.0.0-20190813222811-9dba7caff850/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e120712eba7ca6f4fc7d80e979e393a10d031645 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2019 17:29:30 -0700 Subject: [PATCH 16/30] Update golang.org/x/sys commit hash to fde4db3 (#221) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8a304c8..438de32 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,6 @@ require ( github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 - golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e // indirect + golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a // indirect golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 ) diff --git a/go.sum b/go.sum index 7f7ecd5..55c45ee 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa h1:u4+etSxig55nONLlLw1yeSpq0 golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e h1:vCY7fCIz2/pUXnhP1XqeBajIdo0oVil6Mt+jFN/Fw/8= golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a h1:ZtbkXZY7vbjKdcaQck5BbF6wn7cKkfzW9xhtHmXev8A= +golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI= golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From e0e99e8e8b3ccad8349f1827b955e4eaff229615 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2019 11:04:10 -0700 Subject: [PATCH 17/30] Update golang.org/x/tools commit hash to a857023 (#220) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 438de32..fa16a45 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a // indirect - golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 + golang.org/x/tools v0.0.0-20190816173200-a857023c2190 ) diff --git a/go.sum b/go.sum index 55c45ee..34f5430 100644 --- a/go.sum +++ b/go.sum @@ -176,4 +176,6 @@ golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b h1:baoDOzi0CqGsU/O31eEwzex golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 h1:qpvBGLLwQ/jTyctOcuFhgTolz38tMqwQkR+DmgcQlUY= golang.org/x/tools v0.0.0-20190813222811-9dba7caff850/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190816173200-a857023c2190 h1:bfIvPjgfEedTiVO1sNI1Z29nsUpp+LUXu6IyxRPWpKQ= +golang.org/x/tools v0.0.0-20190816173200-a857023c2190/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 5806359b599877d97d7f63d3b0ef84c5d9f4c47b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2019 14:19:37 -0700 Subject: [PATCH 18/30] Update golang.org/x/tools commit hash to 6889da9 (#222) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fa16a45..6329403 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a // indirect - golang.org/x/tools v0.0.0-20190816173200-a857023c2190 + golang.org/x/tools v0.0.0-20190816203027-6889da9d5479 ) diff --git a/go.sum b/go.sum index 34f5430..74ed452 100644 --- a/go.sum +++ b/go.sum @@ -178,4 +178,6 @@ golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 h1:qpvBGLLwQ/jTyctOcuFhgTo golang.org/x/tools v0.0.0-20190813222811-9dba7caff850/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190816173200-a857023c2190 h1:bfIvPjgfEedTiVO1sNI1Z29nsUpp+LUXu6IyxRPWpKQ= golang.org/x/tools v0.0.0-20190816173200-a857023c2190/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190816203027-6889da9d5479 h1:5ZmEHIOPZnmJVxwnhHBy5B6XDmg9mFQ0QNthkv0WEmc= +golang.org/x/tools v0.0.0-20190816203027-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e8a54f5ffbbb2ca8d2be62f5ada4af7335e9f671 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Sat, 17 Aug 2019 18:38:54 +0200 Subject: [PATCH 19/30] Fix mgechev/dots timestamp mismatch (#224) --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 6329403..d981430 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/fatih/structtag v1.0.0 github.com/mattn/go-colorable v0.1.2 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect - github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc + github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a // indirect diff --git a/go.sum b/go.sum index 74ed452..1536417 100644 --- a/go.sum +++ b/go.sum @@ -18,10 +18,8 @@ github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8Bz github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mgechev/dots v0.0.0-20180605013149-8e09d8ea2757 h1:KTwJ7Lo3KDKMknRYN5JEFRGIM4IkG59QjFFM2mxsMEU= -github.com/mgechev/dots v0.0.0-20180605013149-8e09d8ea2757/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc h1:ErGdrZWM/CrAz0FVwcznlAScsmr2pdSMMPMwFL9TNmw= -github.com/mgechev/dots v0.0.0-20190603122614-18fa4c4b71cc/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= +github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc h1:SQHr6jXnsY5YmRoO7RWDcZjmC3PgwPW/xQ9TYJ/SiRY= +github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc h1:rQ1O4ZLYR2xXHXgBCCfIIGnuZ0lidMQw2S5n1oOv+Wg= github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88= From b22bd7ca03c383a1d1f56c5dbfe8c2274a772d8b Mon Sep 17 00:00:00 2001 From: Minko Gechev Date: Sun, 18 Aug 2019 08:03:16 -0700 Subject: [PATCH 20/30] Update go.mod and go.sum (#225) --- go.mod | 7 +-- go.sum | 164 ++------------------------------------------------------- 2 files changed, 9 insertions(+), 162 deletions(-) diff --git a/go.mod b/go.mod index d981430..b9ea41a 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,15 @@ module github.com/mgechev/revive +go 1.12 + require ( github.com/BurntSushi/toml v0.3.1 github.com/fatih/color v1.7.0 github.com/fatih/structtag v1.0.0 github.com/mattn/go-colorable v0.1.2 // indirect + github.com/mattn/go-isatty v0.0.9 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc github.com/olekukonko/tablewriter v0.0.1 - github.com/pkg/errors v0.8.1 - golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a // indirect - golang.org/x/tools v0.0.0-20190816203027-6889da9d5479 + golang.org/x/tools v0.0.0-20190816200558-6889da9d5479 ) diff --git a/go.sum b/go.sum index 1536417..c1d92be 100644 --- a/go.sum +++ b/go.sum @@ -1,181 +1,27 @@ -github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY= -github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structtag v1.0.0 h1:pTHj65+u3RKWYPSGaU290FpI/dXxTaHdVwVwbcPKmEc= github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc h1:SQHr6jXnsY5YmRoO7RWDcZjmC3PgwPW/xQ9TYJ/SiRY= github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc h1:rQ1O4ZLYR2xXHXgBCCfIIGnuZ0lidMQw2S5n1oOv+Wg= -github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190603122648-4c4f7f33c9ed h1:Lf5SX+bXEwoj3Y6Nfu5qtffzOXhPQA9REb2R5W4nGP8= -golang.org/x/sys v0.0.0-20190603122648-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606125941-79a91cf218c4 h1:HWs74PINelUuEfUbwnBO+1N52oVhkjuLqpbUmyrFA1s= -golang.org/x/sys v0.0.0-20190606125941-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203914-7fc4e5ec1444 h1:U3H/lfsEYy6ld4rCevWA3QgxHlZLiFUfuBFIEc/Ifyo= -golang.org/x/sys v0.0.0-20190606203914-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190608055321-5b15430b70e3 h1:vzXBGBUiVyR0q7D4t89HsaY0TYhmviZBVOVUyvyMBjU= -golang.org/x/sys v0.0.0-20190608055321-5b15430b70e3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190614215434-b47fdc937951 h1:pGVEuw9fHbMpaZlMbLwssX14J35+8blxkNxbyMcO/qE= -golang.org/x/sys v0.0.0-20190614215434-b47fdc937951/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616132722-15dcb6c0061f h1:bWC5mWiwVGXbr7P6ugM+hu6QytMFEjbwt+SO2r1M2+o= -golang.org/x/sys v0.0.0-20190616132722-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190619193031-17bc6164aac4 h1:wlKUlj5/boPTVWT2ysl97FAXePcoaV9FNqFOzsNuwpk= -golang.org/x/sys v0.0.0-20190619193031-17bc6164aac4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190621215844-d432491b9138 h1:mOtS9UBYWoZzbGWv3/XJz0cxMw8MTBbNKy3pRvP2Mjk= -golang.org/x/sys v0.0.0-20190621215844-d432491b9138/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624145334-c5567b49c5d0 h1:z1lZzI4A4GjnM80wHx8Yrjtcr56DRJ6VJnipc0bbG3o= -golang.org/x/sys v0.0.0-20190624145334-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190629205408-04f50cda93cb h1:IeU57h/r0+/v829dDR8bskefuF1Cx4KAxce1Cn0LFvE= -golang.org/x/sys v0.0.0-20190629205408-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190710165549-6ec70d6a5542 h1:PNYRbnC8XRk0bAINQCfprVc169PXbLRG2HI1HXbUEg8= -golang.org/x/sys v0.0.0-20190710165549-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712063909-fae7ac547cb7 h1:kj9oKJYzWQH5MvoBhxb9WQn/LqYor42sKTvsrUCCu7g= -golang.org/x/sys v0.0.0-20190712063909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726004620-94b544f455ef h1:pKfIZaaN+ipVf4Vz//s+8MRZkgZvBsds3BOAAYmXV/Y= -golang.org/x/sys v0.0.0-20190726004620-94b544f455ef/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726093751-fc99dfbffb4e h1:AhhcJML1FGXN10f3s4/WyoO5/8u7Rfb1ZyB47O8qp+s= -golang.org/x/sys v0.0.0-20190726093751-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190731002446-1393eb018365 h1:skmasgLtLOsII4VBh/TRzNotE2cn3rMyPB9/A67wLDU= -golang.org/x/sys v0.0.0-20190731002446-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3 h1:sL449jA3eITt86CGRvhic5g9AuQEnaqaasKTT+ieDng= -golang.org/x/sys v0.0.0-20190801053355-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa h1:u4+etSxig55nONLlLw1yeSpq0xuJ+LL180APqMS+cKs= -golang.org/x/sys v0.0.0-20190804054238-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e h1:vCY7fCIz2/pUXnhP1XqeBajIdo0oVil6Mt+jFN/Fw/8= -golang.org/x/sys v0.0.0-20190812082915-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a h1:ZtbkXZY7vbjKdcaQck5BbF6wn7cKkfzW9xhtHmXev8A= -golang.org/x/sys v0.0.0-20190815002308-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI= -golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190604003109-8aaa1484dc10 h1:VULJh5DQg4Inr1Xiypf4pj72xB4lPJdiUgV2Ra5M8og= -golang.org/x/tools v0.0.0-20190604003109-8aaa1484dc10/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606052759-4d9ae51c2468 h1:ousb8Vkhj77qYml3n9BuPuYaR6LnZyLh5LXB2qq8wzI= -golang.org/x/tools v0.0.0-20190606052759-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614153353-1edc8e83c897 h1:Tcg4xXCU7bSKi8WaBg3N7lJTHwLv45zG+LXHG6WxorM= -golang.org/x/tools v0.0.0-20190614153353-1edc8e83c897/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614185444-d1d6cdd8a67e h1:bZRjbS2OsoCz4Whw4o7b1Il1obBuaKSM0FXMfFrRut4= -golang.org/x/tools v0.0.0-20190614185444-d1d6cdd8a67e/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614215004-5aca471b1d59 h1:rBGSbLsDaYExWFDBn79o7jc1xpwfxSofsWJNihAfWto= -golang.org/x/tools v0.0.0-20190614215004-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617174016-6fea9ef05e7a h1:gdHr3XuwwcWiVcNwFFdaMAXkLC9SGW3+yn63Pol+wL0= -golang.org/x/tools v0.0.0-20190617174016-6fea9ef05e7a/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617192825-da514acc4774 h1:hL3a3nRZsZm7FQGehfRB1w5y8mbrLyMSAgki4j0z3I0= -golang.org/x/tools v0.0.0-20190617192825-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190618173119-fdf1049a943a h1:UYXkp2zG6yfcsx4WdMshPebv30sUsSXURy1nWiwy0oc= -golang.org/x/tools v0.0.0-20190618173119-fdf1049a943a/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190623014052-6e04913cbbac h1:p4rf0zoHymrHSlKS+xG2PhJOtxOEWC9nu4NamWffoY0= -golang.org/x/tools v0.0.0-20190623014052-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624225754-a101b041ded4 h1:3Yme/SSFE6mHkvIIhjjiTrlmOsy6m0aNnyTDZPYJIy4= -golang.org/x/tools v0.0.0-20190624225754-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190625183255-252024b82959 h1:icB3Kx/bolKriEovlxmFvvEBA1b24q6lQkwGLiO7Kgo= -golang.org/x/tools v0.0.0-20190625183255-252024b82959/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628234000-fb37f6ba8261 h1:D/pylchHpGxucPHRiQsXXfyk9R4ywTUoH6FaZx0R0Q0= -golang.org/x/tools v0.0.0-20190628234000-fb37f6ba8261/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190701204812-38ae2c8f6412 h1:eiOZ97iLROr9dsoElIcgpaBTnypaUM6FklHaTH1WCUQ= -golang.org/x/tools v0.0.0-20190701204812-38ae2c8f6412/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190702152726-7e72c71c505f h1:XEee/4s6OPmxKNwnku3HeR9yvHS+DfiMUBnZRvGYKsc= -golang.org/x/tools v0.0.0-20190702152726-7e72c71c505f/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190702203059-44aeb8b7c377 h1:ImzDLDLqRaKKO5JeKsrJF73YTtC/UGJYXQfnhCykd1U= -golang.org/x/tools v0.0.0-20190702203059-44aeb8b7c377/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190703183741-063514c48b26 h1:RSQtTb58BibjAu/zvYqkvmSd3hCVrxUHtxtJgdmlo8U= -golang.org/x/tools v0.0.0-20190703183741-063514c48b26/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190708153032-60762fc531e6 h1:+09ssZLX5m87DAU4ovA5R2dT8+rxQJOSrnvJ08dNOvI= -golang.org/x/tools v0.0.0-20190708153032-60762fc531e6/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190708212629-c8855242db9c h1:61VlnXlxJ8ZQ0ScNJLbv0lMvy2zxMOMtmqgczqTjoSw= -golang.org/x/tools v0.0.0-20190708212629-c8855242db9c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190709205837-f82b303b69d7 h1:POOqS8nIAlVjiggJspEagLTIm7FecjZ3zjL+UXqxaeo= -golang.org/x/tools v0.0.0-20190709205837-f82b303b69d7/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190709213823-7b25e351ac0e h1:KLE9RrAWtdmIWsb/E0ljAvXMM5lZf4Gtr3HYCEE4FIE= -golang.org/x/tools v0.0.0-20190709213823-7b25e351ac0e/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190710195507-286818132824 h1:2492BvYnJkin59SmTIFBH3mlkrNxeIKPJuM3GrK/gYo= -golang.org/x/tools v0.0.0-20190710195507-286818132824/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190712214651-8b927904ee0d h1:KlQeLUDWg+cWfoNyo2obro62ANg9Ain//HXb8aKT2jg= -golang.org/x/tools v0.0.0-20190712214651-8b927904ee0d/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190715053316-607ca053a137 h1:JD/hG/8Cy1uTpUou5cTdh88WzXO985+ykk+/kD2B6Og= -golang.org/x/tools v0.0.0-20190715053316-607ca053a137/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190715174000-9e48ab1d90cd h1:WtY90UqL9QgrhtGZXkSuv3VgN9O2zchNuw7mCsy5EAo= -golang.org/x/tools v0.0.0-20190715174000-9e48ab1d90cd/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190715222530-9b2cb0e5f602 h1:aPQ4URfBa5qpEffv7JQWB643/X9MIooR7AmSM4PhjbQ= -golang.org/x/tools v0.0.0-20190715222530-9b2cb0e5f602/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190716023037-fefcef05abb1 h1:XTh+ATqTLtxlslz1/eewT2lc16Tn566b6TuHLllcamo= -golang.org/x/tools v0.0.0-20190716023037-fefcef05abb1/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190716155013-919acb9f1ffd h1:awSISWvdxEIWPMBRrxodeas3r6hNs3R7fSCAKsN+2eg= -golang.org/x/tools v0.0.0-20190716155013-919acb9f1ffd/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190716192744-0b5a7f81db50 h1:MjNb67gYViBJS2G0qlnUyUvz01HpvT0hWbRK6+CVeB4= -golang.org/x/tools v0.0.0-20190716192744-0b5a7f81db50/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190719014327-e377ae9d6386 h1:XYHge1yfBqxAoAUYFNfgQBUM/pLA4cVgBCxSVP4SFM8= -golang.org/x/tools v0.0.0-20190719014327-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190723023520-8bb11ff117ca h1:jxUITcp9Zck5mo94NnK9nxKhcrCHHu3Uxn3zT/Ab6GQ= -golang.org/x/tools v0.0.0-20190723023520-8bb11ff117ca/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190724192812-8aa4eac1a7c1 h1:fUhbXHMxzVzne8fm8LoGbgb29YxdSR6sXVOA6M1+79c= -golang.org/x/tools v0.0.0-20190724192812-8aa4eac1a7c1/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190725162026-2e34cfcb95cb h1:nCidYN5rpBq6eOoKgsg8OPyARFROWoopPyENOA1AADU= -golang.org/x/tools v0.0.0-20190725162026-2e34cfcb95cb/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190727014933-1bd56024c620 h1:V0R1y3ny4Qty3oJpgixfc7BF1GqcBtG492UJDH4XNi4= -golang.org/x/tools v0.0.0-20190727014933-1bd56024c620/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190727174842-db2fa46ec33c h1:jOixaG4f/xPYap0HSnwlewCOTxw7qq5hqxvCyw5Kfvg= -golang.org/x/tools v0.0.0-20190727174842-db2fa46ec33c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190728085240-fc6e2057e7f6 h1:HwL5zE73Lj6ca2l3QvmH+z+mMQJp6w6/7zcxRJcGNRw= -golang.org/x/tools v0.0.0-20190728085240-fc6e2057e7f6/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190729094940-ff9f1409240a h1:s5iVUvQeQogtT5N2UsrWTExwB/vujdgo2oRIoKqGHP0= -golang.org/x/tools v0.0.0-20190729094940-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190730215743-ed3277de2799 h1:QDcqPiPMwhOSeNS/65AYJQxAYb2HIYLFw6NRbGQUtSU= -golang.org/x/tools v0.0.0-20190730215743-ed3277de2799/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190731224408-1e85ed8060aa h1:crSxYKs/4ckOznRS/ORDRJikUnqR5pcExM2Q9fNghbw= -golang.org/x/tools v0.0.0-20190731224408-1e85ed8060aa/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060 h1:ixdNsWPlaysKGPShUO+OF5eF/dSQOGTB86mRds+STrY= -golang.org/x/tools v0.0.0-20190802005412-e9bb7d36c060/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10 h1:KjL1/OdjgZDxA88tw0sTsLRhErqk6G8l5JmoZSrEZvY= -golang.org/x/tools v0.0.0-20190802214056-43c5e4ca5b10/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190802221608-1d1727260058 h1:1rd4qUHYwgnGfHkj0tTCdwukGPP6YfNkvXfG15qMmlc= -golang.org/x/tools v0.0.0-20190802221608-1d1727260058/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c h1:OuZqaJqdZ4bwoAmF0dp2CPC31S0OJcomd1xu/8gUbc8= -golang.org/x/tools v0.0.0-20190805172734-2756c524cc1c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621 h1:q95h9w5HTgvUhihWulmmjEj9VXMyjYYTbLXSGH/PSZQ= -golang.org/x/tools v0.0.0-20190805204540-e1fc249b6621/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a h1:q82O/ALiK+6pdKJSLYhLbQ1K/u/RlRKO4FZCOwjNHTs= -golang.org/x/tools v0.0.0-20190805234027-c5a2fd39b72a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b h1:lMRfmFqmmlmIt6E6VL6KNO1kVqvxo60HhKvCbkeVsqY= -golang.org/x/tools v0.0.0-20190806195817-6743d4095d4b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190808223956-e713427fea3f h1:qhn0c1Z/sEzZTkX8XlGrQ8dkwxl+Rab/LLBI/tGvsOI= -golang.org/x/tools v0.0.0-20190808223956-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4 h1:Lsfy/gJCZ5VDaOHEgAXbjOl0GNOc3+VlziUHXQ6C/dU= -golang.org/x/tools v0.0.0-20190809152137-6d4652c779c4/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b h1:baoDOzi0CqGsU/O31eEwzex3OtpnPw0nUqIYaxg8PWA= -golang.org/x/tools v0.0.0-20190812192641-4147ede4f82b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190813222811-9dba7caff850 h1:qpvBGLLwQ/jTyctOcuFhgTolz38tMqwQkR+DmgcQlUY= -golang.org/x/tools v0.0.0-20190813222811-9dba7caff850/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190816173200-a857023c2190 h1:bfIvPjgfEedTiVO1sNI1Z29nsUpp+LUXu6IyxRPWpKQ= -golang.org/x/tools v0.0.0-20190816173200-a857023c2190/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190816203027-6889da9d5479 h1:5ZmEHIOPZnmJVxwnhHBy5B6XDmg9mFQ0QNthkv0WEmc= -golang.org/x/tools v0.0.0-20190816203027-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479 h1:lfN2PY/jymfnxkNHlbBF5DwPsUvhqUnrdgfK01iH2s0= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From fa5acbc1f032b912bdf80559357357963b788246 Mon Sep 17 00:00:00 2001 From: Markus Wiegand Date: Sat, 31 Aug 2019 23:29:52 +0200 Subject: [PATCH 21/30] Add Revive Action to readme (#228) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 18d07b4..db5e6a8 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,10 @@ call ale#linter#Define('go', { \}) ``` +### GitHub Actions + +- [Revive Action](https://github.com/marketplace/actions/revive-action) with annotation support + ### Continuous Integration [Codeac.io](https://www.codeac.io?ref=revive) - Automated code review service integrates with GitHub, Bitbucket and GitLab (even self-hosted) and helps you fight technical debt. Check your [pull-requests](https://www.codeac.io/documentation/pull-requests.html?ref=revive) with [revive](https://www.codeac.io/documentation/revive-configuration.html?ref=revive) automatically. (free for open-source projects) From 84deee41635a69df54d810f38e2745cc615a205f Mon Sep 17 00:00:00 2001 From: SalvadorC Date: Tue, 10 Sep 2019 19:26:47 +0200 Subject: [PATCH 22/30] fixes issue #229 (#231) --- fixtures/golint/exported.go | 20 ++++++++++++++++++++ rule/exported.go | 15 ++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/fixtures/golint/exported.go b/fixtures/golint/exported.go index fb2880e..1ed5002 100644 --- a/fixtures/golint/exported.go +++ b/fixtures/golint/exported.go @@ -13,3 +13,23 @@ type ( ) type Foo struct{} // MATCH /exported type Foo should have comment or be unexported/ + +// The following cases are no-regression tests for issue 229 + +/* Bar something */ +type Bar struct{} + +/* Toto something */ +func Toto() {} + +/* FirstLetter something */ +const FirstLetter = "A" + +/*Bar2 something */ +type Bar2 struct{} + +/*Toto2 something */ +func Toto2() {} + +/*SecondLetter something */ +const SecondLetter = "B" diff --git a/rule/exported.go b/rule/exported.go index 714acf6..b68f2ba 100644 --- a/rule/exported.go +++ b/rule/exported.go @@ -85,7 +85,7 @@ func (w *lintExported) lintFuncDoc(fn *ast.FuncDecl) { }) return } - s := fn.Doc.Text() + s := normalizeText(fn.Doc.Text()) prefix := fn.Name.Name + " " if !strings.HasPrefix(s, prefix) { w.onFailure(lint.Failure{ @@ -141,7 +141,7 @@ func (w *lintExported) lintTypeDoc(t *ast.TypeSpec, doc *ast.CommentGroup) { return } - s := doc.Text() + s := normalizeText(doc.Text()) articles := [...]string{"A", "An", "The", "This"} for _, a := range articles { if t.Name.Name == a { @@ -217,7 +217,8 @@ func (w *lintExported) lintValueSpecDoc(vs *ast.ValueSpec, gd *ast.GenDecl, genD doc = gd.Doc } prefix := name + " " - if !strings.HasPrefix(doc.Text(), prefix) { + s := normalizeText(doc.Text()) + if !strings.HasPrefix(s, prefix) { w.onFailure(lint.Failure{ Confidence: 1, Node: doc, @@ -227,6 +228,14 @@ func (w *lintExported) lintValueSpecDoc(vs *ast.ValueSpec, gd *ast.GenDecl, genD } } +// normalizeText is a helper function that normalizes comment strings by: +// * removing one leading space +// +// This function is needed because ast.CommentGroup.Text() does not handle //-style and /*-style comments uniformly +func normalizeText(t string) string { + return strings.TrimPrefix(t, " ") +} + func (w *lintExported) Visit(n ast.Node) ast.Visitor { switch v := n.(type) { case *ast.GenDecl: From c93badef607dbf8646a6b1a55084c84fb004043a Mon Sep 17 00:00:00 2001 From: mgechev Date: Mon, 16 Sep 2019 12:31:59 -0700 Subject: [PATCH 23/30] Update the list of contributors --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index db5e6a8..184c637 100644 --- a/README.md +++ b/README.md @@ -480,17 +480,21 @@ Currently, type checking is enabled by default. If you want to run the linter wi ## Contributors -[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[gsamokovarov](https://github.com/gsamokovarov) |[morphy2k](https://github.com/morphy2k) |[tamird](https://github.com/tamird) | +[mgechev](https://github.com/mgechev) |[renovate[bot]](https://github.com/apps/renovate) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) | :---: |:---: |:---: |:---: |:---: |:---: | -[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[gsamokovarov](https://github.com/gsamokovarov) |[morphy2k](https://github.com/morphy2k) |[tamird](https://github.com/tamird) | +[mgechev](https://github.com/mgechev) |[renovate[bot]](https://github.com/apps/renovate) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) | -[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) |[mapreal19](https://github.com/mapreal19) |[markelog](https://github.com/markelog) |[pa-m](https://github.com/pa-m) | +[markelog](https://github.com/markelog) |[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) | :---: |:---: |:---: |:---: |:---: |:---: | -[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) |[mapreal19](https://github.com/mapreal19) |[markelog](https://github.com/markelog) |[pa-m](https://github.com/pa-m) | +[markelog](https://github.com/markelog) |[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) | -[paul-at-start](https://github.com/paul-at-start) |[psapezhko](https://github.com/psapezhko) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +[jamesmaidment](https://github.com/jamesmaidment) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | :---: |:---: |:---: |:---: |:---: |:---: | -[paul-at-start](https://github.com/paul-at-start) |[psapezhko](https://github.com/psapezhko) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +[jamesmaidment](https://github.com/jamesmaidment) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | + +[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +:---: |:---: |:---: | +[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | ## License From 596ef107bb70beaeee374a72f1d6e74ab7f3c219 Mon Sep 17 00:00:00 2001 From: mgechev Date: Mon, 16 Sep 2019 12:34:10 -0700 Subject: [PATCH 24/30] Remove renovate from the list of contributors --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 184c637..e96e042 100644 --- a/README.md +++ b/README.md @@ -480,21 +480,21 @@ Currently, type checking is enabled by default. If you want to run the linter wi ## Contributors -[mgechev](https://github.com/mgechev) |[renovate[bot]](https://github.com/apps/renovate) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) | +[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) |[markelog](https://github.com/markelog) | :---: |:---: |:---: |:---: |:---: |:---: | -[mgechev](https://github.com/mgechev) |[renovate[bot]](https://github.com/apps/renovate) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) | +[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) |[markelog](https://github.com/markelog) | -[markelog](https://github.com/markelog) |[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) | +[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) | :---: |:---: |:---: |:---: |:---: |:---: | -[markelog](https://github.com/markelog) |[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) | +[tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) | -[jamesmaidment](https://github.com/jamesmaidment) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | +[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) | :---: |:---: |:---: |:---: |:---: |:---: | -[jamesmaidment](https://github.com/jamesmaidment) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | +[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) | -[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | -:---: |:---: |:---: | -[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +:---: |:---: | +[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | ## License From 40564c5052ae707047735ce7c374ab9ee0ba9386 Mon Sep 17 00:00:00 2001 From: John Rinehart Date: Tue, 17 Sep 2019 08:38:25 -0700 Subject: [PATCH 25/30] support global config (e.g. for company-wide settings) (#233) * support global config (e.g. for company-wide settings) * documented global config behavior --- README.md | 4 +++- config.go | 22 ++++++++++++++++++++-- go.mod | 2 ++ go.sum | 5 +++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e96e042..df55bc6 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,8 @@ Here's how `revive` is different from `golint`: Since the default behavior of `revive` is compatible with `golint`, without providing any additional flags, the only difference you'd notice is faster execution. +`revive` supports a `-config` flag whose value should correspond to a TOML file describing which rules to use for `revive`'s linting. If not provided, `revive` will try to use a global config file (assumed to be located at `$HOME/revive.toml`). Otherwise, if no configuration TOML file is found then `revive` uses a built-in set of default linting rules. + ### Bazel If you want to use revive with Bazel, take a look at the [rules](https://github.com/atlassian/bazel-tools/tree/master/gorevive) that Atlassian maintains. @@ -128,7 +130,7 @@ go get -u github.com/mgechev/revive `revive` accepts three command line parameters: -- `-config [PATH]` - path to config file in TOML format. +- `-config [PATH]` - path to config file in TOML format, defaults to `$HOME/revive.toml` if present. - `-exclude [PATTERN]` - pattern for files/directories/packages to be excluded for linting. You can specify the files you want to exclude for linting either as package name (i.e. `github.com/mgechev/revive`), list them as individual files (i.e. `file.go`), directories (i.e. `./foo/...`), or any combination of the three. - `-formatter [NAME]` - formatter to be used for the output. The currently available formatters are: diff --git a/config.go b/config.go index e6bb1af..508ba6e 100644 --- a/config.go +++ b/config.go @@ -5,9 +5,11 @@ import ( "fmt" "io/ioutil" "os" + "path/filepath" "strings" "github.com/mgechev/dots" + "github.com/mitchellh/go-homedir" "github.com/mgechev/revive/formatter" @@ -173,6 +175,18 @@ func getFormatter() lint.Formatter { return formatter } +func buildDefaultConfigPath() string { + var result string + if homeDir, err := homedir.Dir(); err == nil { + result = filepath.Join(homeDir, "revive.toml") + if _, err := os.Stat(result); err != nil { + result = "" + } + } + + return result +} + func defaultConfig() *lint.Config { defaultConfig := lint.Config{ Confidence: 0.0, @@ -233,12 +247,16 @@ func init() { fmt.Println(banner) originalUsage() } + // command line help strings const ( - configUsage = "path to the configuration TOML file (i.e. -config myconf.toml)" + configUsage = "path to the configuration TOML file, defaults to $HOME/revive.toml, if present (i.e. -config myconf.toml)" excludeUsage = "list of globs which specify files to be excluded (i.e. -exclude foo/...)" formatterUsage = "formatter to be used for the output (i.e. -formatter stylish)" ) - flag.StringVar(&configPath, "config", "", configUsage) + + defaultConfigPath := buildDefaultConfigPath() + + flag.StringVar(&configPath, "config", defaultConfigPath, configUsage) flag.Var(&excludePaths, "exclude", excludeUsage) flag.StringVar(&formatterName, "formatter", "", formatterUsage) flag.Parse() diff --git a/go.mod b/go.mod index b9ea41a..1576033 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,8 @@ require ( github.com/mattn/go-isatty v0.0.9 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc + github.com/mitchellh/go-homedir v1.1.0 github.com/olekukonko/tablewriter v0.0.1 + github.com/pkg/errors v0.8.1 golang.org/x/tools v0.0.0-20190816200558-6889da9d5479 ) diff --git a/go.sum b/go.sum index c1d92be..dd56e66 100644 --- a/go.sum +++ b/go.sum @@ -13,13 +13,18 @@ github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc h1:SQHr6jXnsY5YmRoO7RWDcZjmC3PgwPW/xQ9TYJ/SiRY= github.com/mgechev/dots v0.0.0-20181228164730-18fa4c4b71cc/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479 h1:lfN2PY/jymfnxkNHlbBF5DwPsUvhqUnrdgfK01iH2s0= From 88015ccf8e97dec79f401f2628aa199f8fe8cb10 Mon Sep 17 00:00:00 2001 From: mgechev Date: Thu, 17 Oct 2019 16:14:19 -0400 Subject: [PATCH 26/30] Update the list of contributors --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index df55bc6..77268ab 100644 --- a/README.md +++ b/README.md @@ -482,21 +482,21 @@ Currently, type checking is enabled by default. If you want to run the linter wi ## Contributors -[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) |[markelog](https://github.com/markelog) | +[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[gsamokovarov](https://github.com/gsamokovarov) |[morphy2k](https://github.com/morphy2k) |[markelog](https://github.com/markelog) | :---: |:---: |:---: |:---: |:---: |:---: | -[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[morphy2k](https://github.com/morphy2k) |[gsamokovarov](https://github.com/gsamokovarov) |[markelog](https://github.com/markelog) | +[mgechev](https://github.com/mgechev) |[chavacava](https://github.com/chavacava) |[xuri](https://github.com/xuri) |[gsamokovarov](https://github.com/gsamokovarov) |[morphy2k](https://github.com/morphy2k) |[markelog](https://github.com/markelog) | [tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) | :---: |:---: |:---: |:---: |:---: |:---: | [tamird](https://github.com/tamird) |[mapreal19](https://github.com/mapreal19) |[Clivern](https://github.com/Clivern) |[AragurDEV](https://github.com/AragurDEV) |[yangdiangzb](https://github.com/yangdiangzb) |[jamesmaidment](https://github.com/jamesmaidment) | -[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) | +[johnrichardrinehart](https://github.com/johnrichardrinehart) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | :---: |:---: |:---: |:---: |:---: |:---: | -[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) |[Jarema](https://github.com/Jarema) | +[johnrichardrinehart](https://github.com/johnrichardrinehart) |[michalhisim](https://github.com/michalhisim) |[pa-m](https://github.com/pa-m) |[paul-at-start](https://github.com/paul-at-start) |[weastur](https://github.com/weastur) |[ridvansumset](https://github.com/ridvansumset) | -[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | -:---: |:---: | -[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | +:---: |:---: |:---: | +[Jarema](https://github.com/Jarema) |[vkrol](https://github.com/vkrol) |[haya14busa](https://github.com/haya14busa) | ## License From 3c93b9c1a45be4949fd252d8a17df666fdfde87f Mon Sep 17 00:00:00 2001 From: dshemin Date: Thu, 28 Nov 2019 01:29:59 +0700 Subject: [PATCH 27/30] Fix #245 File header rule: index out of range [0] with length 0 --- .gitignore | 1 + fixtures/lint-file-header6.go | 1 + rule/file-header.go | 19 ++++++++--- test/file-header_test.go | 16 ++++++++++ test/import-blacklist_test.go | 9 ++---- test/unused-param_test.go | 5 +-- test/utils.go | 59 +++++++++++++++++++++++++---------- 7 files changed, 78 insertions(+), 32 deletions(-) create mode 100644 fixtures/lint-file-header6.go diff --git a/.gitignore b/.gitignore index 9b8cdca..77068c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea golinter revive vendor diff --git a/fixtures/lint-file-header6.go b/fixtures/lint-file-header6.go new file mode 100644 index 0000000..32acceb --- /dev/null +++ b/fixtures/lint-file-header6.go @@ -0,0 +1 @@ +package fixtures // MATCH /the file doesn't have an appropriate header/ diff --git a/rule/file-header.go b/rule/file-header.go index 9b4fbc3..145f914 100644 --- a/rule/file-header.go +++ b/rule/file-header.go @@ -51,25 +51,34 @@ type lintFileHeader struct { onFailure func(lint.Failure) } +var ( + multiRegexp = regexp.MustCompile("^/\\*") + singleRegexp = regexp.MustCompile("^//") +) + func (w lintFileHeader) Visit(_ ast.Node) ast.Visitor { - g := w.fileAst.Comments[0] failure := lint.Failure{ Node: w.fileAst, Confidence: 1, Failure: "the file doesn't have an appropriate header", } + + if len(w.fileAst.Comments) == 0 { + w.onFailure(failure) + return nil + } + + g := w.fileAst.Comments[0] if g == nil { w.onFailure(failure) return nil } - multi := regexp.MustCompile("^/\\*") - single := regexp.MustCompile("^//") comment := "" for _, c := range g.List { text := c.Text - if multi.Match([]byte(text)) { + if multiRegexp.Match([]byte(text)) { text = text[2 : len(text)-2] - } else if single.Match([]byte(text)) { + } else if singleRegexp.Match([]byte(text)) { text = text[2:] } comment += text diff --git a/test/file-header_test.go b/test/file-header_test.go index b92d05a..eae1350 100644 --- a/test/file-header_test.go +++ b/test/file-header_test.go @@ -27,4 +27,20 @@ func TestLintFileHeader(t *testing.T) { testRule(t, "lint-file-header5", &rule.FileHeaderRule{}, &lint.RuleConfig{ Arguments: []interface{}{"^\\sfoo.*bar$"}, }) + + testRule(t, "lint-file-header6", &rule.FileHeaderRule{}, &lint.RuleConfig{ + Arguments: []interface{}{"foobar"}, + }) +} + +func BenchmarkLintFileHeader(b *testing.B) { + benchRule(b, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ + Arguments: []interface{}{"foobar"}, + }) + //var t *testing.T + //for i := 0; i <= b.N; i++ { + // testRule(t, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ + // Arguments: []interface{}{"foobar"}, + // }) + //} } diff --git a/test/import-blacklist_test.go b/test/import-blacklist_test.go index d427f0b..4df739b 100644 --- a/test/import-blacklist_test.go +++ b/test/import-blacklist_test.go @@ -17,10 +17,7 @@ func TestImportsBlacklist(t *testing.T) { func BenchmarkImportsBlacklist(b *testing.B) { args := []interface{}{"crypto/md5", "crypto/sha1"} - var t *testing.T - for i := 0; i <= b.N; i++ { - testRule(t, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{ - Arguments: args, - }) - } + benchRule(b, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{ + Arguments: args, + }) } diff --git a/test/unused-param_test.go b/test/unused-param_test.go index 7b6472c..4c0e24f 100644 --- a/test/unused-param_test.go +++ b/test/unused-param_test.go @@ -11,8 +11,5 @@ func TestUnusedParam(t *testing.T) { } func BenchmarkUnusedParam(b *testing.B) { - var t *testing.T - for i := 0; i <= b.N; i++ { - testRule(t, "unused-param", &rule.UnusedParamRule{}) - } + benchRule(b, "unused-param", &rule.UnusedParamRule{}) } diff --git a/test/utils.go b/test/utils.go index 7d76268..de56299 100644 --- a/test/utils.go +++ b/test/utils.go @@ -6,7 +6,6 @@ import ( "fmt" "go/ast" "go/parser" - "go/printer" "go/token" "go/types" "io/ioutil" @@ -19,14 +18,42 @@ import ( "github.com/pkg/errors" ) +const fixtureBasePath = "../fixtures/" + +func benchRule(b *testing.B, filename string, rule lint.Rule, config ...*lint.RuleConfig) { + fixturePath := fixtureBasePath + filename + ".go" + stat, err := os.Stat(fixturePath) + if err != nil { + b.Fatalf("Cannot get file info for %s: %v", rule.Name(), err) + } + c := map[string]lint.RuleConfig{} + if config != nil { + c[rule.Name()] = *config[0] + } + + l := lint.New(func(file string) ([]byte, error) { + return ioutil.ReadFile(fixtureBasePath + file) + }) + + for i := 0; i < b.N; i++ { + ps, err := l.Lint([][]string{{stat.Name()}}, []lint.Rule{rule}, lint.Config{ + Rules: c, + }) + if err != nil { + b.Fatalf("Unexpected error: %s", err) + } + for range ps { + } + } +} + func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.RuleConfig) { - baseDir := "../fixtures/" - filename = filename + ".go" - src, err := ioutil.ReadFile(baseDir + filename) + fixturePath := fixtureBasePath + filename + ".go" + src, err := ioutil.ReadFile(fixturePath) if err != nil { t.Fatalf("Bad filename path in test for %s: %v", rule.Name(), err) } - stat, err := os.Stat(baseDir + filename) + stat, err := os.Stat(fixturePath) if err != nil { t.Fatalf("Cannot get file info for %s: %v", rule.Name(), err) } @@ -35,10 +62,16 @@ func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.Rul c[rule.Name()] = *config[0] } if parseInstructions(t, filename, src) == nil { - assertSuccess(t, baseDir, stat, []lint.Rule{rule}, c) + err := assertSuccess(t, fixtureBasePath, stat, []lint.Rule{rule}, c) + if err != nil { + t.Fatalf("Cannot invoke 'assertSuccess' for %s: %v", rule.Name(), err) + } return } - assertFailures(t, baseDir, stat, src, []lint.Rule{rule}, c) + err = assertFailures(t, fixtureBasePath, stat, src, []lint.Rule{rule}, c) + if err != nil { + t.Fatalf("Cannot invoke 'assertFailures' for %s: %v", rule.Name(), err) + } } func assertSuccess(t *testing.T, baseDir string, fi os.FileInfo, rules []lint.Rule, config map[string]lint.RuleConfig) error { @@ -46,7 +79,7 @@ func assertSuccess(t *testing.T, baseDir string, fi os.FileInfo, rules []lint.Ru return ioutil.ReadFile(baseDir + file) }) - ps, err := l.Lint([][]string{[]string{fi.Name()}}, rules, lint.Config{ + ps, err := l.Lint([][]string{{fi.Name()}}, rules, lint.Config{ Rules: config, }) if err != nil { @@ -73,7 +106,7 @@ func assertFailures(t *testing.T, baseDir string, fi os.FileInfo, src []byte, ru return errors.Errorf("Test file %v does not have instructions", fi.Name()) } - ps, err := l.Lint([][]string{[]string{fi.Name()}}, rules, lint.Config{ + ps, err := l.Lint([][]string{{fi.Name()}}, rules, lint.Config{ Rules: config, }) if err != nil { @@ -200,14 +233,6 @@ func extractReplacement(line string) (string, bool) { return line[a+len(start) : b], true } -func render(fset *token.FileSet, x interface{}) string { - var buf bytes.Buffer - if err := printer.Fprint(&buf, fset, x); err != nil { - panic(err) - } - return buf.String() -} - func srcLine(src []byte, p token.Position) string { // Run to end of line in both directions if not at line start/end. lo, hi := p.Offset, p.Offset+1 From 9bb943735e075b302ac6504689bb2f0c36a6fd3f Mon Sep 17 00:00:00 2001 From: dshemin Date: Thu, 28 Nov 2019 10:14:21 +0700 Subject: [PATCH 28/30] Fix review comments --- .gitignore | 1 - rule/file-header.go | 84 ++++++++++++----------------------- test/file-header_test.go | 6 --- test/import-blacklist_test.go | 9 ++-- test/unused-param_test.go | 5 ++- 5 files changed, 39 insertions(+), 66 deletions(-) diff --git a/.gitignore b/.gitignore index 77068c9..9b8cdca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.idea golinter revive vendor diff --git a/rule/file-header.go b/rule/file-header.go index 145f914..570dccf 100644 --- a/rule/file-header.go +++ b/rule/file-header.go @@ -1,7 +1,6 @@ package rule import ( - "go/ast" "regexp" "github.com/mgechev/revive/lint" @@ -10,68 +9,33 @@ import ( // FileHeaderRule lints given else constructs. type FileHeaderRule struct{} -// Apply applies the rule to given file. -func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure { - var failures []lint.Failure - - header, ok := arguments[0].(string) - if !ok { - panic("Invalid argument to the FileHeaderRule") - } - - regex, err := regexp.Compile(header) - if err != nil { - panic(err.Error()) - } - - fileAst := file.AST - walker := lintFileHeader{ - file: file, - fileAst: fileAst, - regex: regex, - onFailure: func(failure lint.Failure) { - failures = append(failures, failure) - }, - } - - ast.Walk(walker, fileAst) - - return failures -} - -// Name returns the rule name. -func (r *FileHeaderRule) Name() string { - return "file-header" -} - -type lintFileHeader struct { - file *lint.File - fileAst *ast.File - regex *regexp.Regexp - onFailure func(lint.Failure) -} - var ( multiRegexp = regexp.MustCompile("^/\\*") singleRegexp = regexp.MustCompile("^//") ) -func (w lintFileHeader) Visit(_ ast.Node) ast.Visitor { - failure := lint.Failure{ - Node: w.fileAst, - Confidence: 1, - Failure: "the file doesn't have an appropriate header", +// Apply applies the rule to given file. +func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure { + header, ok := arguments[0].(string) + if !ok { + panic("Invalid argument to the FileHeaderRule") } - if len(w.fileAst.Comments) == 0 { - w.onFailure(failure) - return nil + failure := []lint.Failure{ + { + Node: file.AST, + Confidence: 1, + Failure: "the file doesn't have an appropriate header", + }, } - g := w.fileAst.Comments[0] + if len(file.AST.Comments) == 0 { + return failure + } + + g := file.AST.Comments[0] if g == nil { - w.onFailure(failure) - return nil + return failure } comment := "" for _, c := range g.List { @@ -84,8 +48,18 @@ func (w lintFileHeader) Visit(_ ast.Node) ast.Visitor { comment += text } - if !w.regex.Match([]byte(comment)) { - w.onFailure(failure) + regex, err := regexp.Compile(header) + if err != nil { + panic(err.Error()) + } + + if !regex.Match([]byte(comment)) { + return failure } return nil } + +// Name returns the rule name. +func (r *FileHeaderRule) Name() string { + return "file-header" +} diff --git a/test/file-header_test.go b/test/file-header_test.go index eae1350..773b294 100644 --- a/test/file-header_test.go +++ b/test/file-header_test.go @@ -37,10 +37,4 @@ func BenchmarkLintFileHeader(b *testing.B) { benchRule(b, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ Arguments: []interface{}{"foobar"}, }) - //var t *testing.T - //for i := 0; i <= b.N; i++ { - // testRule(t, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ - // Arguments: []interface{}{"foobar"}, - // }) - //} } diff --git a/test/import-blacklist_test.go b/test/import-blacklist_test.go index 4df739b..d427f0b 100644 --- a/test/import-blacklist_test.go +++ b/test/import-blacklist_test.go @@ -17,7 +17,10 @@ func TestImportsBlacklist(t *testing.T) { func BenchmarkImportsBlacklist(b *testing.B) { args := []interface{}{"crypto/md5", "crypto/sha1"} - benchRule(b, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{ - Arguments: args, - }) + var t *testing.T + for i := 0; i <= b.N; i++ { + testRule(t, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{ + Arguments: args, + }) + } } diff --git a/test/unused-param_test.go b/test/unused-param_test.go index 4c0e24f..7b6472c 100644 --- a/test/unused-param_test.go +++ b/test/unused-param_test.go @@ -11,5 +11,8 @@ func TestUnusedParam(t *testing.T) { } func BenchmarkUnusedParam(b *testing.B) { - benchRule(b, "unused-param", &rule.UnusedParamRule{}) + var t *testing.T + for i := 0; i <= b.N; i++ { + testRule(t, "unused-param", &rule.UnusedParamRule{}) + } } From 98b0cb55b7b745598077ca2d7ba425634ae4d107 Mon Sep 17 00:00:00 2001 From: dshemin Date: Thu, 28 Nov 2019 10:19:08 +0700 Subject: [PATCH 29/30] Revert benchmark code --- test/file-header_test.go | 9 ++++-- test/utils.go | 59 ++++++++++++---------------------------- 2 files changed, 23 insertions(+), 45 deletions(-) diff --git a/test/file-header_test.go b/test/file-header_test.go index 773b294..a8cbcba 100644 --- a/test/file-header_test.go +++ b/test/file-header_test.go @@ -34,7 +34,10 @@ func TestLintFileHeader(t *testing.T) { } func BenchmarkLintFileHeader(b *testing.B) { - benchRule(b, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ - Arguments: []interface{}{"foobar"}, - }) + var t *testing.T + for i := 0; i <= b.N; i++ { + testRule(t, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{ + Arguments: []interface{}{"foobar"}, + }) + } } diff --git a/test/utils.go b/test/utils.go index de56299..7d76268 100644 --- a/test/utils.go +++ b/test/utils.go @@ -6,6 +6,7 @@ import ( "fmt" "go/ast" "go/parser" + "go/printer" "go/token" "go/types" "io/ioutil" @@ -18,42 +19,14 @@ import ( "github.com/pkg/errors" ) -const fixtureBasePath = "../fixtures/" - -func benchRule(b *testing.B, filename string, rule lint.Rule, config ...*lint.RuleConfig) { - fixturePath := fixtureBasePath + filename + ".go" - stat, err := os.Stat(fixturePath) - if err != nil { - b.Fatalf("Cannot get file info for %s: %v", rule.Name(), err) - } - c := map[string]lint.RuleConfig{} - if config != nil { - c[rule.Name()] = *config[0] - } - - l := lint.New(func(file string) ([]byte, error) { - return ioutil.ReadFile(fixtureBasePath + file) - }) - - for i := 0; i < b.N; i++ { - ps, err := l.Lint([][]string{{stat.Name()}}, []lint.Rule{rule}, lint.Config{ - Rules: c, - }) - if err != nil { - b.Fatalf("Unexpected error: %s", err) - } - for range ps { - } - } -} - func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.RuleConfig) { - fixturePath := fixtureBasePath + filename + ".go" - src, err := ioutil.ReadFile(fixturePath) + baseDir := "../fixtures/" + filename = filename + ".go" + src, err := ioutil.ReadFile(baseDir + filename) if err != nil { t.Fatalf("Bad filename path in test for %s: %v", rule.Name(), err) } - stat, err := os.Stat(fixturePath) + stat, err := os.Stat(baseDir + filename) if err != nil { t.Fatalf("Cannot get file info for %s: %v", rule.Name(), err) } @@ -62,16 +35,10 @@ func testRule(t *testing.T, filename string, rule lint.Rule, config ...*lint.Rul c[rule.Name()] = *config[0] } if parseInstructions(t, filename, src) == nil { - err := assertSuccess(t, fixtureBasePath, stat, []lint.Rule{rule}, c) - if err != nil { - t.Fatalf("Cannot invoke 'assertSuccess' for %s: %v", rule.Name(), err) - } + assertSuccess(t, baseDir, stat, []lint.Rule{rule}, c) return } - err = assertFailures(t, fixtureBasePath, stat, src, []lint.Rule{rule}, c) - if err != nil { - t.Fatalf("Cannot invoke 'assertFailures' for %s: %v", rule.Name(), err) - } + assertFailures(t, baseDir, stat, src, []lint.Rule{rule}, c) } func assertSuccess(t *testing.T, baseDir string, fi os.FileInfo, rules []lint.Rule, config map[string]lint.RuleConfig) error { @@ -79,7 +46,7 @@ func assertSuccess(t *testing.T, baseDir string, fi os.FileInfo, rules []lint.Ru return ioutil.ReadFile(baseDir + file) }) - ps, err := l.Lint([][]string{{fi.Name()}}, rules, lint.Config{ + ps, err := l.Lint([][]string{[]string{fi.Name()}}, rules, lint.Config{ Rules: config, }) if err != nil { @@ -106,7 +73,7 @@ func assertFailures(t *testing.T, baseDir string, fi os.FileInfo, src []byte, ru return errors.Errorf("Test file %v does not have instructions", fi.Name()) } - ps, err := l.Lint([][]string{{fi.Name()}}, rules, lint.Config{ + ps, err := l.Lint([][]string{[]string{fi.Name()}}, rules, lint.Config{ Rules: config, }) if err != nil { @@ -233,6 +200,14 @@ func extractReplacement(line string) (string, bool) { return line[a+len(start) : b], true } +func render(fset *token.FileSet, x interface{}) string { + var buf bytes.Buffer + if err := printer.Fprint(&buf, fset, x); err != nil { + panic(err) + } + return buf.String() +} + func srcLine(src []byte, p token.Position) string { // Run to end of line in both directions if not at line start/end. lo, hi := p.Offset, p.Offset+1 From a5c77eed9f55c14e21b91187ce05a4bd95aa5e07 Mon Sep 17 00:00:00 2001 From: dshemin Date: Mon, 2 Dec 2019 02:04:49 +0700 Subject: [PATCH 30/30] Add check for argument length to "file-header" rule --- rule/file-header.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rule/file-header.go b/rule/file-header.go index 570dccf..6df974e 100644 --- a/rule/file-header.go +++ b/rule/file-header.go @@ -16,9 +16,13 @@ var ( // Apply applies the rule to given file. func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure { + if len(arguments) != 1 { + panic(`invalid configuration for "file-header" rule`) + } + header, ok := arguments[0].(string) if !ok { - panic("Invalid argument to the FileHeaderRule") + panic(`invalid argument for "file-header" rule: first argument should be a string`) } failure := []lint.Failure{