Skip to content

Commit

Permalink
makefile: remove useless linter and enable revive for distsql (#36607)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Jul 27, 2022
1 parent b70207d commit 0f692b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ goword:tools/bin/goword
check-static: tools/bin/golangci-lint
GO111MODULE=on CGO_ENABLED=0 tools/bin/golangci-lint run -v $$($(PACKAGE_DIRECTORIES)) --config .golangci.yml

unconvert:tools/bin/unconvert
@echo "unconvert check(skip check the generated or copied code in lightning)"
@GO111MODULE=on tools/bin/unconvert $(UNCONVERT_PACKAGES)

gogenerate:
@echo "go generate ./..."
./tools/check/check-gogenerate.sh
Expand Down Expand Up @@ -211,22 +207,10 @@ tools/bin/xprog: tools/check/xprog.go
cd tools/check; \
$(GO) build -o ../bin/xprog xprog.go

tools/bin/megacheck: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/megacheck honnef.co/go/tools/cmd/megacheck

tools/bin/revive: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/revive github.com/mgechev/revive

tools/bin/goword: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/goword github.com/chzchzchz/goword

tools/bin/unconvert: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/unconvert github.com/mdempsky/unconvert

tools/bin/failpoint-ctl: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/failpoint-ctl github.com/pingcap/failpoint/failpoint-ctl
Expand Down
2 changes: 2 additions & 0 deletions build/nogo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
".*_generated\\.go$": "ignore generated code"
},
"only_files": {
"planner/core/rule_partition_eliminate.go": "planner/core/rule_partition_eliminate code",
"distsql/": "ignore distsql code",
"dumpling/export": "dumpling/export code",
"lock/": "lock file",
"errno/": "errno code",
Expand Down
1 change: 0 additions & 1 deletion distsql/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func DispatchMPPTasks(ctx context.Context, sctx sessionctx.Context, tasks []*kv.
rootPlanID: rootID,
storeType: kv.TiFlash,
}, nil

}

// Select sends a DAG request, returns SelectResult.
Expand Down
13 changes: 6 additions & 7 deletions distsql/request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,19 @@ func (builder *RequestBuilder) SetAllowBatchCop(batchCop bool) *RequestBuilder {
}

// SetPartitionIDAndRanges sets `PartitionIDAndRanges` property.
func (builder *RequestBuilder) SetPartitionIDAndRanges(PartitionIDAndRanges []kv.PartitionIDAndRanges) *RequestBuilder {
builder.PartitionIDAndRanges = PartitionIDAndRanges
func (builder *RequestBuilder) SetPartitionIDAndRanges(partitionIDAndRanges []kv.PartitionIDAndRanges) *RequestBuilder {
builder.PartitionIDAndRanges = partitionIDAndRanges
return builder
}

func (builder *RequestBuilder) getIsolationLevel() kv.IsoLevel {
switch builder.Tp {
case kv.ReqTypeAnalyze:
if builder.Tp == kv.ReqTypeAnalyze {
return kv.RC
}
return kv.SI
}

func (builder *RequestBuilder) getKVPriority(sv *variable.SessionVars) int {
func (*RequestBuilder) getKVPriority(sv *variable.SessionVars) int {
switch sv.StmtCtx.Priority {
case mysql.NoPriority, mysql.DelayedPriority:
return kv.PriorityNormal
Expand Down Expand Up @@ -689,7 +688,7 @@ func VerifyTxnScope(txnScope string, physicalTableID int64, is infoschema.InfoSc

func indexRangesToKVWithoutSplit(sc *stmtctx.StatementContext, tids []int64, idxID int64, ranges []*ranger.Range, memTracker *memory.Tracker, interruptSignal *atomic.Value) ([]kv.KeyRange, error) {
krs := make([]kv.KeyRange, 0, len(ranges))
const CheckSignalStep = 8
const checkSignalStep = 8
var estimatedMemUsage int64
// encodeIndexKey and EncodeIndexSeekKey is time-consuming, thus we need to
// check the interrupt signal periodically.
Expand All @@ -709,7 +708,7 @@ func indexRangesToKVWithoutSplit(sc *stmtctx.StatementContext, tids []int64, idx
}
krs = append(krs, kv.KeyRange{StartKey: startKey, EndKey: endKey})
}
if i%CheckSignalStep == 0 {
if i%checkSignalStep == 0 {
if i == 0 && memTracker != nil {
estimatedMemUsage *= int64(len(ranges))
memTracker.Consume(estimatedMemUsage)
Expand Down
2 changes: 1 addition & 1 deletion distsql/select_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,6 @@ func (s *selectResultRuntimeStats) String() string {
}

// Tp implements the RuntimeStats interface.
func (s *selectResultRuntimeStats) Tp() int {
func (*selectResultRuntimeStats) Tp() int {
return execdetails.TpSelectResultRuntimeStats
}

0 comments on commit 0f692b3

Please sign in to comment.