Skip to content

Commit 71980fc

Browse files
author
Aaron Schlesinger
committed
doc(pkg): ensure that sentences are terminated by a '.'
1 parent e5246f7 commit 71980fc

23 files changed

Lines changed: 92 additions & 89 deletions

pkg/builder.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Package pkg provides common libraries for the Deis builder.
22
//
3-
// The Deis builder is responsible for packaging Docker images for consumers.
3+
// The Deis builder is responsible for building slugs and docker images for use in the Deis
4+
// on the Deis PaaS platform.
45
package pkg
56

67
import (

pkg/cleaner/cleaner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package cleaner is a background process that compares the kubernetes namespace list with the
2-
// folders in the local git home directory, deleting what's not in the namespace list
2+
// folders in the local git home directory, deleting what's not in the namespace list.
33
package cleaner
44

55
import (

pkg/controller/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func fingerprint(key ssh.PublicKey) string {
6262
return string(fp)
6363
}
6464

65-
// UserInfoFromKey makes a request to the controller to get the user info from they given key
65+
// UserInfoFromKey makes a request to the controller to get the user info from they given key.
6666
func UserInfoFromKey(key ssh.PublicKey) (*UserInfo, error) {
6767
fp := fingerprint(key)
6868
url, err := controllerURLStr("v2", "hooks", "key", fp)

pkg/git/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
// prereceiveHookTplStr is the template for a pre-receive hook. The following template variables
2626
// are passed into it:
2727
//
28-
// .GitHome: the path to Git's home directory.
28+
// - .GitHome: the path to Git's home directory
2929
const preReceiveHookTplStr = `#!/bin/bash
3030
strip_remote_prefix() {
3131
stdbuf -i0 -o0 -e0 sed "s/^/"$'\e[1G'"/"

pkg/gitreceive/config.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111
)
1212

1313
// Config is the envconfig (http://github.com/kelseyhightower/envconfig) compatible struct for the
14-
// builder's git-receive hook
14+
// builder's git-receive hook.
1515
type Config struct {
1616
// k8s service discovery env vars
1717
ControllerHost string `envconfig:"DEIS_CONTROLLER_SERVICE_HOST" required:"true"`
@@ -38,7 +38,7 @@ type Config struct {
3838
}
3939

4040
// App returns the application name represented by c. The app name is the same as c.Repository
41-
// with the last '.' and beyond stripped off
41+
// with the last '.' and beyond stripped off.
4242
func (c Config) App() string {
4343
li := strings.LastIndex(c.Repository, ".")
4444
if li == -1 {
@@ -48,31 +48,31 @@ func (c Config) App() string {
4848
}
4949

5050
// BuilderPodTickDuration returns the size of the interval used to check for
51-
// the end of the execution of a Pod building an application
51+
// the end of the execution of a Pod building an application.
5252
func (c Config) BuilderPodTickDuration() time.Duration {
5353
return time.Duration(time.Duration(c.BuilderPodTickDurationMSec) * time.Millisecond)
5454
}
5555

5656
// BuilderPodWaitDuration returns the maximum time to wait for the end
57-
// of the execution of a Pod building an application
57+
// of the execution of a Pod building an application.
5858
func (c Config) BuilderPodWaitDuration() time.Duration {
5959
return time.Duration(time.Duration(c.BuilderPodWaitDurationMSec) * time.Millisecond)
6060
}
6161

6262
// ObjectStorageTickDuration returns the size of the interval used to check for
63-
// the end of an operation that involves the object storage
63+
// the end of an operation that involves the object storage.
6464
func (c Config) ObjectStorageTickDuration() time.Duration {
6565
return time.Duration(time.Duration(c.ObjectStorageTickDurationMSec) * time.Millisecond)
6666
}
6767

6868
// ObjectStorageWaitDuration returns the maximum time to wait for the end of an
69-
// operation that involves the object storage
69+
// operation that involves the object storage.
7070
func (c Config) ObjectStorageWaitDuration() time.Duration {
7171
return time.Duration(time.Duration(c.ObjectStorageWaitDurationMSec) * time.Millisecond)
7272
}
7373

7474
// CheckDurations checks if ticks for builder and object storage are not bigger
75-
// than the maximum duration. In case of this it will set the tick to the default
75+
// than the maximum duration. In case of this it will set the tick to the default.
7676
func (c *Config) CheckDurations() {
7777
if c.BuilderPodTickDurationMSec >= c.BuilderPodWaitDurationMSec {
7878
c.BuilderPodTickDurationMSec = builderPodTick

pkg/gitreceive/git/sha.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const (
1212

1313
var shaRegex = regexp.MustCompile(`^[\da-f]{40}$`)
1414

15-
// ErrInvalidGitSha is returned by NewSha if the given raw sha is invalid for any reason
15+
// ErrInvalidGitSha is returned by NewSha if the given raw sha is invalid for any reason.
1616
type ErrInvalidGitSha struct {
1717
sha string
1818
}
1919

20-
// Error is the error interface implementation
20+
// Error is the error interface implementation.
2121
func (e ErrInvalidGitSha) Error() string {
2222
return fmt.Sprintf("git sha %s was invalid", e.sha)
2323
}
@@ -28,16 +28,16 @@ type SHA struct {
2828
short string
2929
}
3030

31-
// NewSha creates a raw string to a SHA. Returns ErrInvalidGitSha if the sha was invalid
31+
// NewSha creates a raw string to a SHA. Returns ErrInvalidGitSha if the sha was invalid.
3232
func NewSha(rawSha string) (*SHA, error) {
3333
if !shaRegex.MatchString(rawSha) {
3434
return nil, ErrInvalidGitSha{sha: rawSha}
3535
}
3636
return &SHA{full: rawSha, short: rawSha[0:8]}, nil
3737
}
3838

39-
// Full returns the full git sha
39+
// Full returns the full git sha.
4040
func (s SHA) Full() string { return s.full }
4141

42-
// Short returns the first 8 characters of the sha
42+
// Short returns the first 8 characters of the sha.
4343
func (s SHA) Short() string { return s.short }

pkg/gitreceive/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ func readLine(line string) (string, string, string, error) {
2323
return spl[0], spl[1], spl[2], nil
2424
}
2525

26-
// Run runs the git-receive hook
26+
// Run runs the git-receive hook. This func is effectively the main for the git-receive hook,
27+
// although it is called from the main in boot.go.
2728
func Run(conf *Config, fs sys.FS, env sys.Env) error {
2829
log.Debug("Running git hook")
2930

pkg/gitreceive/storage/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (c *creds) isZero() bool {
3131
// getAuth gets storage credentials from accessKeyIDFile and accessSecretKeyFile.
3232
// if a key exists but not a secret, or vice-versa, returns an error.
3333
// if both don't exist returns emptyAuth.
34-
// otherwise returns a valid auth
34+
// otherwise returns a valid auth.
3535
func getAuth(fs sys.FS) (*creds, error) {
3636
accessKeyIDBytes, accessKeyErr := fs.ReadFile(accessKeyIDFile)
3737
accessSecretKeyBytes, accessSecretKeyErr := fs.ReadFile(accessSecretKeyFile)
@@ -50,7 +50,7 @@ func getAuth(fs sys.FS) (*creds, error) {
5050
return &creds{accessKeyID: id, accessKeySecret: secret}, nil
5151
}
5252

53-
// CredsOK checks if the required credentials to make a request exist
53+
// CredsOK checks if the required credentials to make a request exist.
5454
func CredsOK(fs sys.FS) bool {
5555
creds, err := getAuth(fs)
5656
if err != nil {

pkg/gitreceive/storage/bucket.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ const (
1010
)
1111

1212
var (
13-
// ACLPublicRead default ACL for objects in the S3 API compatible storage
13+
// ACLPublicRead default ACL for objects in the S3 API compatible storage.
1414
ACLPublicRead = s3.BucketACL("public-read")
1515
)
1616

17-
// CreateBucket creates a new bucket in the S3 API compatible storage or
18-
// return an error in case the bucket already exists
17+
// CreateBucket creates a new bucket in the S3 API compatible storage. If the bucket was
18+
// successfully created or already exists, returns nil. Otherwise returns an appropriate error.
1919
func CreateBucket(creator BucketCreator, bucketName string) error {
2020
if err := creator.MakeBucket(bucketName, ACLPublicRead, ""); err != nil {
2121
minioErr := s3.ToErrorResponse(err)

pkg/gitreceive/storage/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
s3 "github.com/minio/minio-go"
66
)
77

8-
// Client is the S3 client combined with the S3 endpoint
8+
// Client is the S3 client combined with the S3 endpoint.
99
type Client struct {
1010
*s3.Client
11-
// Endpoint is the the endpoint information for the location that the S3 client will access
11+
// Endpoint is the the endpoint information for the location that the S3 client will access.
1212
Endpoint *Endpoint
1313
}
1414

15-
// GetClient returns a S3 API compatible storage client
15+
// GetClient returns a S3 API compatible storage client.
1616
func GetClient(regionStr string, fs sys.FS, env sys.Env) (*Client, error) {
1717
auth, err := getAuth(fs)
1818
if err != nil {
@@ -25,7 +25,7 @@ func GetClient(regionStr string, fs sys.FS, env sys.Env) (*Client, error) {
2525
}
2626

2727
// the New function call guesses which signature version to use. Currently, it correctly guesses
28-
// V2 for GCS and V4 for both AWS S3 and Minio
28+
// V2 for GCS and V4 for both AWS S3 and Minio.
2929
s3Client, err := s3.New(endpoint.URLStr, auth.accessKeyID, auth.accessKeySecret, !endpoint.Secure)
3030
if err != nil {
3131
return nil, err

0 commit comments

Comments
 (0)