- commit
- cd38fc4
- parent
- ae223ad
- author
- Antonio Mika
- date
- 2022-12-11 23:26:23 +0000 UTC
Fix lint
31 files changed,
+65,
-65
+5,
-5
1@@ -8,6 +8,11 @@ import (
2 "syscall"
3 "time"
4
5+ "github.com/charmbracelet/promwish"
6+ "github.com/charmbracelet/wish"
7+ bm "github.com/charmbracelet/wish/bubbletea"
8+ lm "github.com/charmbracelet/wish/logging"
9+ "github.com/gliderlabs/ssh"
10 "github.com/picosh/pico/db/postgres"
11 uploadimgs "github.com/picosh/pico/filehandlers/imgs"
12 "github.com/picosh/pico/imgs"
13@@ -22,11 +27,6 @@ import (
14 "github.com/picosh/pico/wish/send/scp"
15 "github.com/picosh/pico/wish/send/sftp"
16 "github.com/picosh/pico/wish/send/utils"
17- "github.com/charmbracelet/promwish"
18- "github.com/charmbracelet/wish"
19- bm "github.com/charmbracelet/wish/bubbletea"
20- lm "github.com/charmbracelet/wish/logging"
21- "github.com/gliderlabs/ssh"
22 )
23
24 type SSHServer struct{}
+5,
-5
1@@ -8,6 +8,11 @@ import (
2 "syscall"
3 "time"
4
5+ "github.com/charmbracelet/promwish"
6+ "github.com/charmbracelet/wish"
7+ bm "github.com/charmbracelet/wish/bubbletea"
8+ lm "github.com/charmbracelet/wish/logging"
9+ "github.com/gliderlabs/ssh"
10 "github.com/picosh/pico/db/postgres"
11 "github.com/picosh/pico/filehandlers"
12 "github.com/picosh/pico/imgs/storage"
13@@ -21,11 +26,6 @@ import (
14 wishrsync "github.com/picosh/pico/wish/send/rsync"
15 "github.com/picosh/pico/wish/send/scp"
16 "github.com/picosh/pico/wish/send/sftp"
17- "github.com/charmbracelet/promwish"
18- "github.com/charmbracelet/wish"
19- bm "github.com/charmbracelet/wish/bubbletea"
20- lm "github.com/charmbracelet/wish/logging"
21- "github.com/gliderlabs/ssh"
22 )
23
24 type SSHServer struct{}
+5,
-5
1@@ -8,6 +8,11 @@ import (
2 "syscall"
3 "time"
4
5+ "github.com/charmbracelet/promwish"
6+ "github.com/charmbracelet/wish"
7+ bm "github.com/charmbracelet/wish/bubbletea"
8+ lm "github.com/charmbracelet/wish/logging"
9+ "github.com/gliderlabs/ssh"
10 "github.com/picosh/pico/db/postgres"
11 "github.com/picosh/pico/filehandlers"
12 "github.com/picosh/pico/imgs/storage"
13@@ -21,11 +26,6 @@ import (
14 wishrsync "github.com/picosh/pico/wish/send/rsync"
15 "github.com/picosh/pico/wish/send/scp"
16 "github.com/picosh/pico/wish/send/sftp"
17- "github.com/charmbracelet/promwish"
18- "github.com/charmbracelet/wish"
19- bm "github.com/charmbracelet/wish/bubbletea"
20- lm "github.com/charmbracelet/wish/logging"
21- "github.com/gliderlabs/ssh"
22 )
23
24 type SSHServer struct{}
+5,
-5
1@@ -8,6 +8,11 @@ import (
2 "syscall"
3 "time"
4
5+ "github.com/charmbracelet/promwish"
6+ "github.com/charmbracelet/wish"
7+ bm "github.com/charmbracelet/wish/bubbletea"
8+ lm "github.com/charmbracelet/wish/logging"
9+ "github.com/gliderlabs/ssh"
10 "github.com/picosh/pico/db/postgres"
11 "github.com/picosh/pico/filehandlers"
12 "github.com/picosh/pico/imgs/storage"
13@@ -21,11 +26,6 @@ import (
14 wishrsync "github.com/picosh/pico/wish/send/rsync"
15 "github.com/picosh/pico/wish/send/scp"
16 "github.com/picosh/pico/wish/send/sftp"
17- "github.com/charmbracelet/promwish"
18- "github.com/charmbracelet/wish"
19- bm "github.com/charmbracelet/wish/bubbletea"
20- lm "github.com/charmbracelet/wish/logging"
21- "github.com/gliderlabs/ssh"
22 )
23
24 type SSHServer struct{}
+2,
-2
1@@ -97,8 +97,8 @@ func main() {
2 datesFixed := []string{}
3 logger.Info("updating dates")
4 for _, post := range posts {
5+ linkify := imgs.NewImgsLinkify(post.Username)
6 if post.Space == "prose" {
7- linkify := imgs.NewImgsLinkify(post.Username)
8 parsed, err := shared.ParseText(post.Text, linkify)
9 if err != nil {
10 logger.Error(err)
11@@ -117,7 +117,7 @@ func main() {
12 }
13 }
14 } else if post.Space == "lists" {
15- parsed := lists.ParseText(post.Text)
16+ parsed := lists.ParseText(post.Text, linkify)
17
18 if parsed.MetaData.PublishAt != nil && !parsed.MetaData.PublishAt.IsZero() {
19 err = updateDates(tx, post.ID, parsed.MetaData.PublishAt)
+1,
-1
1@@ -9,9 +9,9 @@ import (
2 "strings"
3 "time"
4
5+ _ "github.com/lib/pq"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/wish/cms/config"
8- _ "github.com/lib/pq"
9 "go.uber.org/zap"
10 "golang.org/x/exp/slices"
11 )
+2,
-2
1@@ -10,13 +10,13 @@ import (
2 "strings"
3 "time"
4
5+ "github.com/gliderlabs/ssh"
6+ exifremove "github.com/neurosnap/go-exif-remove"
7 "github.com/picosh/pico/db"
8 "github.com/picosh/pico/imgs/storage"
9 "github.com/picosh/pico/shared"
10 "github.com/picosh/pico/wish/cms/util"
11 "github.com/picosh/pico/wish/send/utils"
12- "github.com/gliderlabs/ssh"
13- exifremove "github.com/neurosnap/go-exif-remove"
14 "golang.org/x/exp/slices"
15 )
16
+1,
-1
1@@ -5,10 +5,10 @@ import (
2 "fmt"
3 "strings"
4
5+ "github.com/gliderlabs/ssh"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/imgs/storage"
8 "github.com/picosh/pico/shared"
9- "github.com/gliderlabs/ssh"
10 )
11
12 func (h *UploadImgHandler) validateImg(data *PostMetaData) (bool, error) {
+1,
-1
1@@ -10,13 +10,13 @@ import (
2 "strings"
3 "time"
4
5+ "github.com/gliderlabs/ssh"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/imgs"
8 "github.com/picosh/pico/imgs/storage"
9 "github.com/picosh/pico/shared"
10 "github.com/picosh/pico/wish/cms/util"
11 "github.com/picosh/pico/wish/send/utils"
12- "github.com/gliderlabs/ssh"
13 )
14
15 type ctxUserKey struct{}
+1,
-1
1@@ -11,11 +11,11 @@ import (
2
3 _ "net/http/pprof"
4
5+ "github.com/gorilla/feeds"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/db/postgres"
8 "github.com/picosh/pico/imgs/storage"
9 "github.com/picosh/pico/shared"
10- "github.com/gorilla/feeds"
11 "go.uber.org/zap"
12 "golang.org/x/exp/slices"
13 )
+1,
-1
1@@ -1,12 +1,12 @@
2 package imgs
3
4 import (
5+ "github.com/gliderlabs/ssh"
6 "github.com/picosh/pico/db"
7 uploadimgs "github.com/picosh/pico/filehandlers/imgs"
8 "github.com/picosh/pico/imgs/storage"
9 "github.com/picosh/pico/shared"
10 "github.com/picosh/pico/wish/send/utils"
11- "github.com/gliderlabs/ssh"
12 )
13
14 type IImgsAPI interface {
+1,
-1
1@@ -10,12 +10,12 @@ import (
2 "strconv"
3 "time"
4
5+ "github.com/gorilla/feeds"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/db/postgres"
8 "github.com/picosh/pico/imgs"
9 "github.com/picosh/pico/imgs/storage"
10 "github.com/picosh/pico/shared"
11- "github.com/gorilla/feeds"
12 "golang.org/x/exp/slices"
13 )
14
+1,
-1
1@@ -7,8 +7,8 @@ import (
2 "strings"
3 "time"
4
5- "github.com/picosh/pico/shared"
6 "github.com/araddon/dateparse"
7+ "github.com/picosh/pico/shared"
8 )
9
10 var reIndent = regexp.MustCompile(`^[[:blank:]]+`)
+1,
-1
1@@ -10,12 +10,12 @@ import (
2 "strconv"
3 "time"
4
5+ "github.com/gorilla/feeds"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/db/postgres"
8 "github.com/picosh/pico/imgs"
9 "github.com/picosh/pico/imgs/storage"
10 "github.com/picosh/pico/shared"
11- "github.com/gorilla/feeds"
12 "golang.org/x/exp/slices"
13 )
14
+2,
-2
1@@ -8,10 +8,10 @@ import (
2 "strings"
3 "time"
4
5- "github.com/picosh/pico/wish/send"
6- "github.com/picosh/pico/wish/send/utils"
7 "github.com/charmbracelet/wish"
8 "github.com/gliderlabs/ssh"
9+ "github.com/picosh/pico/wish/send"
10+ "github.com/picosh/pico/wish/send/utils"
11 )
12
13 type handler struct {
+8,
-8
1@@ -4,6 +4,14 @@ import (
2 "errors"
3 "fmt"
4
5+ "github.com/charmbracelet/bubbles/spinner"
6+ tea "github.com/charmbracelet/bubbletea"
7+ "github.com/charmbracelet/lipgloss"
8+ bm "github.com/charmbracelet/wish/bubbletea"
9+ "github.com/gliderlabs/ssh"
10+ "github.com/muesli/reflow/indent"
11+ "github.com/muesli/reflow/wordwrap"
12+ "github.com/muesli/reflow/wrap"
13 "github.com/picosh/pico/db"
14 "github.com/picosh/pico/db/postgres"
15 "github.com/picosh/pico/imgs/storage"
16@@ -15,14 +23,6 @@ import (
17 "github.com/picosh/pico/wish/cms/ui/posts"
18 "github.com/picosh/pico/wish/cms/ui/username"
19 "github.com/picosh/pico/wish/cms/util"
20- "github.com/charmbracelet/bubbles/spinner"
21- tea "github.com/charmbracelet/bubbletea"
22- "github.com/charmbracelet/lipgloss"
23- bm "github.com/charmbracelet/wish/bubbletea"
24- "github.com/gliderlabs/ssh"
25- "github.com/muesli/reflow/indent"
26- "github.com/muesli/reflow/wordwrap"
27- "github.com/muesli/reflow/wrap"
28 )
29
30 type status int
+3,
-3
1@@ -5,12 +5,12 @@ import (
2 "fmt"
3 "strings"
4
5- "github.com/picosh/pico/db"
6- "github.com/picosh/pico/wish/cms/config"
7- "github.com/picosh/pico/wish/cms/ui/common"
8 "github.com/charmbracelet/bubbles/spinner"
9 input "github.com/charmbracelet/bubbles/textinput"
10 tea "github.com/charmbracelet/bubbletea"
11+ "github.com/picosh/pico/db"
12+ "github.com/picosh/pico/wish/cms/config"
13+ "github.com/picosh/pico/wish/cms/ui/common"
14 )
15
16 type state int
+3,
-3
1@@ -3,12 +3,12 @@ package createkey
2 import (
3 "strings"
4
5- "github.com/picosh/pico/db"
6- "github.com/picosh/pico/wish/cms/config"
7- "github.com/picosh/pico/wish/cms/ui/common"
8 "github.com/charmbracelet/bubbles/spinner"
9 input "github.com/charmbracelet/bubbles/textinput"
10 tea "github.com/charmbracelet/bubbletea"
11+ "github.com/picosh/pico/db"
12+ "github.com/picosh/pico/wish/cms/config"
13+ "github.com/picosh/pico/wish/cms/ui/common"
14 "golang.org/x/crypto/ssh"
15 )
16
+1,
-1
1@@ -1,10 +1,10 @@
2 package info
3
4 import (
5+ tea "github.com/charmbracelet/bubbletea"
6 "github.com/picosh/pico/db"
7 "github.com/picosh/pico/wish/cms/config"
8 "github.com/picosh/pico/wish/cms/ui/common"
9- tea "github.com/charmbracelet/bubbletea"
10 )
11
12 type errMsg struct {
+3,
-3
1@@ -3,13 +3,13 @@ package keys
2 import (
3 "fmt"
4
5+ pager "github.com/charmbracelet/bubbles/paginator"
6+ "github.com/charmbracelet/bubbles/spinner"
7+ tea "github.com/charmbracelet/bubbletea"
8 "github.com/picosh/pico/db"
9 "github.com/picosh/pico/wish/cms/config"
10 "github.com/picosh/pico/wish/cms/ui/common"
11 "github.com/picosh/pico/wish/cms/ui/createkey"
12- pager "github.com/charmbracelet/bubbles/paginator"
13- "github.com/charmbracelet/bubbles/spinner"
14- tea "github.com/charmbracelet/bubbletea"
15 )
16
17 const keysPerPage = 4
+2,
-2
1@@ -5,11 +5,11 @@ import (
2 "fmt"
3 "strings"
4
5- "github.com/picosh/pico/db"
6- "github.com/picosh/pico/wish/cms/ui/common"
7 "github.com/charmbracelet/bubbles/spinner"
8 input "github.com/charmbracelet/bubbles/textinput"
9 tea "github.com/charmbracelet/bubbletea"
10+ "github.com/picosh/pico/db"
11+ "github.com/picosh/pico/wish/cms/ui/common"
12 )
13
14 type state int
+1,
-1
1@@ -4,9 +4,9 @@ import (
2 "sort"
3 "strings"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/charmbracelet/wish"
7 "github.com/gliderlabs/ssh"
8+ "github.com/picosh/pico/wish/send/utils"
9 )
10
11 func Middleware(writeHandler utils.CopyFromClientHandler) wish.Middleware {
+1,
-1
1@@ -7,9 +7,9 @@ import (
2 "strings"
3 "time"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/charmbracelet/wish"
7 "github.com/gliderlabs/ssh"
8+ "github.com/picosh/pico/wish/send/utils"
9 )
10
11 func Middleware(writeHandler utils.CopyFromClientHandler, ext string) wish.Middleware {
+1,
-1
1@@ -1,9 +1,9 @@
2 package auth
3
4 import (
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/charmbracelet/wish"
7 "github.com/gliderlabs/ssh"
8+ "github.com/picosh/pico/wish/send/utils"
9 )
10
11 func Middleware(writeHandler utils.CopyFromClientHandler) wish.Middleware {
+1,
-1
1@@ -8,12 +8,12 @@ import (
2 "os"
3 "path"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/antoniomika/go-rsync-receiver/rsyncreceiver"
7 "github.com/antoniomika/go-rsync-receiver/rsyncsender"
8 rsyncutils "github.com/antoniomika/go-rsync-receiver/utils"
9 "github.com/charmbracelet/wish"
10 "github.com/gliderlabs/ssh"
11+ "github.com/picosh/pico/wish/send/utils"
12 )
13
14 type handler struct {
+1,
-1
1@@ -10,8 +10,8 @@ import (
2 "regexp"
3 "strconv"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/gliderlabs/ssh"
7+ "github.com/picosh/pico/wish/send/utils"
8 )
9
10 var (
+1,
-1
1@@ -3,8 +3,8 @@ package scp
2 import (
3 "errors"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/gliderlabs/ssh"
7+ "github.com/picosh/pico/wish/send/utils"
8 )
9
10 func copyToClient(session ssh.Session, info Info, handler utils.CopyFromClientHandler) error {
+1,
-1
1@@ -3,9 +3,9 @@ package scp
2 import (
3 "fmt"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/charmbracelet/wish"
7 "github.com/gliderlabs/ssh"
8+ "github.com/picosh/pico/wish/send/utils"
9 )
10
11 func Middleware(writeHandler utils.CopyFromClientHandler) wish.Middleware {
+2,
-2
1@@ -1,14 +1,14 @@
2 package send
3
4 import (
5+ "github.com/charmbracelet/wish"
6+ "github.com/gliderlabs/ssh"
7 "github.com/picosh/pico/wish/pipe"
8 "github.com/picosh/pico/wish/send/auth"
9 "github.com/picosh/pico/wish/send/rsync"
10 "github.com/picosh/pico/wish/send/scp"
11 "github.com/picosh/pico/wish/send/sftp"
12 "github.com/picosh/pico/wish/send/utils"
13- "github.com/charmbracelet/wish"
14- "github.com/gliderlabs/ssh"
15 )
16
17 func Middleware(writeHandler utils.CopyFromClientHandler) ssh.Option {
+1,
-1
1@@ -6,8 +6,8 @@ import (
2 "os"
3 "path"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/gliderlabs/ssh"
7+ "github.com/picosh/pico/wish/send/utils"
8 "github.com/pkg/sftp"
9 )
10
+1,
-1
1@@ -5,8 +5,8 @@ import (
2 "io"
3 "log"
4
5- "github.com/picosh/pico/wish/send/utils"
6 "github.com/gliderlabs/ssh"
7+ "github.com/picosh/pico/wish/send/utils"
8 "github.com/pkg/sftp"
9 )
10