Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint:fix lints #841

Merged
merged 2 commits into from
May 30, 2020
Merged

Lint:fix lints #841

merged 2 commits into from
May 30, 2020

Conversation

Thor-wl
Copy link
Contributor

@Thor-wl Thor-wl commented May 29, 2020

Try to address issue #791

  • add some golangci-lint rules
  • fix some items found by golangci-lint

@volcano-sh-bot
Copy link
Contributor

Welcome @Thor-wl!

It looks like this is your first PR to volcano-sh/volcano 馃帀.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 29, 2020
@TravisBuddy
Copy link

Travis tests have failed

Hey @Thor-wl,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: a94101b0-a18a-11ea-b485-534d9f3e4954

@TravisBuddy
Copy link

Travis tests have failed

Hey @Thor-wl,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: c40b4690-a18f-11ea-b485-534d9f3e4954

if err := setConfigDefaults(&config); err != nil {
return nil, err
}
setConfigDefaults(&config)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those are generated code, so please do not modify them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@TravisBuddy
Copy link

Travis tests have failed

Hey @Thor-wl,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: e51900b0-a217-11ea-a8e9-e7e13745aead

@@ -50,7 +50,7 @@ func (ra *Action) Execute(ssn *framework.Session) {
klog.V(3).Infof("There are <%d> Jobs and <%d> Queues in total for scheduling.",
len(ssn.Jobs), len(ssn.Queues))

var underRequest []*api.JobInfo
// var underRequest []*api.JobInfo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is useless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless variable has been already deleted

if sc.Nodes[node.Name] != nil {
sc.Nodes[node.Name].SetNode(node)
} else {
sc.Nodes[node.Name] = schedulingapi.NewNodeInfo(node)
}

return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recoveried

klog.Errorf("Failed to add node %s into cache: %v", node.Name, err)
return
}
sc.addNode(node)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep oldNode, if not used, try _.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recoveried

@k82cn
Copy link
Member

k82cn commented May 30, 2020

please do not change the signature of function in this PR.

@TravisBuddy
Copy link

Travis tests have failed

Hey @Thor-wl,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 3248f300-a226-11ea-a8e9-e7e13745aead

Signed-off-by: Thor <1187526662@qq.com>
.golangci.yml Outdated
linters-settings:
lll:
line-length: 256
funlen:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can disable this check. In the following pr, we need to first enable that with high priority.

As to the priority, If we have no enough time to analyze I suggest looking at https://github.com/istio/istio/blob/494aca43715d2f970bdb76ce1dfcc5e1095f3070/common/config/.golangci.yml#L34-L53

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

}

if len(job.TaskStatusIndex[api.Pending]) != 0 {
if _, found := preemptorsMap[job.Queue]; !found {
preemptorsMap[job.Queue] = util.NewPriorityQueue(ssn.JobOrderFn)
}
preemptorsMap[job.Queue].Push(job)
underRequest = append(underRequest, job)
// underRequest = append(underRequest, job)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

please address the minor comments in the following pr

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2020
Signed-off-by: Thor <1187526662@qq.com>
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label May 30, 2020
@k82cn
Copy link
Member

k82cn commented May 30, 2020

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2020
@k82cn
Copy link
Member

k82cn commented May 30, 2020

/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu, k82cn, Thor-wl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2020
@volcano-sh-bot volcano-sh-bot merged commit 2a2145b into volcano-sh:master May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants