ci: add reviewdog (#1096)
This commit is contained in:
@@ -197,9 +197,8 @@ func getRoutes(api *spec.ApiSpec) ([]group, error) {
|
||||
}
|
||||
middleware := g.GetAnnotation("middleware")
|
||||
if len(middleware) > 0 {
|
||||
for _, item := range strings.Split(middleware, ",") {
|
||||
groupedRoutes.middlewares = append(groupedRoutes.middlewares, item)
|
||||
}
|
||||
groupedRoutes.middlewares = append(groupedRoutes.middlewares,
|
||||
strings.Split(middleware, ",")...)
|
||||
}
|
||||
routes = append(routes, groupedRoutes)
|
||||
}
|
||||
|
||||
@@ -39,12 +39,6 @@ func genServiceContext(dir, rootPkg string, cfg *config.Config, api *spec.ApiSpe
|
||||
return err
|
||||
}
|
||||
|
||||
authNames := getAuths(api)
|
||||
var auths []string
|
||||
for _, item := range authNames {
|
||||
auths = append(auths, fmt.Sprintf("%s config.AuthConfig", item))
|
||||
}
|
||||
|
||||
var middlewareStr string
|
||||
var middlewareAssignment string
|
||||
middlewares := getMiddleware(api)
|
||||
|
||||
@@ -28,11 +28,7 @@ func JavaCommand(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
packetName := api.Service.Name
|
||||
if strings.HasSuffix(packetName, "-api") {
|
||||
packetName = packetName[:len(packetName)-4]
|
||||
}
|
||||
|
||||
packetName := strings.TrimSuffix(api.Service.Name, "-api")
|
||||
logx.Must(util.MkdirIfNotExist(dir))
|
||||
logx.Must(genPacket(dir, packetName, api))
|
||||
logx.Must(genComponents(dir, packetName, api))
|
||||
|
||||
@@ -204,10 +204,7 @@ func processUri(route spec.Route) string {
|
||||
}
|
||||
}
|
||||
}
|
||||
result := builder.String()
|
||||
if strings.HasSuffix(result, " + \"") {
|
||||
result = result[:len(result)-4]
|
||||
}
|
||||
result := strings.TrimSuffix(builder.String(), " + \"")
|
||||
if strings.HasPrefix(result, "/") {
|
||||
result = strings.TrimPrefix(result, "/")
|
||||
result = "\"" + result
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -155,8 +154,6 @@ func (v *ApiVisitor) VisitTypeStruct(ctx *api.TypeStructContext) interface{} {
|
||||
var st TypeStruct
|
||||
st.Name = v.newExprWithToken(ctx.GetStructName())
|
||||
|
||||
if util.UnExport(ctx.GetStructName().GetText()) {
|
||||
}
|
||||
if ctx.GetStructToken() != nil {
|
||||
structExpr := v.newExprWithToken(ctx.GetStructToken())
|
||||
structTokenText := ctx.GetStructToken().GetText()
|
||||
|
||||
@@ -1087,7 +1087,6 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
|
||||
}
|
||||
p.SetState(105)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserSTRING {
|
||||
{
|
||||
@@ -1447,7 +1446,6 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
|
||||
}
|
||||
p.SetState(120)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserID {
|
||||
{
|
||||
@@ -4102,7 +4100,6 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
|
||||
}
|
||||
p.SetState(245)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserID {
|
||||
{
|
||||
@@ -4627,7 +4624,6 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
|
||||
case ApiParserParserID:
|
||||
p.SetState(277)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserID {
|
||||
{
|
||||
@@ -5461,7 +5457,6 @@ func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
p.SetState(322)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserID {
|
||||
{
|
||||
@@ -5575,7 +5570,6 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
p.SetState(341)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
for ok := true; ok; ok = _la == ApiParserParserT__10 || _la == ApiParserParserT__11 {
|
||||
p.SetState(341)
|
||||
|
||||
Reference in New Issue
Block a user