Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Dec 19, 2024
1 parent 792dc4e commit fd8035d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoweb/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewRouter(logger *slog.Logger, cfg *AppConfig) (http.Handler, error) {
// Configure WebClient
webcfg := HTMLWebClientConfig{
Markdown: md,
Highlighter: NewChromaHighlighterFormat(chroma, chromaDefaultStyle),
Highlighter: NewChromaSourceHighlighter(chroma, chromaDefaultStyle),
Domain: cfg.Domain,
UnsafeHTML: cfg.UnsafeHTML,
RPCClient: client,
Expand Down
9 changes: 4 additions & 5 deletions gno.land/pkg/gnoweb/webclient_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package gnoweb

import (
"bytes"
"errors"
"fmt"
"io"
"sort"
Expand Down Expand Up @@ -49,7 +48,7 @@ func (m *MockWebClient) RenderRealm(w io.Writer, path string, args string) (*Rea
func (m *MockWebClient) SourceFile(w io.Writer, pkgPath, fileName string) (*FileMeta, error) {
pkg, exists := m.Packages[pkgPath]
if !exists {
return nil, errors.New("package not found")
return nil, ErrClientPathNotFound
}

Check warning on line 52 in gno.land/pkg/gnoweb/webclient_mock.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/gnoweb/webclient_mock.go#L51-L52

Added lines #L51 - L52 were not covered by tests

if body, ok := pkg.Files[fileName]; ok {
Expand All @@ -60,14 +59,14 @@ func (m *MockWebClient) SourceFile(w io.Writer, pkgPath, fileName string) (*File
}, nil
}

return nil, errors.New("file not found")
return nil, ErrClientPathNotFound

Check warning on line 62 in gno.land/pkg/gnoweb/webclient_mock.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/gnoweb/webclient_mock.go#L62

Added line #L62 was not covered by tests
}

// Functions simulates retrieving function signatures from a package.
func (m *MockWebClient) Functions(path string) ([]vm.FunctionSignature, error) {
pkg, exists := m.Packages[path]
if !exists {
return nil, errors.New("package not found")
return nil, ErrClientPathNotFound
}

Check warning on line 70 in gno.land/pkg/gnoweb/webclient_mock.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/gnoweb/webclient_mock.go#L69-L70

Added lines #L69 - L70 were not covered by tests

return pkg.Functions, nil
Expand All @@ -77,7 +76,7 @@ func (m *MockWebClient) Functions(path string) ([]vm.FunctionSignature, error) {
func (m *MockWebClient) Sources(path string) ([]string, error) {
pkg, exists := m.Packages[path]
if !exists {
return nil, errors.New("package not found")
return nil, ErrClientPathNotFound
}

Check warning on line 80 in gno.land/pkg/gnoweb/webclient_mock.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/gnoweb/webclient_mock.go#L79-L80

Added lines #L79 - L80 were not covered by tests

fileNames := make([]string, 0, len(pkg.Files))
Expand Down

0 comments on commit fd8035d

Please sign in to comment.