Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#1293 from camilamacedo86/lint-mali…
Browse files Browse the repository at this point in the history
…gned

enable maligned lint check
  • Loading branch information
k8s-ci-robot authored Jan 16, 2020
2 parents 25e187f + 9398071 commit 308fc49
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
17 changes: 9 additions & 8 deletions cmd/init_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,22 @@ kubebuilder init --domain example.org --license apache2 --owner "The Kubernetes
}

type projectOptions struct {

// flags
fetchDeps bool
skipGoVersionCheck bool

boilerplate project.Boilerplate
project project.Project

// final result
scaffolder scaffold.ProjectScaffolder

// deprecated flags
dep bool
depFlag *flag.Flag
depArgs []string

// final result
scaffolder scaffold.ProjectScaffolder
// flags
fetchDeps bool
skipGoVersionCheck bool

// deprecated flags
dep bool
}

func (o *projectOptions) bindCmdlineFlags(cmd *cobra.Command) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/scaffold/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ import (

// Resource contains the information required to scaffold files for a resource.
type Resource struct {
// Namespaced is true if the resource is namespaced
Namespaced bool

// Group is the API Group. Does not contain the domain.
Group string

Expand All @@ -50,6 +47,9 @@ type Resource struct {

// CreateExampleReconcileBody will create a Deployment in the Reconcile example
CreateExampleReconcileBody bool

// Namespaced is true if the resource is namespaced
Namespaced bool
}

// Validate checks the Resource values to make sure they are valid.
Expand Down
12 changes: 6 additions & 6 deletions pkg/scaffold/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ type Scaffold struct {
// Boilerplate is the contents of the boilerplate file for code generation
Boilerplate string

BoilerplateOptional bool

// Project is the project
Project input.ProjectFile

ProjectOptional bool

// ProjectPath is the relative path to the project root
ProjectPath string

GetWriter func(path string) (io.Writer, error)

FileExists func(path string) bool

// Plugins is the list of plugins we should allow to transform our generated scaffolding
Plugins []Plugin

FileExists func(path string) bool

BoilerplateOptional bool

ProjectOptional bool
}

// Plugin is the interface that a plugin must implement
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ golangci-lint run --disable-all \
--enable=goimports \
--enable=gocyclo \
--enable=goconst \
--enable=maligned \

##todo(camilamacedo86): The following checks requires fixes in the code
# --enable=golint
# --enable=lll
# --enable=gosec
# --enable=maligned

0 comments on commit 308fc49

Please sign in to comment.