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

chore: format code about exported function should have comment #183

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chaosi-zju
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

chore: format code about exported function should have comment

Which issue(s) this PR fixes:

Fixes part of karmada-io/karmada#6078

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 26, 2025
@karmada-bot karmada-bot requested review from jhnine and samzong January 26, 2025 07:21
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 26, 2025
@chaosi-zju
Copy link
Member Author

chaosi-zju commented Jan 26, 2025

@seanlaii thanks for reviewing

besides, here may still be some revive type error other than exported function should have comment, would you like to continue to handle those revive type lint error?

so sorry that I tagged the wrong person !

@chaosi-zju
Copy link
Member Author

@warjiang thanks for reviewing

besides, here may still be some revive type error other than exported function should have comment, would you like to continue to handle those revive type lint error?

@warjiang
Copy link
Contributor

@warjiang thanks for reviewing

besides, here may still be some revive type error other than exported function should have comment, would you like to continue to handle those revive type lint error?

glad to handle kind of lint errors reported by revive, may be we can split the huge task into small tasks,

dashboard/.golangci.yml

Lines 54 to 85 in 5648666

revive:
rules:
# Disable if-return as it is too strict and not always useful.
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return
- name: if-return
disabled: true
- name: package-comments
- name: superfluous-else
arguments:
- preserveScope
- name: error-strings
- name: error-return
- name: receiver-naming
- name: increment-decrement
- name: range
- name: error-naming
- name: dot-imports
- name: errorf
- name: exported
- name: var-declaration
- name: blank-imports
- name: indent-error-flow
- name: unreachable-code
- name: var-naming
- name: redefines-builtin-id
- name: unused-parameter
- name: context-as-argument
- name: context-keys-type
- name: unexported-return
- name: time-naming
- name: empty-block

like splitting task by rule name

@chaosi-zju
Copy link
Member Author

like splitting task by rule name

good advice !

@warjiang
Copy link
Contributor

/assign

@@ -107,6 +108,7 @@ func CheckAppStatus(c *gin.Context) {
c.JSON(http.StatusOK, statusMap)
}

// HandleSyncOperation handles the sync operation for a specific app or all apps.
Copy link
Contributor

Choose a reason for hiding this comment

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

// HandleSyncOperation handles the sync operation for a specific app, if not specified, it handles the sync operation for all apps

@@ -24,8 +24,10 @@ import (

// The code below allows to perform complex data section on []api.ConfigMap

// ConfigMapCell is a cell in the table of configmaps.
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigMapCell wraps api.ConfigMap for data selection.

@@ -24,8 +24,10 @@ import (

// The code below allows to perform complex data section on []extensions.Ingress

// IngressCell is a cell in the table of ingress.
Copy link
Contributor

Choose a reason for hiding this comment

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

// IngressCell wraps v1.Ingress for data selection.

@@ -27,8 +27,10 @@ import (

// The code below allows to perform complex data section on []apps.StatefulSet

// StatefulSetCell is a cell in the table of statefulsets.
Copy link
Contributor

Choose a reason for hiding this comment

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

// StatefulSetCell wraps apps.StatefulSet for data selection.

@@ -22,8 +22,10 @@ import (
"github.com/karmada-io/dashboard/pkg/dataselect"
)

// PodCell is a cell for pod.
Copy link
Contributor

Choose a reason for hiding this comment

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

// PodCell wraps api.Pod for data selection.

@@ -42,6 +42,7 @@ type OverridePolicyList struct {
Errors []error `json:"errors"`
}

// OverridePolicy contains information about a single propagation.
Copy link
Contributor

Choose a reason for hiding this comment

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

a single propagation should be corrected to a single override.

@@ -22,8 +22,10 @@ import (
"github.com/karmada-io/dashboard/pkg/dataselect"
)

// NodeCell represents a cell in the table of nodes.
Copy link
Contributor

Choose a reason for hiding this comment

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

// NodeCell wraps api.Node for data selection.

@@ -128,6 +130,7 @@ func GetJobListFromChannels(channels *common.ResourceChannels, dsQuery *datasele
return jobList, nil
}

// ToJobList returns a list of all Jobs in the cluster reading required resource list once from the channel.
Copy link
Contributor

Choose a reason for hiding this comment

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

what about the following description
// ToJobList returns a list of Jobs in the cluster by reading required resource list returned from the channel.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from warjiang. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@warjiang
Copy link
Contributor

I've just reviewed the PR, a great deal of contributions 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants