fix: format everything [skip ci]

drew created

Change summary

config/config.go     |  3 ++-
fetcher/fetcher.go   | 34 +++++++++++++++++-----------------
main.go              |  2 +-
sender/sender.go     |  2 +-
tui/choice.go        |  2 +-
tui/composer.go      |  2 +-
tui/composer_test.go |  2 +-
tui/email_view.go    |  2 +-
tui/filepicker.go    |  2 +-
tui/inbox.go         |  6 +++---
tui/login.go         |  2 +-
tui/messages.go      |  2 +-
tui/styles.go        | 28 ++++++++++++++--------------
view/html.go         |  2 +-
14 files changed, 46 insertions(+), 45 deletions(-)

Detailed changes

config/config.go 🔗

@@ -64,6 +64,7 @@ func LoadConfig() (*Config, error) {
 	}
 	return &config, nil
 }
+
 // IMAPServer returns the IMAP server address based on the service provider.
 // This is used to connect to the email provider's IMAP server.
 // It returns an empty string if the service provider is not supported.
@@ -77,4 +78,4 @@ func (c *Config) IMAPServer() string {
 	default:
 		return ""
 	}
-}
+}

fetcher/fetcher.go 🔗

@@ -266,27 +266,27 @@ func moveEmail(cfg *config.Config, uid uint32, destMailbox string) error {
 }
 
 func DeleteEmail(cfg *config.Config, uid uint32) error {
-    c, err := connect(cfg)
-    if err != nil {
-        return err
-    }
-    defer c.Logout()
+	c, err := connect(cfg)
+	if err != nil {
+		return err
+	}
+	defer c.Logout()
 
-    if _, err := c.Select("INBOX", false); err != nil {
-        return err
-    }
+	if _, err := c.Select("INBOX", false); err != nil {
+		return err
+	}
 
-    seqSet := new(imap.SeqSet)
-    seqSet.AddNum(uid)
+	seqSet := new(imap.SeqSet)
+	seqSet.AddNum(uid)
 
-    item := imap.FormatFlagsOp(imap.AddFlags, true)
-    flags := []interface{}{imap.DeletedFlag}
+	item := imap.FormatFlagsOp(imap.AddFlags, true)
+	flags := []interface{}{imap.DeletedFlag}
 
-    if err := c.UidStore(seqSet, item, flags, nil); err != nil {
-        return err
-    }
+	if err := c.UidStore(seqSet, item, flags, nil); err != nil {
+		return err
+	}
 
-    return c.Expunge(nil)
+	return c.Expunge(nil)
 }
 
 func ArchiveEmail(cfg *config.Config, uid uint32) error {
@@ -298,4 +298,4 @@ func ArchiveEmail(cfg *config.Config, uid uint32) error {
 		archiveMailbox = "Archive"
 	}
 	return moveEmail(cfg, uid, archiveMailbox)
-}
+}

main.go 🔗

@@ -360,4 +360,4 @@ func main() {
 		fmt.Printf("Alas, there's been an error: %v", err)
 		os.Exit(1)
 	}
-}
+}

sender/sender.go 🔗

@@ -163,4 +163,4 @@ func SendEmail(cfg *config.Config, to []string, subject, plainBody, htmlBody str
 
 	addr := fmt.Sprintf("%s:%d", smtpServer, smtpPort)
 	return smtp.SendMail(addr, auth, cfg.Email, to, msg.Bytes())
-}
+}

tui/choice.go 🔗

@@ -87,4 +87,4 @@ func (m Choice) View() string {
 	b.WriteString(helpStyle.Render("Use ↑/↓ to navigate, enter to select, and ctrl+c to quit."))
 
 	return docStyle.Render(b.String())
-}
+}

tui/composer.go 🔗

@@ -220,4 +220,4 @@ func (m *Composer) View() string {
 	}
 
 	return composerView.String()
-}
+}

tui/composer_test.go 🔗

@@ -86,4 +86,4 @@ func TestComposerUpdate(t *testing.T) {
 			t.Errorf("Mismatched SendEmailMsg.\nGot:  %+v\nWant: %+v", sendMsg, expectedMsg)
 		}
 	})
-}
+}

tui/email_view.go 🔗

@@ -142,4 +142,4 @@ func (m *EmailView) View() string {
 	}
 
 	return fmt.Sprintf("%s\n%s\n%s\n%s", styledHeader, m.viewport.View(), attachmentView, help)
-}
+}

tui/filepicker.go 🔗

@@ -122,4 +122,4 @@ func (m *FilePicker) View() string {
 	b.WriteString("\n" + helpStyle.Render("↑/↓: navigate • enter: select • backspace: up • esc: cancel"))
 
 	return docStyle.Render(b.String())
-}
+}

tui/inbox.go 🔗

@@ -28,8 +28,8 @@ func (i item) FilterValue() string { return i.title + " " + i.desc }
 
 type itemDelegate struct{}
 
-func (d itemDelegate) Height() int                             { return 1 }
-func (d itemDelegate) Spacing() int                            { return 0 }
+func (d itemDelegate) Height() int                               { return 1 }
+func (d itemDelegate) Spacing() int                              { return 0 }
 func (d itemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd { return nil }
 func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item) {
 	i, ok := listItem.(item)
@@ -169,4 +169,4 @@ func (m *Inbox) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 
 func (m *Inbox) View() string {
 	return "\n" + m.list.View()
-}
+}

tui/login.go 🔗

@@ -121,4 +121,4 @@ func (m *Login) View() string {
 		m.inputs[3].View(),
 		helpStyle.Render("\nenter: save • tab: next field • esc: back to menu"),
 	)
-}
+}

tui/messages.go 🔗

@@ -109,4 +109,4 @@ type DiscardDraftMsg struct {
 }
 
 // RestoreDraftMsg signals that the cached draft should be restored.
-type RestoreDraftMsg struct{}
+type RestoreDraftMsg struct{}

tui/styles.go 🔗

@@ -10,13 +10,13 @@ import (
 
 var (
 	DialogBoxStyle = lipgloss.NewStyle().
-		Border(lipgloss.RoundedBorder()).
-		BorderForeground(lipgloss.Color("#874BFD")).
-		Padding(1, 0).
-		BorderTop(true).
-		BorderLeft(true).
-		BorderRight(true).
-		BorderBottom(true)
+			Border(lipgloss.RoundedBorder()).
+			BorderForeground(lipgloss.Color("#874BFD")).
+			Padding(1, 0).
+			BorderTop(true).
+			BorderLeft(true).
+			BorderRight(true).
+			BorderBottom(true)
 
 	HelpStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
 	SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).Bold(true)
@@ -27,15 +27,15 @@ var DocStyle = lipgloss.NewStyle().Margin(1, 2)
 
 // A simple model for showing a status message
 type Status struct {
-    spinner spinner.Model
-    message string
+	spinner spinner.Model
+	message string
 }
 
 func NewStatus(msg string) Status {
-    s := spinner.New()
-    s.Spinner = spinner.Dot
-    s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
-    return Status{spinner: s, message: msg}
+	s := spinner.New()
+	s.Spinner = spinner.Dot
+	s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
+	return Status{spinner: s, message: msg}
 }
 
 func (m Status) Init() tea.Cmd { return m.spinner.Tick }
@@ -48,4 +48,4 @@ func (m Status) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 
 func (m Status) View() string {
 	return fmt.Sprintf("\n\n   %s %s\n\n", m.spinner.View(), m.message)
-}
+}

view/html.go 🔗

@@ -105,4 +105,4 @@ func ProcessBody(rawBody string) (string, error) {
 	text = re.ReplaceAllString(text, "\n\n")
 
 	return text, nil
-}
+}