Skip to content

Commit

Permalink
chore: partially apply staticcheck rule ST1000 (#596)
Browse files Browse the repository at this point in the history
The ST1000 rule has been applied to everything except the `brokerapi`
and `pkg` directories. Those can be updated in a future chore.
  • Loading branch information
blgm authored Aug 17, 2022
1 parent 45f8bbf commit 105488d
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ vet: ## Runs go vet
${GO} vet ./...

staticcheck: ## Runs staticcheck
${GO} run honnef.co/go/tools/cmd/staticcheck ./...
${GO} list ./... | grep -v 'fakes$$' | xargs ${GO} run honnef.co/go/tools/cmd/staticcheck

###### Format #################################################################

Expand Down
1 change: 1 addition & 0 deletions brokerapi/staticcheck.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
checks = ["all", "-ST1000"]
2 changes: 2 additions & 0 deletions brokerpaktestframework/brokerpaktestframework.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package brokerpaktestframework implements a test framework that can be used by brokerpaks for testing
package brokerpaktestframework
2 changes: 2 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package cmd implements a command line interface using Cobra
package cmd
1 change: 1 addition & 0 deletions dbservice/dbservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package dbservice implements database setup, connection, and migration
package dbservice

import (
Expand Down
1 change: 1 addition & 0 deletions dbservice/models/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package models implements database object models for use with GORM
package models

const (
Expand Down
2 changes: 2 additions & 0 deletions integrationtest/helper/helper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package helper implements some test helpers for the integration tests
package helper
1 change: 1 addition & 0 deletions internal/brokerpak/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package platform is a utility for handling platform data
package platform

import (
Expand Down
1 change: 1 addition & 0 deletions internal/brokerpak/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package reader is for reading manifest files
package reader

import (
Expand Down
1 change: 1 addition & 0 deletions internal/createservice/create_service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package createservice is an experimental mimic for the "cf create-service" command
package createservice

import (
Expand Down
1 change: 1 addition & 0 deletions internal/encryption/compoundencryptor/compoundencryptor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package compoundencryptor allows encryptors to be combined
package compoundencryptor

import "github.com/cloudfoundry/cloud-service-broker/internal/storage"
Expand Down
2 changes: 2 additions & 0 deletions internal/encryption/encryption.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package encryption handles encryption of secrets
package encryption
1 change: 1 addition & 0 deletions internal/encryption/gcmencryptor/gcmencryptor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package gcmencryptor implements AES GCM encryption
package gcmencryptor

import (
Expand Down
1 change: 1 addition & 0 deletions internal/encryption/noopencryptor/noopencryptor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package noopencryptor looks like an encryptor but doesn't do any encryption
package noopencryptor

func New() NoopEncryptor {
Expand Down
1 change: 1 addition & 0 deletions internal/encryption/passwordcombiner/combiner.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package passwordcombiner combines passwords with salt to create encryption keys
package passwordcombiner

import (
Expand Down
1 change: 1 addition & 0 deletions internal/encryption/passwordparser/parser.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package passwordparser parses password data
package passwordparser

import (
Expand Down
1 change: 1 addition & 0 deletions internal/infohandler/infohandler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package infohandler handles the /info endpoint
package infohandler

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/paramparser/paramparser.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package paramparser handles the parsing of parameters from brokerapi
package paramparser
1 change: 1 addition & 0 deletions internal/storage/storage.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package storage implements a Database Access Object (DAO)
package storage

import "gorm.io/gorm"
Expand Down
1 change: 1 addition & 0 deletions internal/testmatchers/directory_contents_matcher.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package testmatchers implements custom test matchers
package testmatchers

import (
Expand Down
1 change: 1 addition & 0 deletions internal/tfproviderfqn/tfproviderfqn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package tfproviderfqn implements fully qualified Terraform provider names
package tfproviderfqn

import "fmt"
Expand Down
1 change: 1 addition & 0 deletions pkg/staticcheck.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
checks = ["all", "-ST1000"]
2 changes: 1 addition & 1 deletion staticcheck.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
checks = ["all", "-ST1000"]
checks = ["all"]
1 change: 1 addition & 0 deletions utils/correlation/correlation.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package correlation reads correlation IDs from the context for logging
package correlation

import (
Expand Down
1 change: 1 addition & 0 deletions utils/freeport/freeport.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package freeport identifies a random unused port
package freeport

import (
Expand Down
1 change: 1 addition & 0 deletions utils/request/request_parser.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package request decodes the originating identity header
package request

import (
Expand Down
1 change: 1 addition & 0 deletions utils/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package stream implements streaming a bit like 'gulp' on nodejs
package stream

import (
Expand Down
3 changes: 3 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package utils contains various utils that do various things.
// It is deprecated and any future utils should be added as an appropriately named sub-package.
// Over time this package should be emptied.
package utils

import (
Expand Down

0 comments on commit 105488d

Please sign in to comment.