Skip to content

Commit dfda469

Browse files
authored
Merge pull request #2415 from alexandear/enable-godot-linter
Enable godot linter; append dot at the end of comments
2 parents f62df65 + 5abbf92 commit dfda469

File tree

33 files changed

+77
-73
lines changed

33 files changed

+77
-73
lines changed

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ linters:
4848
# - goconst
4949
- gocritic
5050
# - gocyclo
51-
# - godot
51+
- godot
5252
# - godox
5353
# - goerr113
5454
- gofumpt
@@ -111,3 +111,7 @@ issues:
111111
# Allow using Uid, Gid in pkg/osutil.
112112
- path: "pkg/osutil/"
113113
text: "uid"
114+
# Disable some linters for test files.
115+
- path: _test\.go
116+
linters:
117+
- godot

cmd/limactl/gendoc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ weight: 3
116116
})
117117
}
118118

119-
// replaceAll replaces all occurrences of new with old, for all files in dir
119+
// replaceAll replaces all occurrences of new with old, for all files in dir.
120120
func replaceAll(dir, old, new string) error {
121121
logrus.Infof("Replacing %q with %q", old, new)
122122
return filepath.Walk(dir, func(path string, info fs.FileInfo, err error) error {

cmd/limactl/hostagent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func hostagentAction(cmd *cobra.Command, args []string) error {
112112
return ha.Run(cmd.Context())
113113
}
114114

115-
// syncer is implemented by *os.File
115+
// syncer is implemented by *os.File.
116116
type syncer interface {
117117
Sync() error
118118
}

cmd/limactl/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func handleExitCoder(err error) {
161161
}
162162
}
163163

164-
// WrapArgsError annotates cobra args error with some context, so the error message is more user-friendly
164+
// WrapArgsError annotates cobra args error with some context, so the error message is more user-friendly.
165165
func WrapArgsError(argFn cobra.PositionalArgs) cobra.PositionalArgs {
166166
return func(cmd *cobra.Command, args []string) error {
167167
err := argFn(cmd, args)

pkg/autostart/autostart.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var systemdTemplate string
2121
//go:embed io.lima-vm.autostart.INSTANCE.plist
2222
var launchdTemplate string
2323

24-
// CreateStartAtLoginEntry respect host OS arch and create unit file
24+
// CreateStartAtLoginEntry respect host OS arch and create unit file.
2525
func CreateStartAtLoginEntry(hostOS, instName, workDir string) error {
2626
unitPath := GetFilePath(hostOS, instName)
2727
if _, err := os.Stat(unitPath); err != nil && !errors.Is(err, os.ErrNotExist) {
@@ -40,8 +40,8 @@ func CreateStartAtLoginEntry(hostOS, instName, workDir string) error {
4040
return enableDisableService("enable", hostOS, GetFilePath(hostOS, instName))
4141
}
4242

43-
// DeleteStartAtLoginEntry respect host OS arch and delete unit file
44-
// return true, nil if unit file has been deleted
43+
// DeleteStartAtLoginEntry respect host OS arch and delete unit file.
44+
// Return true, nil if unit file has been deleted.
4545
func DeleteStartAtLoginEntry(hostOS, instName string) (bool, error) {
4646
unitPath := GetFilePath(hostOS, instName)
4747
if _, err := os.Stat(unitPath); err != nil {
@@ -56,7 +56,7 @@ func DeleteStartAtLoginEntry(hostOS, instName string) (bool, error) {
5656
return true, nil
5757
}
5858

59-
// GetFilePath returns the path to autostart file with respect of host
59+
// GetFilePath returns the path to autostart file with respect of host.
6060
func GetFilePath(hostOS, instName string) string {
6161
var fileTmpl string
6262
if hostOS == "darwin" { // launchd plist

pkg/bicopy/bicopy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
// Bicopy is from https://github.com/rootless-containers/rootlesskit/blob/v0.10.1/pkg/port/builtin/parent/tcp/tcp.go#L73-L104
30-
// (originally from libnetwork, Apache License 2.0)
30+
// (originally from libnetwork, Apache License 2.0).
3131
func Bicopy(x, y io.ReadWriter, quit <-chan struct{}) {
3232
type closeReader interface {
3333
CloseRead() error

pkg/downloader/downloader.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"github.com/sirupsen/logrus"
2424
)
2525

26-
// HideProgress is used only for testing
26+
// HideProgress is used only for testing.
2727
var HideProgress bool
2828

29-
// hideBar is used only for testing
29+
// hideBar is used only for testing.
3030
func hideBar(bar *pb.ProgressBar) {
3131
bar.Set(pb.ReturnSymbol, "")
3232
bar.SetTemplateString("")
@@ -96,8 +96,8 @@ func WithDecompress(decompress bool) Opt {
9696
// WithExpectedDigest is used to validate the downloaded file against the expected digest.
9797
//
9898
// The digest is not verified in the following cases:
99-
// - The digest was not specified.
100-
// - The file already exists in the local target path.
99+
// - The digest was not specified.
100+
// - The file already exists in the local target path.
101101
//
102102
// When the `data` file exists in the cache dir with `<ALGO>.digest` file,
103103
// the digest is verified by comparing the content of `<ALGO>.digest` with the expected
@@ -291,14 +291,14 @@ func Cached(remote string, opts ...Opt) (*Result, error) {
291291
}
292292

293293
// cacheDirectoryPath returns the cache subdirectory path.
294-
// - "url" file contains the url
295-
// - "data" file contains the data
294+
// - "url" file contains the url
295+
// - "data" file contains the data
296296
func cacheDirectoryPath(cacheDir, remote string) string {
297297
return filepath.Join(cacheDir, "download", "by-url-sha256", fmt.Sprintf("%x", sha256.Sum256([]byte(remote))))
298298
}
299299

300300
// cacheDigestPath returns the cache digest file path.
301-
// - "<ALGO>.digest" contains the digest
301+
// - "<ALGO>.digest" contains the digest
302302
func cacheDigestPath(shad string, expectedDigest digest.Digest) (string, error) {
303303
shadDigest := ""
304304
if expectedDigest != "" {
@@ -316,9 +316,9 @@ func IsLocal(s string) bool {
316316
}
317317

318318
// canonicalLocalPath canonicalizes the local path string.
319-
// - Make sure the file has no scheme, or the `file://` scheme
320-
// - If it has the `file://` scheme, strip the scheme and make sure the filename is absolute
321-
// - Expand a leading `~`, or convert relative to absolute name
319+
// - Make sure the file has no scheme, or the `file://` scheme
320+
// - If it has the `file://` scheme, strip the scheme and make sure the filename is absolute
321+
// - Expand a leading `~`, or convert relative to absolute name
322322
func canonicalLocalPath(s string) (string, error) {
323323
if s == "" {
324324
return "", fmt.Errorf("got empty path")

pkg/driver/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// Driver interface is used by hostagent for managing vm.
1313
//
1414
// This interface is extended by BaseDriver which provides default implementation.
15-
// All other driver definition must extend BaseDriver
15+
// All other driver definition must extend BaseDriver.
1616
type Driver interface {
1717
// Validate returns error if the current driver isn't support for given config
1818
Validate() error

pkg/guestagent/kubernetesservice/kubernetesservice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
type Protocol string
2323

2424
const (
25-
// UDP/SCTP when lima port forwarding works on those protocols
25+
// UDP/SCTP when lima port forwarding works on those protocols.
2626
TCP Protocol = "TCP"
2727
)
2828

pkg/guestagent/procnettcp/procnettcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type Kind = string
1515
const (
1616
TCP Kind = "tcp"
1717
TCP6 Kind = "tcp6"
18-
// TODO: "udp", "udp6", "udplite", "udplite6"
18+
// TODO: "udp", "udp6", "udplite", "udplite6".
1919
)
2020

2121
type State = int

0 commit comments

Comments
 (0)