Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix linter in release/v28.x.y #4460

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Lint
on:
pull_request:
push:
paths-ignore:
- "**.md"
branches:
- main
- release/*
Expand All @@ -26,9 +24,10 @@ jobs:
go-version-file: go.mod
cache: false

- uses: golangci/golangci-lint-action@v3
- uses: golangci/golangci-lint-action@v6
with:
version: v1.54.2
version: v1.60.3
install-mode: goinstall
args: --timeout 10m
github-token: ${{ secrets.github_token }}
skip-save-cache: true
2 changes: 1 addition & 1 deletion ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To get started, create a blockchain:
SilenceUsage: true,
SilenceErrors: true,
Args: cobra.MinimumNArgs(0), // note(@julienrbrt): without this, ignite __complete(noDesc) hidden commands are not working.
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// Check for new versions only when shell completion scripts are not being
// generated to avoid invalid output to stdout when a new version is available
if cmd.Use != "completion" || !strings.HasPrefix(cmd.Use, cobra.ShellCompRequestCmd) {
Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func NewDoctor() *cobra.Command {
Use: "doctor",
Short: "Fix chain configuration",
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
session := cliui.New()
defer session.End()

Expand Down
4 changes: 2 additions & 2 deletions ignite/cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func NewAppList() *cobra.Command {
Use: "list",
Short: "List installed apps",
Long: "Prints status and information of all installed Ignite Apps.",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
s := cliui.New(cliui.WithStdout(os.Stdout))
return printPlugins(cmd.Context(), s)
},
Expand All @@ -433,7 +433,7 @@ func NewAppUpdate() *cobra.Command {
If no path is specified all declared apps are updated.`,
Example: "ignite app update github.com/org/my-app/",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
if len(args) == 0 {
// update all plugins
return plugin.Update(plugins...)
Expand Down
14 changes: 7 additions & 7 deletions ignite/config/plugins/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ import (
// given names above are found, then an empty config is returned, w/o errors.
func ParseDir(dir string) (*Config, error) {
// handy function that wraps and prefix err with a common label
errf := func(err error) (*Config, error) {
return nil, errors.Errorf("plugin config parse: %w", err)
errf := func(err error) error {
return errors.Errorf("plugin config parse: %w", err)
}
fi, err := os.Stat(dir)
if err != nil {
return errf(err)
return nil, errf(err)
}
if !fi.IsDir() {
return errf(errors.Errorf("path %s is not a dir", dir))
return nil, errf(errors.Errorf("path %s is not a dir", dir))
}

filename, err := locateFile(dir)
if err != nil {
return errf(err)
return nil, errf(err)
}
c := Config{
path: filename,
Expand All @@ -41,13 +41,13 @@ func ParseDir(dir string) (*Config, error) {
if os.IsNotExist(err) {
return &c, nil
}
return errf(err)
return nil, errf(err)
}
defer f.Close()

// if the error is end of file meaning an empty file on read return nil
if err := yaml.NewDecoder(f).Decode(&c); err != nil && !errors.Is(err, io.EOF) {
return errf(err)
return nil, errf(err)
}
return &c, nil
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/cliui/entrywriter/entrywriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Write(out io.Writer, header []string, entries ...[]string) error {
if len(entry) != len(header) {
return errors.Wrapf(ErrInvalidFormat, "entry %d doesn't match header length", i)
}
if _, err := fmt.Fprintf(w, formatLine(entry, false)+"\n"); err != nil {
if _, err := fmt.Fprint(w, formatLine(entry, false)+"\n"); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/cosmostxcollector/adapter/postgres/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s Schemas) WalkFrom(fromVersion uint64, fn SchemasWalkFunc) error {
paths := map[uint64]string{}

// Index the paths to the schemas with the matching versions
err := fs.WalkDir(s.fs, SchemasDir, func(path string, d fs.DirEntry, err error) error {
err := fs.WalkDir(s.fs, SchemasDir, func(path string, _ fs.DirEntry, err error) error {
if err != nil {
return errors.Errorf("failed to read schema %s: %w", path, err)
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/openapiconsole/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var index embed.FS
func Handler(title, specURL string) http.HandlerFunc {
t, _ := template.ParseFS(index, "index.tpl")

return func(w http.ResponseWriter, req *http.Request) {
return func(w http.ResponseWriter, _ *http.Request) {
_ = t.Execute(w, struct {
Title string
URL string
Expand Down
6 changes: 3 additions & 3 deletions ignite/pkg/protoanalysis/protoutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func GetMessageByName(f *proto.Proto, name string) (node *proto.Message, err err
return ok
},
// return immediately iff found.
func(c *Cursor) bool { return !found })
func(*Cursor) bool { return !found })
if found {
return
}
Expand Down Expand Up @@ -210,7 +210,7 @@ func GetServiceByName(f *proto.Proto, name string) (node *proto.Service, err err
return ok
},
// return immediately iff found.
func(c *Cursor) bool { return !found })
func(*Cursor) bool { return !found })
if found {
return
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func GetImportByPath(f *proto.Proto, path string) (node *proto.Import, err error
return ok
},
// return immediately iff found.
func(c *Cursor) bool { return !found })
func(*Cursor) bool { return !found })
if found {
return
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/services/scaffolder/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func SingletonType() AddTypeKind {

// DryType only creates a type with a basic definition.
func DryType() AddTypeKind {
return func(o *addTypeOptions) {}
return func(*addTypeOptions) {}
}

// TypeWithModule module to scaffold type into.
Expand Down
2 changes: 1 addition & 1 deletion ignite/templates/field/datatype/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var DataCustom = DataType{
ProtoType: func(datatype, name string, index int) string {
return fmt.Sprintf("%s %s = %d", datatype, name, index)
},
GenesisArgs: func(name multiformatname.Name, value int) string {
GenesisArgs: func(name multiformatname.Name, _ int) string {
return fmt.Sprintf("%s: new(types.%s),\n", name.UpperCamel, name.UpperCamel)
},
CLIArgs: func(name multiformatname.Name, datatype, prefix string, argIndex int) string {
Expand Down
Loading