mirror of
https://github.com/hanzo-ml/trainer.git
synced 2026-09-24 00:31:34 +00:00
chore: Enable GCI for golangci-lint (#2540)
Signed-off-by: Yuki Iwai <[email protected]>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# golangci-lint configuration file
|
||||
# see: https://golangci-lint.run/usage/configuration/
|
||||
|
||||
# Settings of specific linters
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard # Standard section: captures all standard packages.
|
||||
- default # Default section: contains all imports that could not be matched to another section type.
|
||||
- prefix(github.com/kubeflow/trainer) # Custom section: groups all imports with the specified Prefix.
|
||||
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
|
||||
- dot # Dot section: contains all dot imports.
|
||||
skip-generated: true # Skip generated files.
|
||||
|
||||
# Settings for enabling and disabling linters
|
||||
linters:
|
||||
enable:
|
||||
- gci
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -38,6 +37,7 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/controller"
|
||||
|
||||
trainer "github.com/kubeflow/trainer/pkg/apis/trainer/v1alpha1"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
jobruntimes "github.com/kubeflow/trainer/pkg/runtime"
|
||||
)
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
apiruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
@@ -25,7 +25,6 @@ import (
|
||||
|
||||
gocmp "github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
apiruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -37,6 +36,7 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
|
||||
|
||||
trainer "github.com/kubeflow/trainer/pkg/apis/trainer/v1alpha1"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
"github.com/kubeflow/trainer/pkg/runtime"
|
||||
"github.com/kubeflow/trainer/pkg/runtime/framework"
|
||||
utiltesting "github.com/kubeflow/trainer/pkg/util/testing"
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
@@ -34,7 +35,6 @@ import (
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
"github.com/kubeflow/trainer/pkg/runtime"
|
||||
"github.com/kubeflow/trainer/pkg/runtime/framework"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
type Torch struct{}
|
||||
|
||||
@@ -26,10 +26,10 @@ import (
|
||||
batchv1ac "k8s.io/client-go/applyconfigurations/batch/v1"
|
||||
corev1ac "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
"k8s.io/utils/ptr"
|
||||
jobsetv1alpha2ac "sigs.k8s.io/jobset/client-go/applyconfiguration/jobset/v1alpha2"
|
||||
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
jobsetplgconsts "github.com/kubeflow/trainer/pkg/runtime/framework/plugins/jobset/constants"
|
||||
jobsetv1alpha2ac "sigs.k8s.io/jobset/client-go/applyconfiguration/jobset/v1alpha2"
|
||||
)
|
||||
|
||||
func TestNewInfo(t *testing.T) {
|
||||
|
||||
@@ -22,8 +22,9 @@ import (
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -26,12 +26,12 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/utils/ptr"
|
||||
jobsetv1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2"
|
||||
schedulerpluginsv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1"
|
||||
|
||||
trainer "github.com/kubeflow/trainer/pkg/apis/trainer/v1alpha1"
|
||||
"github.com/kubeflow/trainer/pkg/constants"
|
||||
jobsetplgconsts "github.com/kubeflow/trainer/pkg/runtime/framework/plugins/jobset/constants"
|
||||
jobsetv1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2"
|
||||
schedulerpluginsv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1"
|
||||
)
|
||||
|
||||
type JobSetWrapper struct {
|
||||
|
||||
Reference in New Issue
Block a user