Skip to content

Commit

Permalink
Merge pull request #1 from YumaFuu/feature/golangci-lint
Browse files Browse the repository at this point in the history
add: golangci-lint
  • Loading branch information
yumafuu authored Jul 25, 2024
2 parents 43e0de4 + 9481be8 commit 9349a24
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 11 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: golangci-lint

permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ S1M is AWS Parameter Store TUI tool.

It allows you to manage your parameters in AWS Parameter Store.

[![GitHub Lint](https://img.shields.io/github/actions/workflow/status/YumaFuu/s1m/golangci.yml)]()
[![GitHub release](https://img.shields.io/github/v/release/yumafuu/s1m)]()

</div>
Expand Down
1 change: 1 addition & 0 deletions aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ registries:
ref: v4.208.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: goreleaser/[email protected]
- name: golangci/[email protected]
Binary file removed s1m
Binary file not shown.
1 change: 0 additions & 1 deletion tui/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (v *CmdBox) NewParameterType(dir string, param ssm.Parameter) {
v.NewParameterValue(dir, param)
}
})
return
}

// TODO: Dependency Injection
Expand Down
12 changes: 9 additions & 3 deletions tui/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func (a *Tui) WaitTopic() {
func() {
a.cmdbox.SetLabel("")
a.cmdbox.SetText("")
a.ptree.Refresh()
if err := a.ptree.Refresh(); err != nil {
a.infbox.SetText(err.Error())
}
a.app.SetFocus(a.ptree)
},
)
Expand Down Expand Up @@ -147,7 +149,9 @@ func (a *Tui) WaitTopic() {
func() {
a.cmdbox.SetLabel("")
a.cmdbox.SetText("")
a.ptree.Refresh()
if err := a.ptree.Refresh(); err != nil {
a.infbox.SetText(err.Error())
}
a.app.SetFocus(a.ptree)
},
)
Expand All @@ -174,7 +178,9 @@ func (a *Tui) WaitTopic() {
func() {
a.cmdbox.SetLabel("")
a.cmdbox.SetText("")
a.ptree.Refresh()
if err := a.ptree.Refresh(); err != nil {
a.infbox.SetText(err.Error())
}
a.app.SetFocus(a.ptree)
},
)
Expand Down
8 changes: 3 additions & 5 deletions tui/infbox/infbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ func (v InfoBox) WaitTopic() {
chUpdate := v.pubsub.Sub(pubsub.TopicUpdateInfoBox)

for {
select {
case msg := <-chUpdate:
if s, ok := msg.(string); ok {
v.SetText(s)
}
msg := <-chUpdate
if s, ok := msg.(string); ok {
v.SetText(s)
}
}
}
4 changes: 3 additions & 1 deletion tui/ptree/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func (pt *ParameterTree) InputCapture(event *tcell.EventKey) *tcell.EventKey {
pt.pubsub.Pub(param, pubsub.TopicDeleteParam)
}
case 'r':
pt.Refresh()
if err := pt.Refresh(); err != nil {
pt.pubsub.Pub(err, pubsub.TopicUpdateInfoBox)
}
}

switch event.Key() {
Expand Down
4 changes: 3 additions & 1 deletion tui/ptree/ptree.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ func NewParameterTree(
root,
INIT_POSITION,
}
pt.Refresh()
if err := pt.Refresh(); err != nil {
return nil, err
}

return pt, nil
}

0 comments on commit 9349a24

Please sign in to comment.