Skip to content

Commit 3819d5b

Browse files
authored
Merge pull request #4212 from alexandear/refactor/package-directory-mismatch
Fix revive.package-directory-mismatch lint issues
2 parents 3207075 + f888f7a commit 3819d5b

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ linters:
102102
- name: indent-error-flow
103103
- name: package-comments
104104
disabled: true
105+
- name: package-directory-mismatch
105106
- name: range
106107
- name: receiver-naming
107108
- name: redefines-builtin-id

cmd/limactl/clone.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/lima-vm/lima/v2/pkg/instance"
1717
"github.com/lima-vm/lima/v2/pkg/limatype/filenames"
1818
"github.com/lima-vm/lima/v2/pkg/limayaml"
19-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
19+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
2020
"github.com/lima-vm/lima/v2/pkg/store"
2121
"github.com/lima-vm/lima/v2/pkg/yqutil"
2222
)
@@ -124,7 +124,7 @@ func cloneOrRenameAction(cmd *cobra.Command, args []string) error {
124124
if !startNow {
125125
return nil
126126
}
127-
err = networks.Reconcile(ctx, newInst.Name)
127+
err = reconcile.Reconcile(ctx, newInst.Name)
128128
if err != nil {
129129
return err
130130
}

cmd/limactl/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/lima-vm/lima/v2/pkg/autostart"
1616
"github.com/lima-vm/lima/v2/pkg/instance"
17-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
17+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
1818
"github.com/lima-vm/lima/v2/pkg/store"
1919
)
2020

@@ -60,7 +60,7 @@ func deleteAction(cmd *cobra.Command, args []string) error {
6060
}
6161
logrus.Infof("Deleted %q (%q)", instName, inst.Dir)
6262
}
63-
return networks.Reconcile(cmd.Context(), "")
63+
return reconcile.Reconcile(cmd.Context(), "")
6464
}
6565

6666
func deleteBashComplete(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {

cmd/limactl/edit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/lima-vm/lima/v2/pkg/limatype/dirnames"
2222
"github.com/lima-vm/lima/v2/pkg/limatype/filenames"
2323
"github.com/lima-vm/lima/v2/pkg/limayaml"
24-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
24+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
2525
"github.com/lima-vm/lima/v2/pkg/store"
2626
"github.com/lima-vm/lima/v2/pkg/uiutil"
2727
"github.com/lima-vm/lima/v2/pkg/yqutil"
@@ -155,7 +155,7 @@ func editAction(cmd *cobra.Command, args []string) error {
155155
if !startNow {
156156
return nil
157157
}
158-
err = networks.Reconcile(ctx, inst.Name)
158+
err = reconcile.Reconcile(ctx, inst.Name)
159159
if err != nil {
160160
return err
161161
}

cmd/limactl/shell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/lima-vm/lima/v2/pkg/instance"
2525
"github.com/lima-vm/lima/v2/pkg/ioutilx"
2626
"github.com/lima-vm/lima/v2/pkg/limatype"
27-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
27+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
2828
"github.com/lima-vm/lima/v2/pkg/sshutil"
2929
"github.com/lima-vm/lima/v2/pkg/store"
3030
)
@@ -101,7 +101,7 @@ func shellAction(cmd *cobra.Command, args []string) error {
101101
return nil
102102
}
103103

104-
err = networks.Reconcile(ctx, inst.Name)
104+
err = reconcile.Reconcile(ctx, inst.Name)
105105
if err != nil {
106106
return err
107107
}

cmd/limactl/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/lima-vm/lima/v2/pkg/limatype/dirnames"
2626
"github.com/lima-vm/lima/v2/pkg/limatype/filenames"
2727
"github.com/lima-vm/lima/v2/pkg/limayaml"
28-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
28+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
2929
"github.com/lima-vm/lima/v2/pkg/registry"
3030
"github.com/lima-vm/lima/v2/pkg/store"
3131
"github.com/lima-vm/lima/v2/pkg/templatestore"
@@ -580,7 +580,7 @@ func startAction(cmd *cobra.Command, args []string) error {
580580
logrus.Warnf("expected status %q, got %q", limatype.StatusStopped, inst.Status)
581581
}
582582
ctx := cmd.Context()
583-
err = networks.Reconcile(ctx, inst.Name)
583+
err = reconcile.Reconcile(ctx, inst.Name)
584584
if err != nil {
585585
return err
586586
}

cmd/limactl/stop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/spf13/cobra"
88

99
"github.com/lima-vm/lima/v2/pkg/instance"
10-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
10+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
1111
"github.com/lima-vm/lima/v2/pkg/store"
1212
)
1313

@@ -48,7 +48,7 @@ func stopAction(cmd *cobra.Command, args []string) error {
4848
}
4949
// TODO: should we also reconcile networks if graceful stop returned an error?
5050
if err == nil {
51-
err = networks.Reconcile(ctx, "")
51+
err = reconcile.Reconcile(ctx, "")
5252
}
5353
return err
5454
}

pkg/instance/restart.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/sirupsen/logrus"
1010

1111
"github.com/lima-vm/lima/v2/pkg/limatype"
12-
networks "github.com/lima-vm/lima/v2/pkg/networks/reconcile"
12+
"github.com/lima-vm/lima/v2/pkg/networks/reconcile"
1313
)
1414

1515
const (
@@ -21,7 +21,7 @@ func Restart(ctx context.Context, inst *limatype.Instance, showProgress bool) er
2121
return err
2222
}
2323

24-
if err := networks.Reconcile(ctx, inst.Name); err != nil {
24+
if err := reconcile.Reconcile(ctx, inst.Name); err != nil {
2525
return err
2626
}
2727

@@ -36,7 +36,7 @@ func RestartForcibly(ctx context.Context, inst *limatype.Instance, showProgress
3636
logrus.Info("Restarting the instance forcibly")
3737
StopForcibly(inst)
3838

39-
if err := networks.Reconcile(ctx, inst.Name); err != nil {
39+
if err := reconcile.Reconcile(ctx, inst.Name); err != nil {
4040
return err
4141
}
4242

pkg/networks/reconcile/reconcile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright The Lima Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package networks
4+
package reconcile
55

66
import (
77
"bytes"

0 commit comments

Comments
 (0)