Skip to content

Commit

Permalink
bump backend dependencies
Browse files Browse the repository at this point in the history
Also, switch from fork github.com/umputun/go-flags back to original
github.com/jessevdk/go-flags.
  • Loading branch information
paskal committed Jan 31, 2022
1 parent 3a9806a commit de20430
Show file tree
Hide file tree
Showing 372 changed files with 5,977 additions and 4,607 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: install golangci-lint and goveralls
run: |
curl -sfL https://github.com/raw/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.43.0
curl -sfL https://github.com/raw/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.44.0
go get -u github.com/mattn/goveralls
- name: test and lint backend
Expand Down
4 changes: 2 additions & 2 deletions backend/_example/memory_store/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.16
require (
github.com/go-pkgz/jrpc v0.2.0
github.com/go-pkgz/lgr v0.10.4
github.com/jessevdk/go-flags v1.5.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
github.com/umputun/go-flags v1.5.1
github.com/umputun/remark42/backend v1.8.1
github.com/umputun/remark42/backend v1.9.0
)

replace github.com/umputun/remark42/backend => ../../
140 changes: 55 additions & 85 deletions backend/_example/memory_store/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/_example/memory_store/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/go-pkgz/jrpc"
log "github.com/go-pkgz/lgr"
"github.com/umputun/go-flags"
"github.com/jessevdk/go-flags"

"github.com/umputun/remark42/memory_store/accessor"
"github.com/umputun/remark42/memory_store/server"
Expand Down
2 changes: 1 addition & 1 deletion backend/app/cmd/avatar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"

"github.com/go-pkgz/auth/avatar"
"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/umputun/go-flags"
)

func TestAvatar_Execute(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion backend/app/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (ec *BackupCommand) Execute(_ []string) error {
return responseError(resp)
}

fh, err := os.Create(fname)
fh, err := os.Create(fname) //nolint:gosec // harmless
if err != nil {
return errors.Wrapf(err, "can't create backup file %s", fname)
}
Expand Down
3 changes: 1 addition & 2 deletions backend/app/cmd/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"os"
"testing"

"github.com/umputun/go-flags"

"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/cmd/cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/go-chi/chi/v5"
"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/umputun/go-flags"

"github.com/umputun/remark42/backend/app/store"
)
Expand Down
3 changes: 1 addition & 2 deletions backend/app/cmd/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
"time"

log "github.com/go-pkgz/lgr"
"github.com/umputun/go-flags"

"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
3 changes: 1 addition & 2 deletions backend/app/cmd/remap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/umputun/go-flags"

"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
3 changes: 1 addition & 2 deletions backend/app/cmd/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"net/http/httptest"
"testing"

"github.com/umputun/go-flags"

"github.com/jessevdk/go-flags"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/cmd/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/go-pkgz/auth/token"
"github.com/golang-jwt/jwt"
"github.com/umputun/go-flags"
"github.com/jessevdk/go-flags"
"go.uber.org/goleak"

"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion backend/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"syscall"

log "github.com/go-pkgz/lgr"
"github.com/umputun/go-flags"
"github.com/jessevdk/go-flags"

