Skip to content

Commit aa145bc

Browse files
committed
chore: updates
1 parent 6bd4dd6 commit aa145bc

File tree

12 files changed

+39
-43
lines changed

12 files changed

+39
-43
lines changed

.github/workflows/pr.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ jobs:
99
lint:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
- name: Install Go
1414
uses: actions/setup-go@v2
1515
with:
16-
go-version: 1.19
16+
go-version: 1.24
1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v2
18+
uses: golangci/golangci-lint-action@v6
1919
with:
20-
version: v1.48.0
21-
skip-go-installation: true
20+
version: v1.64.7
2221
- name: Run go list
2322
run: go list -json -m all > go.list
2423

@@ -28,14 +27,14 @@ jobs:
2827
strategy:
2928
matrix:
3029
golang:
31-
- 1.19
30+
- 1.24
3231
steps:
33-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v4
3433
- name: Install Go
3534
uses: actions/setup-go@v2
3635
with:
3736
go-version: ${{ matrix.golang }}
38-
- uses: actions/cache@v2
37+
- uses: actions/cache@v4
3938
with:
4039
path: ~/Go/pkg/mod
4140
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
@@ -54,14 +53,14 @@ jobs:
5453
strategy:
5554
matrix:
5655
golang:
57-
- 1.19
56+
- 1.24
5857
steps:
59-
- uses: actions/checkout@v2
58+
- uses: actions/checkout@v4
6059
- name: Install Go
6160
uses: actions/setup-go@v2
6261
with:
6362
go-version: ${{ matrix.golang }}
64-
- uses: actions/cache@v2
63+
- uses: actions/cache@v4
6564
with:
6665
path: ~/Go/pkg/mod
6766
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
@@ -78,14 +77,14 @@ jobs:
7877
strategy:
7978
matrix:
8079
golang:
81-
- 1.19
80+
- 1.24
8281
steps:
83-
- uses: actions/checkout@v2
82+
- uses: actions/checkout@v4
8483
- name: Install Go
8584
uses: actions/setup-go@v2
8685
with:
8786
go-version: ${{ matrix.golang }}
88-
- uses: actions/cache@v2
87+
- uses: actions/cache@v4
8988
with:
9089
path: ~/go/pkg/mod
9190
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}

.github/workflows/tag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install Go
1414
uses: actions/setup-go@v2
1515
with:
16-
go-version: 1.19
16+
go-version: 1.24
1717
- name: Unshallow
1818
run: git fetch --prune --unshallow
1919

.golangci.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
run:
22
timeout: 2m
33
tests: false
4-
skip-dirs:
5-
- assets
6-
- proto
7-
- mocks
8-
- example*
94

105
issues:
116
exclude-rules:
127
- text: declaration of "err" shadows declaration
138
linters:
149
- govet
10+
exclude-dirs:
11+
- assets
12+
- proto
13+
- mocks
14+
- example*
1515

1616
linters-settings:
1717
govet:
18-
check-shadowing: true
1918
disable:
2019
- structtag
21-
golint:
22-
min-confidence: 0
2320
gocyclo:
2421
min-complexity: 20
25-
maligned:
26-
suggest-new: true
2722
dupl:
2823
threshold: 200
2924
goconst:
3025
min-len: 3
3126
min-occurrences: 3
3227
misspell:
3328
locale: US
29+
revive:
30+
rules:
31+
- name: "unused-parameter"
32+
disabled: true
33+
3434
gocritic:
3535
enabled-tags:
3636
- diagnostic
@@ -47,11 +47,9 @@ linters:
4747
disable-all: true
4848
enable:
4949
# - bodyclose
50-
- deadcode
51-
- depguard
50+
# - depguard
5251
- dogsled
5352
- dupl
54-
- exportloopref
5553
- errcheck
5654
- exhaustive
5755
- goconst
@@ -77,7 +75,6 @@ linters:
7775
- unconvert
7876
# - unparam
7977
- unused
80-
- varcheck
8178
- whitespace
8279
- wsl
8380

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/outblocks/outblocks-cli
22

3-
go 1.19
3+
go 1.24
44

55
require (
66
github.com/23doors/go-yaml v1.9.6-0.20220328165103-15fd217cc309

internal/fileutil/file.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func ChownRToUser(path string) error {
3737
if err == nil {
3838
err = ChownToUser(name)
3939
}
40+
4041
return err
4142
})
4243
}
@@ -64,6 +65,7 @@ func LchownRToUser(path string) error {
6465
if err == nil {
6566
err = LchownToUser(name)
6667
}
68+
6769
return err
6870
})
6971
}

internal/fileutil/yaml.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func FindSubdirsOfMatching(path string, matching []string) []string {
8585
}
8686
}
8787
}
88+
8889
return nil
8990
})
9091

