Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Jun 27, 2024
1 parent d7635a9 commit 1f7e43a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/gnols/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func call(ts *testscript.TestScript, method string, paramFile string) {
)
_, err := conn.Call(context.Background(), method, params, &response)
if err != nil {
if jerr, ok := err.(*jsonrpc2.Error); ok {
if jerr, ok := err.(*jsonrpc2.Error); ok { //nolint:errorlint
// output jsonrpc2.Error in json
response = map[string]any{"error": jerr}
} else {
Expand Down
8 changes: 3 additions & 5 deletions internal/gno/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func ParsePackage(dir, importPath string) (*Package, error) {
}
if len(symbols) == 0 {
// Ignore directories w/o symbols
return nil, nil
return nil, nil //nolint:nilnil
}

return &Package{
Expand Down Expand Up @@ -119,10 +119,8 @@ func getSymbols(dir string, filename string) ([]Symbol, error) {
fset := token.NewFileSet()

// Parse the file and create an AST.
file, err := parser.ParseFile(fset, filename, nil, parser.ParseComments)
if err != nil {
// fmt.Println("PARSEFILE", err)
}
file, _ := parser.ParseFile(fset, filename, nil, parser.ParseComments)
// fmt.Println("PARSEFILE", err)

bsrc, err := os.ReadFile(filename)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/gno/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ func TestParsePackage(t *testing.T) {
testscript.Run(t, testscript.Params{
Dir: "testdata",
Cmds: map[string]func(*testscript.TestScript, bool, []string){
"printSymbols": func(ts *testscript.TestScript, _ bool, arg []string) {
"printSymbols": func(ts *testscript.TestScript, neg bool, arg []string) { //nolint:unparam
pkg, err := gno.ParsePackage(ts.Getenv("WORK"), "")
if err != nil {
ts.Fatalf("gno.ParsePackage: %v", err)
}
bz, _ := json.MarshalIndent(pkg.Symbols, "", " ")
ts.Stdout().Write(bz)
ts.Stdout().Write([]byte{'\n'})
ts.Stdout().Write(bz) //nolint:errcheck
ts.Stdout().Write([]byte{'\n'}) //nolint:errcheck
},
},
})
Expand Down
1 change: 0 additions & 1 deletion internal/handler/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func (h handler) lookupSymbols(name string, selectors []string) []gno.Symbol {
func lookupSymbols(symbols []gno.Symbol, name string, selectors []string) []gno.Symbol {
for _, sym := range symbols {
switch {

case sym.Name == name:
slog.Info("found symbol", "name", name, "kind", sym.Kind, "selectors", selectors)
// we found a symbol matching name
Expand Down

0 comments on commit 1f7e43a

Please sign in to comment.