"github.com/umputun/remark42/backend/app/cmd"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/migrator/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (ab AutoBackup) Do(ctx context.Context) {
func (ab AutoBackup) makeBackup() (string, error) {
log.Printf("[DEBUG] make backup for %s", ab.SiteID)
backupFile := fmt.Sprintf("%s/backup-%s-%s.gz", ab.BackupLocation, ab.SiteID, time.Now().Format("20060102"))
fh, err := os.Create(backupFile)
fh, err := os.Create(backupFile) //nolint:gosec // harmless
if err != nil {
return "", errors.Wrapf(err, "can't create backup file %s", backupFile)
}
Expand Down
2 changes: 1 addition & 1 deletion backend/app/notify/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (t *Webhook) Send(ctx context.Context, req Request) error {
errMsg := fmt.Sprintf("webhook request failed with non-OK status code: %d", resp.StatusCode)
respBody, e := io.ReadAll(resp.Body)
if e != nil {
return fmt.Errorf(errMsg)
return errors.New(errMsg)
}
return fmt.Errorf("%s, body: %s", errMsg, respBody)
}
Expand Down
14 changes: 7 additions & 7 deletions backend/app/rest/api/rest_public_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ BKT
assert.NoError(t, err)
assert.Equal(t,
`<h1>h1</h1>
<pre class="chroma">func TestRest_Preview(t *testing.T) {
srv, ts := prep(t)
require.NotNil(t, srv)
}
</pre>`,
<pre class="chroma"><code><span><span>func TestRest_Preview(t *testing.T) {
</span></span><span><span>srv, ts := prep(t)
</span></span><span><span> require.NotNil(t, srv)
</span></span><span><span>}
</span></span></code></pre>`,
string(b))
assert.NoError(t, resp.Body.Close())
}
Expand All @@ -134,8 +134,8 @@ BKT
assert.Equal(t, http.StatusOK, resp.StatusCode)
b, err := io.ReadAll(resp.Body)
assert.NoError(t, err)
assert.Equal(t, `<pre class="chroma"><span class="kd">func</span> <span class="nf">main</span><span class="p">(</span><span class="nx">aa</span> <span class="kt">string</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span><span class="k">return</span> <span class="mi">0</span><span class="p">}</span>
</pre>`, string(b))
assert.Equal(t, `<pre class="chroma"><code><span><span><span class="kd">func</span> <span class="nf">main</span><span class="p">(</span><span class="nx">aa</span> <span class="kt">string</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span><span class="k">return</span> <span class="mi">0</span><span class="p">}</span>
</span></span></code></pre>`, string(b))
assert.NoError(t, resp.Body.Close())
}

Expand Down
8 changes: 4 additions & 4 deletions backend/app/store/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ func TestFormatter_FormatText(t *testing.T) {
},
{"&mdash; not translated #354", "<p>— not translated #354</p>\n!converted", "mdash"},
{"smth\n```go\nfunc main(aa string) int {return 0}\n```", `<p>smth</p>
<pre tabindex="0" class="chroma"><span class="kd">func</span> <span class="nf">main</span><span class="p">(</span><span class="nx">aa</span> <span class="kt">string</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span><span class="k">return</span> <span class="mi">0</span><span class="p">}</span>
</pre>!converted`, "code with language"},
{"```\ntest_code\n```", `<pre tabindex="0" class="chroma">test_code
</pre>!converted`, "code without language"},
<pre tabindex="0" class="chroma"><code><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">main</span><span class="p">(</span><span class="nx">aa</span> <span class="kt">string</span><span class="p">)</span> <span class="kt">int</span> <span class="p">{</span><span class="k">return</span> <span class="mi">0</span><span class="p">}</span>
</span></span></code></pre>!converted`, "code with language"},
{"```\ntest_code\n```", `<pre tabindex="0" class="chroma"><code><span class="line"><span class="cl">test_code
</span></span></code></pre>!converted`, "code without language"},
}
f := NewCommentFormatter(mockConverter{})
for _, tt := range tbl {
Expand Down
27 changes: 17 additions & 10 deletions backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,42 @@ go 1.16
require (
github.com/Depado/bfchroma v1.3.0
github.com/PuerkitoBio/goquery v1.8.0
github.com/alecthomas/chroma v0.9.4
github.com/alecthomas/chroma v0.10.0
github.com/didip/tollbooth/v6 v6.1.1
github.com/didip/tollbooth_chi v0.0.0-20200828173446-a7173453ea21
github.com/go-chi/chi/v5 v5.0.5
github.com/go-chi/chi/v5 v5.0.7
github.com/go-chi/cors v1.2.0
github.com/go-chi/render v1.0.1
github.com/go-pkgz/auth v1.18.1-0.20211207184750-78e5d290333d
github.com/go-pkgz/auth v1.18.1-0.20220131194604-2eb160b3c90c
github.com/go-pkgz/jrpc v0.2.0
github.com/go-pkgz/lcw v0.8.1
github.com/go-pkgz/lgr v0.10.4
github.com/go-pkgz/repeater v1.1.3
github.com/go-pkgz/rest v1.11.0
github.com/go-pkgz/syncs v1.1.1
github.com/go-pkgz/rest v1.12.2
github.com/go-pkgz/syncs v1.2.0
github.com/go-redis/redis/v7 v7.4.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.3.0
github.com/gorilla/feeds v1.1.1
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1
github.com/jessevdk/go-flags v1.5.0
github.com/kyokomi/emoji/v2 v2.2.8
github.com/microcosm-cc/bluemonday v1.0.16
github.com/microcosm-cc/bluemonday v1.0.17
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/rs/xid v1.3.0
github.com/russross/blackfriday/v2 v2.1.0
github.com/slack-go/slack v0.9.5
github.com/slack-go/slack v0.10.1
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/umputun/go-flags v1.5.1
github.com/tidwall/gjson v1.11.0 // indirect
go.etcd.io/bbolt v1.3.6
go.uber.org/goleak v1.1.12
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/net v0.0.0-20211105192438-b53810dc28af
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit de20430

Please sign in to comment.