internal/fileutil/zip.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func ArchiveDir(dir, out string, excludes []string) error {
2626
if err != nil {
2727
return fmt.Errorf("error creating file header: %s", err)
2828
}
29+
2930
fh.Name = filepath.ToSlash(rel)
3031
fh.Method = zip.Deflate
3132
// fh.Modified alone isn't enough when using a zero value
@@ -35,6 +36,7 @@ func ArchiveDir(dir, out string, excludes []string) error {
3536
if err != nil {
3637
return fmt.Errorf("error creating file inside archive: %s", err)
3738
}
39+
3840
content, err := os.ReadFile(path)
3941
if err != nil {
4042
return fmt.Errorf("error reading file for archival: %s", err)

pkg/actions/apps_add.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ func suggestAppStaticBuildDir(cfg *config.Project, opts *AppAddOptions) func(toC
437437
}
438438

439439
dirs = append(dirs, path)
440+
440441
return nil
441442
})
442443

pkg/actions/deploy.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ func (r *planAndApplyResults) shouldSave() bool {
326326
}
327327

328328
func (d *Deploy) multilockPlanAndApplyDeploy(ctx context.Context, state *statefile.StateData, partialLock, verify bool, yamlContext *client.YAMLContext) (*planAndApplyResults, error) {
329-
var (
330-
locks []string
331-
)
329+
var locks []string
332330

333331
// Acquire necessary acquiredLocks.
334332
if partialLock {
@@ -1467,7 +1465,7 @@ func (d *Deploy) planMonitoring(ctx context.Context, state *statefile.StateData,
14671465

14681466
plug := d.cfg.FindLoadedPlugin(monitoring.Plugin)
14691467
if plug == nil {
1470-
return nil, merry.Errorf("missing monitoring plugin: %s", plug.Name)
1468+
return nil, merry.Errorf("missing monitoring plugin: %s", monitoring.Plugin)
14711469
}
14721470

14731471
ret, err := plug.Client().PlanMonitoring(ctx, state, monitoring, plug.CommandArgs(deployCommand), verify, destroy)
@@ -1489,7 +1487,7 @@ func (d *Deploy) applyMonitoring(ctx context.Context, state *statefile.StateData
14891487

14901488
plug := d.cfg.FindLoadedPlugin(monitoring.Plugin)
14911489
if plug == nil {
1492-
return merry.Errorf("missing monitoring plugin: %s", plug.Name)
1490+
return merry.Errorf("missing monitoring plugin: %s", monitoring.Plugin)
14931491
}
14941492

14951493
ret, err := plug.Client().ApplyMonitoring(ctx, state, monitoring, plug.CommandArgs(deployCommand), destroy, callback)

pkg/actions/run.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ func (d *Run) runAll(ctx context.Context, runInfo *runInfo) ([]*run.PluginRunRes
403403
// Process local dependencies.
404404
if len(runInfo.localDeps) > 0 {
405405
localRet, err := run.Local(ctx, nil, runInfo.localDeps)
406-
407406
if err != nil {
408407
spinner.Stop()
409408
return nil, nil, err
@@ -486,7 +485,6 @@ func (d *Run) runAll(ctx context.Context, runInfo *runInfo) ([]*run.PluginRunRes
486485
// Process local apps.
487486
if len(runInfo.localApps) > 0 {
488487
localRet, err := run.Local(ctx, runInfo.localApps, nil)
489-
490488
if err != nil {
491489
spinner.Stop()
492490
return nil, nil, err
@@ -569,9 +567,9 @@ func formatRunOutput(log logger.Logger, cfg *config.Project, r *apiv1.RunOutputR
569567
}
570568

571569
if r.Stream == apiv1.RunOutputResponse_STREAM_STDERR {
572-
log.Printf("%s %s\n", pterm.FgRed.Sprintf(prefix), msg)
570+
log.Printf("%s %s\n", pterm.FgRed.Sprint(prefix), msg)
573571
} else {
574-
log.Printf("%s %s\n", pterm.FgGreen.Sprintf(prefix), msg)
572+
log.Printf("%s %s\n", pterm.FgGreen.Sprint(prefix), msg)
575573
}
576574
}
577575

@@ -674,7 +672,6 @@ func (d *Run) start(ctx context.Context, runInfo *runInfo) (*sync.WaitGroup, err
674672

675673
go func() {
676674
err = localRet.Wait()
677-
678675
if err != nil {
679676
runnerCancel()
680677
errCh <- err
@@ -700,7 +697,6 @@ func (d *Run) start(ctx context.Context, runInfo *runInfo) (*sync.WaitGroup, err
700697

701698
go func() {
702699
err = pluginRet.Wait()
703-
704700
if err != nil {
705701
runnerCancel()
706702
errCh <- err

0 commit comments

Comments
 (0)