diff --git a/.goreleaser.yml b/.goreleaser.yml index f6c27dec..4db4c419 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -43,7 +43,7 @@ changelog: exclude: - '^docs:' - '^test:' - - 'README.md' + - 'README' - Merge pull request - Merge branch diff --git a/.travis.yml b/.travis.yml index 54177899..36df5842 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: go go: - 1.9.x - 1.10.x -script: make test +script: make check_generated test after_success: - test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" diff --git a/Makefile b/Makefile index 0f6d4424..9c5263de 100644 --- a/Makefile +++ b/Makefile @@ -7,4 +7,13 @@ test: golangci-lint run --fast --no-config -v ./test/testdata/typecheck.go go test -v -race ./... +assets: + svg-term --cast=183662 --out docs/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile Dracula --term iterm2 + +readme: + go run ./scripts/gen_readme/main.go + +check_generated: + make readme && git diff --exit-code # check no changes + .PHONY: test \ No newline at end of file diff --git a/README.md b/README.md index 5646976c..04546742 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running lint - * [Install](#install) * [Demo](#demo) + * [Install](#install) * [Quick Start](#quick-start) * [Comparison](#comparison) * [golangci-lint vs gometalinter](#golangci-lint-vs-gometalinter) @@ -31,6 +31,14 @@ Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running lint * [Future Plans](#future-plans) * [Contact Information](#contact-information) +# Demo +

+ +

