Skip to content

Commit

Permalink
chore: Added NOTICE and linting (kubernetes-sigs#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellistarn authored Oct 21, 2022
1 parent 8e09dce commit b390461
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 145 deletions.
64 changes: 64 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
tests: true

timeout: 5m

skip-dirs:
- tools
- website
- hack
- charts
- designs

linters:
enable:
- asciicheck
- bidichk
- errorlint
- exportloopref
- gosec
- revive
- stylecheck
- tparallel
- unconvert
- unparam
- gocyclo
- govet
- goimports
- goheader
- misspell
- nilerr
disable:
- prealloc

linters-settings:
gocyclo:
min-complexity: 11
govet:
check-shadowing: true
misspell:
locale: US
ignore-words: []
goimports:
local-prefixes: github.com/aws/karpenter
goheader:
template: |-
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
issues:
fix: true
exclude: ['declaration of "(err|ctx)" shadows declaration at']
exclude-rules:
- linters:
- goheader
path: 'zz_(.+)\.go'
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

presubmit: verify codegen test ## Run all steps required for code to be checked in
presubmit: verify test ## Run all steps required for code to be checked in

test: ## Run tests
go test -v -run=${TEST_FILTER} ./... \
-race \
-cover -coverprofile=coverage.out -outputdir=. -coverpkg=./...

verify: ## Verify code. Includes dependencies, linting, formatting, etc
verify: codegen ## Verify code. Includes dependencies, linting, formatting, etc
go mod tidy
go vet ./...
golangci-lint run
@git diff --quiet ||\
{ echo "New file modification detected in the Git working tree. Please check in before commit."; git --no-pager diff --name-only | uniq | awk '{print " - " $$0}'; \
if [ $(MAKECMDGOALS) = 'ci' ]; then\
Expand Down
2 changes: 2 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Karpenter
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ require (
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/gobuffalo/flect v0.2.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyr
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobuffalo/flect v0.2.4 h1:BSYA8+T60cdyq+vynaSUjqSVI9mDEg9ZfQUXKmfjo4I=
github.com/gobuffalo/flect v0.2.4/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package apis

import (
Expand All @@ -30,6 +31,6 @@ var (
AddToScheme = Builder.AddToScheme
// Resources defined in the project
Resources = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
v1alpha5.SchemeGroupVersion.WithKind("Provisioner"): &v1alpha5.Provisioner{},
v1alpha5.SchemeGroupVersion.WithKind("Provisioner"): &v1alpha5.Provisioner{},
}
)
10 changes: 5 additions & 5 deletions pkg/apis/provisioning/v1alpha5/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (

var (
// Well known labels and resources
ArchitectureAmd64 = "amd64"
ArchitectureArm64 = "arm64"
OperatingSystemLinux = "linux"
CapacityTypeSpot = "spot"
CapacityTypeOnDemand = "on-demand"
ArchitectureAmd64 = "amd64"
ArchitectureArm64 = "arm64"
OperatingSystemLinux = "linux"
CapacityTypeSpot = "spot"
CapacityTypeOnDemand = "on-demand"

// Karpenter specific domains and labels
KarpenterLabelDomain = "karpenter.sh"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/state/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/aws/karpenter-core/pkg/utils/resources"
"github.com/aws/karpenter-core/pkg/controllers/state"
"github.com/aws/karpenter-core/pkg/utils/resources"

"github.com/aws/karpenter-core/pkg/test"

Expand Down
133 changes: 0 additions & 133 deletions pkg/webhooks/webhooks.go

This file was deleted.

0 comments on commit b390461

Please sign in to comment.