-
Notifications
You must be signed in to change notification settings - Fork 317
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
use more strict formatting #385
use more strict formatting #385
Conversation
33cef71
to
50e8402
Compare
//key, _ := cmd.Flags().GetString("key") | ||
//value, _ := cmd.Flags().GetString("value") | ||
// key, _ := cmd.Flags().GetString("key") | ||
// value, _ := cmd.Flags().GetString("value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, that's great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! The less we have to think about format, the better :)
@wilsonwang371 |
50e8402
to
6808902
Compare
|
||
- name: Open this to see how to fix gofumpt if it fails | ||
run: | | ||
echo "Run command 'gofumpt -w apiserver/ ray-operator/ cli/' to correct your code format." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: will this check correct the import format? for example:
https://github.com/ray-project/kuberay/blob/master/ray-operator/controllers/ray/raycluster_controller.go#L3-L37
import (
"context"
"fmt"
"strings"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/ray-project/kuberay/ray-operator/controllers/ray/common"
"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
rbacv1 "k8s.io/api/rbac/v1"
rayiov1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
"k8s.io/client-go/tools/record"
"github.com/go-logr/logr"
_ "k8s.io/api/apps/v1beta1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
controller "sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/handler"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
)
would need some format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will check the imports but the code you show will pass the check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, it seems like some codes writing practice issues and gofumpt may not correct them, in this case we may need to modify manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
ef505c7
to
1f876b2
Compare
@wilsonwang371 Let's rebase the change and we can unblock the PR. |
1f876b2
to
69a58e7
Compare
* use more strict formatting * rebase master * update makefile
Why are these changes needed?
Use a more strict format check with gofumpt
We discussed this a long time before. Due to some conflicts with our internal branch, we postponed this until now. Since our downstream branch and upstream branch is in sync now, it is a good time for us to apply a more strict code formatting on kuberay.
Related issue number
N/A
Checks