+ +Short 1.5 min video demo of analyzing [beego](https://github.com/astaxie/beego). +[![asciicast](https://asciinema.org/a/183662.png)](https://asciinema.org/a/183662) + # Install Recommended way to install is: ```bash @@ -49,12 +57,6 @@ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | Check the [releases page](https://github.com/golangci/golangci-lint/releases) to fix the version. -# Demo -Example of output: -![Screenshot of sample output](docs/run_screenshot.png) - -Short 1.5 min video demo of analyzing [beego](https://github.com/astaxie/beego). -[![asciicast](https://asciinema.org/a/1a1qaEXMlOSeRyvASbnuFomah.png)](https://asciinema.org/a/1a1qaEXMlOSeRyvASbnuFomah) # Quick Start To run golangci-lint execute: diff --git a/README.md.tmpl b/README.md.tmpl index 5666bb74..60bca190 100644 --- a/README.md.tmpl +++ b/README.md.tmpl @@ -9,8 +9,8 @@ Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running lint - * [Install](#install) * [Demo](#demo) + * [Install](#install) * [Quick Start](#quick-start) * [Comparison](#comparison) * [golangci-lint vs gometalinter](#golangci-lint-vs-gometalinter) @@ -31,6 +31,14 @@ Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running lint * [Future Plans](#future-plans) * [Contact Information](#contact-information) +# Demo +

+ +

+ +Short 1.5 min video demo of analyzing [beego](https://github.com/astaxie/beego). +[![asciicast](https://asciinema.org/a/183662.png)](https://asciinema.org/a/183662) + # Install Recommended way to install is: ```bash @@ -49,12 +57,6 @@ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | Check the [releases page](https://github.com/golangci/golangci-lint/releases) to fix the version. -# Demo -Example of output: -![Screenshot of sample output](docs/run_screenshot.png) - -Short 1.5 min video demo of analyzing [beego](https://github.com/astaxie/beego). -[![asciicast](https://asciinema.org/a/1a1qaEXMlOSeRyvASbnuFomah.png)](https://asciinema.org/a/1a1qaEXMlOSeRyvASbnuFomah) # Quick Start To run golangci-lint execute: diff --git a/docs/demo.svg b/docs/demo.svg new file mode 100644 index 00000000..da93b49d --- /dev/null +++ b/docs/demo.svg @@ -0,0 +1 @@ +~/go/src/github.com/astaxie/beego(master)$golangci-lint~/go/src/github.com/astaxie/beego(master)$golangci-lintrunadmin.go:85:13:Errorreturnvalueof`r.ParseForm`isnotchecked(errcheck)r.ParseForm()^admin.go:88:11:Errorreturnvalueof`rw.Write`isnotchecked(errcheck)rw.Write([]byte("commandnotsupport"))^admin.go:105:15:Errorreturnvalueof`tmpl.Execute`isnotchecked(errcheck)tmpl.Execute(rw,data)^admin.go:160:11:Errorreturnvalueof`rw.Write`isnotchecked(errcheck)admin.go:246:13:Errorreturnvalueof`r.ParseForm`isnotchecked(errcheck)admin.go:268:11:Errorreturnvalueof`rw.Write`isnotchecked(errcheck)rw.Write(dataJSON)admin.go:321:15:Errorreturnvalueof`req.ParseForm`isnotchecked(errcheck)req.ParseForm()^admin.go:366:14:Errorreturnvalueof`tmpl.Execute`isnotchecked(errcheck)tmpl.Execute(rw,data)^app.go:477:30:Errorreturnvalueof`BeeApp.Handlers.InsertFilter`isnotchecked(errcheck)BeeApp.Handlers.InsertFilter(pattern,pos,filter,params...)^beego.go:106:10:Errorreturnvalueof`os.Chdir`isnotchecked(errcheck)os.Chdir(ap)^cache/file.go:69:16:Errorreturnvalueof`json.Unmarshal`isnotchecked(errcheck)json.Unmarshal([]byte(config),&cfg)^cache/file.go:101:16:Errorreturnvalueof`io.WriteString`isnotchecked(errcheck)io.WriteString(m,key)cache/file.go:126:11:Errorreturnvalueof`GobDecode`isnotchecked(errcheck)GobDecode(fileData,&to)^cache/file.go:182:8:Errorreturnvalueof`fc.Put`isnotchecked(errcheck)fc.Put(key,incr,FileCacheEmbedExpiry)^cache/file.go:195:8:Errorreturnvalueof`fc.Put`isnotchecked(errcheck)fc.Put(key,decr,FileCacheEmbedExpiry)cache/memcache/memcache.go:167:16:Errorreturnvalueof`json.Unmarshal`isnotchecked(errcheck)json.Unmarshal([]byte(config),&cf)cache/memory.go:198:16:Errorreturnvalueof`json.Unmarshal`isnotchecked(errcheck)config/ini.go:77:16:Errorreturnvalueof`buf.ReadByte`isnotchecked(errcheck)buf.ReadByte()context/context.go:86:26:Errorreturnvalueof`ctx.ResponseWriter.Write`isnotchecked(errcheck)ctx.ResponseWriter.Write([]byte(content))^context/input.go:321:34:Errorreturnvalueof`input.Context.Request.ParseForm`isnotchecked(errcheck)input.Context.Request.ParseForm()^context/input.go:444:34:Errorreturnvalueof`input.Context.Request.ParseForm`isnotchecked(errcheck)context/output.go:82:9:Errorreturnvalueof`io.Copy`isnotchecked(errcheck)io.Copy(output.Context.ResponseWriter,buf)^context/output.go:173:18:Errorreturnvalueof`ctx.Output.JSON`isnotchecked(errcheck)ctx.Output.JSON(value,false,false)^context/output.go:180:18:Errorreturnvalueof`ctx.Output.Body`isnotchecked(errcheck)ctx.Output.Body([]byte(err.Error()))context/output.go:361:37:Errorreturnvalueof`output.Context.Input.CruSession.Set`isnotchecked(errcheck)output.Context.Input.CruSession.Set(name,value)^controller.go:235:26:Errorreturnvalueof`ExecuteViewPathTemplate`isnotchecked(errcheck)ExecuteViewPathTemplate(&buf,c.Layout,c.viewPath(),c.Data)^controller.go:261:16:Errorreturnvalueof`BuildTemplate`isnotchecked(errcheck)BuildTemplate(c.viewPath(),buildFiles...)^controller.go:296:28:Errorreturnvalueof`c.Ctx.ResponseWriter.Write`isnotchecked(errcheck)c.Ctx.ResponseWriter.Write([]byte(body))^controller.go:329:19:Errorreturnvalueof`c.Ctx.Output.JSON`isnotchecked(errcheck)c.Ctx.Output.JSON(c.Data["json"],hasIndent,hasEncoding)^controller.go:338:20:Errorreturnvalueof`c.Ctx.Output.JSONP`isnotchecked(errcheck)c.Ctx.Output.JSONP(c.Data["jsonp"],hasIndent)^controller.go:347:18:Errorreturnvalueof`c.Ctx.Output.XML`isnotchecked(errcheck)c.Ctx.Output.XML(c.Data["xml"],hasIndent)controller.go:366:26:Errorreturnvalueof`c.Ctx.Request.ParseForm`isnotchecked(errcheck)c.Ctx.Request.ParseForm()controller.go:562:9:Errorreturnvalueof`io.Copy`isnotchecked(errcheck)io.Copy(f,file)controller.go:579:18:Errorreturnvalueof`c.CruSession.Set`isnotchecked(errcheck)c.CruSession.Set(name,value)controller.go:595:21:Errorreturnvalueof`c.CruSession.Delete`isnotchecked(errcheck)c.CruSession.Delete(name)^controller.go:610:30:Errorreturnvalueof`c.Ctx.Input.CruSession.Flush`isnotchecked(errcheck)c.Ctx.Input.CruSession.Flush()error.go:101:11:Errorreturnvalueof`t.Execute`isnotchecked(errcheck)t.Execute(ctx.ResponseWriter,data)error.go:374:11:Errorreturnvalueof`t.Execute`isnotchecked(errcheck)t.Execute(rw,data)grace/listener.go:37:17:Errorreturnvalueof`tc.SetKeepAlive`isnotchecked(errcheck)tc.SetKeepAlive(true)^grace/listener.go:38:23:Errorreturnvalueof`tc.SetKeepAlivePeriod`isnotchecked(errcheck)tc.SetKeepAlivePeriod(3*time.Minute)hooks.go:17:24:Errorreturnvalueof`mime.AddExtensionType`isnotchecked(errcheck)mime.AddExtensionType(k,v)^httplib/httplib.go:383:28:Errorreturnvalueof`bodyWriter.WriteField`isnotchecked(errcheck)bodyWriter.WriteField(k,vv)^logs/conn.go:94:23:Errorreturnvalueof`tcpConn.SetKeepAlive`isnotchecked(errcheck)tcpConn.SetKeepAlive(true)logs/file.go:167:11:Errorreturnvalueof`os.Chmod`isnotchecked(errcheck)os.Chmod(w.Filename,os.FileMode(perm))logs/file.go:300:15:Errorreturnvalueof`filepath.Walk`isnotchecked(errcheck)filepath.Walk(dir,func(pathstring,infoos.FileInfo,errerror)(returnErrerror){logs/file.go:330:19:Errorreturnvalueof`w.fileWriter.Sync`isnotchecked(errcheck)w.fileWriter.Sync()logs/log.go:153:14:Errorreturnvalueof`bl.setLogger`isnotchecked(errcheck)bl.setLogger(AdapterConsole)logs/log.go:263:15:Errorreturnvalueof`bl.setLogger`isnotchecked(errcheck)bl.setLogger(AdapterConsole)logs/log.go:355:13:Errorreturnvalueof`bl.writeMsg`isnotchecked(errcheck)bl.writeMsg(LevelEmergency,format,v...)logs/log.go:363:13:Errorreturnvalueof`bl.writeMsg`isnotchecked(errcheck)bl.writeMsg(LevelAlert,format,v...)logs/smtp.go:78:G402:TLSInsecureSkipVerifysettrue.(gas)InsecureSkipVerify:true,orm/db.go:283:G201:SQLstringformatting(gas)query:=fmt.Sprintf("INSERTINTO%s%s%s(%s%s%s)VALUES(%s)",Q,mi.table,Q,Q,columns,Q,qmarks)orm/db.go:350:G201:SQLstringformatting(gas)query:=fmt.Sprintf("SELECT%s%s%sFROM%s%s%sWHERE%s%s%s=?%s",Q,sels,Q,Q,mi.table,Q,Q,wheres,Q,forUpdate)orm/db.go:477:G201:SQLstringformatting(gas)orm/db.go:576:G202:SQLstringconcatenation(gas)query:=fmt.Sprintf("INSERTINTO%s%s%s(%s%s%s)VALUES(%s)%s"+qupdates,Q,mi.table,Q,Q,columns,Q,qmarks,iouStr)orm/db_mysql.go:157:G202:SQLstringconcatenation(gas)orm/db_tables.go:387:G202:SQLstringconcatenation(gas)where="WHERE"+wherelogs/alils/request.go:5:G501:Blacklistedimportcrypto/md5:weakcryptographicprimitive(gas)"crypto/md5"logs/alils/request.go:26:G401:Useofweakcryptographicprimitive(gas)bodyMD5:=fmt.Sprintf("%X",md5.Sum(body))cache/file.go:19:G501:Blacklistedimportcrypto/md5:weakcryptographicprimitive(gas)cache/file.go:100:G401:Useofweakcryptographicprimitive(gas)m:=md5.New()controller.go:230:G203:thismethodwillnotauto-escapeHTML.Verifydataiswellformed.(gas)c.Data[sectionName]=template.HTML(buf.String())error.go:372:G203:thismethodwillnotauto-escapeHTML.Verifydataiswellformed.(gas)"Content":template.HTML(errContent),templatefunc.go:272:G203:thismethodwillnotauto-escapeHTML.Verifydataiswellformed.(gas)returntemplate.HTML(text)logs/alils/log.pb.go:328:6:`encodeFixed64Log`isunused(deadcode)funcencodeFixed64Log(data[]byte,offsetint,vuint64)int{^logs/alils/log.pb.go:339:6:`encodeFixed32Log`isunused(deadcode)funcencodeFixed32Log(data[]byte,offsetint,vuint32)int{logs/alils/log.pb.go:447:6:`sozLog`isunused(deadcode)funcsozLog(xuint64)(nint){context/param/methodparams.go:19:2:`param`isunused(deadcode)paramparamType=iota^session/memcache/sess_memcache.go:109:2:`poolsize`isunused(structcheck)poolsizeintsession/memcache/sess_memcache.go:110:2:`password`isunused(structcheck)passwordstringorm/orm_log.go:110:2:`tx`isunused(structcheck)txtxerorm/orm_log.go:111:2:`txe`isunused(structcheck)txetxEnderorm/models_info_f.go:36:2:`rels`isunused(structcheck)rels[]*fieldInfocontroller.go:76:2:`gotofunc`isunused(structcheck)gotofuncstringparser.go:183:42:cutsetcontainsduplicatecharacters(megacheck)t:=strings.TrimSpace(strings.TrimLeft(c.Text,"//"))^parser.go:200:54:cutsetcontainsduplicatecharacters(megacheck)pv:=getparams(strings.TrimSpace(strings.TrimLeft(t,"@Param")))^session/sess_file.go:140:6:thisvalueoferrisneverused(megacheck)f,err=os.OpenFile(path.Join(fp.savePath,string(sid[0]),string(sid[1]),sid),os.O_RDWR,0777)session/sess_file.go:142:6:thisvalueoferrisneverused(megacheck)f,err=os.Create(path.Join(fp.savePath,string(sid[0]),string(sid[1]),sid))cache/memory.go:41:9:shouldusetime.Sinceinsteadoftime.Now().Sub(megacheck)returntime.Now().Sub(mi.createdTime)>mi.lifespanorm/orm_log.go:39:9:shouldusetime.Sinceinsteadoftime.Now().Sub(megacheck)sub:=time.Now().Sub(t)/1e5toolbox/profile.go:109:14:shouldusetime.Sinceinsteadoftime.Now().Sub(megacheck)elapsed:=time.Now().Sub(startTime)orm/db_tables.go:77:20:func(*dbTables).getisunused(megacheck)func(t*dbTables)get(namestring)(*dbTable,bool){~/go/src/github.com/astaxie/beego(master)$#~/go/src/github.com/astaxie/beego(master)$#too~/go/src/github.com/astaxie/beego(master)$#toomuch~/go/src/github.com/astaxie/beego(master)$#toomuchissues,~/go/src/github.com/astaxie/beego(master)$golangci-~/go/src/github.com/astaxie/beego(master)$golangci-l~/go/src/github.com/astaxie/beego(master)$golangci-li~/go/src/github.com/astaxie/beego(master)$golangci-lin~/go/src/github.com/astaxie/beego(master)$golangci-lintr~/go/src/github.com/astaxie/beego(master)$golangci-lintruorm/orm_log.go:39:9:s~/go/src/github.com/astaxie/beego(master)$~/go/src/github.com/astaxie/beego(master)$#t~/go/src/github.com/astaxie/beego(master)$#to~/go/src/github.com/astaxie/beego(master)$#toom~/go/src/github.com/astaxie/beego(master)$#toomu~/go/src/github.com/astaxie/beego(master)$#toomuc~/go/src/github.com/astaxie/beego(master)$#toomuchi~/go/src/github.com/astaxie/beego(master)$#toomuchis~/go/src/github.com/astaxie/beego(master)$#toomuchiss~/go/src/github.com/astaxie/beego(master)$#toomuchissu~/go/src/github.com/astaxie/beego(master)$#toomuchissue~/go/src/github.com/astaxie/beego(master)$#toomuchissues~/go/src/github.com/astaxie/beego(master)$#toomuchissues,l~/go/src/github.com/astaxie/beego(master)$#toomuchissues,le~/go/src/github.com/astaxie/beego(master)$#toomuchissues,let~/go/src/github.com/astaxie/beego(master)$#toomuchissues,let' \ No newline at end of file diff --git a/docs/run_screenshot.png b/docs/run_screenshot.png deleted file mode 100644 index 15063b77..00000000 Binary files a/docs/run_screenshot.png and /dev/null differ