mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
chore: Disable funlen linter
This commit is contained in:
@ -415,7 +415,7 @@ func (user *User) handleDeleteLabelEvent(ctx context.Context, event proton.Label
|
||||
}
|
||||
|
||||
// handleMessageEvents handles the given message events.
|
||||
func (user *User) handleMessageEvents(ctx context.Context, messageEvents []proton.MessageEvent) error { //nolint:funlen
|
||||
func (user *User) handleMessageEvents(ctx context.Context, messageEvents []proton.MessageEvent) error {
|
||||
for _, event := range messageEvents {
|
||||
ctx = logging.WithLogrusField(ctx, "messageID", event.ID)
|
||||
|
||||
|
||||
@ -264,8 +264,6 @@ func (conn *imapConnector) DeleteMailbox(ctx context.Context, labelID imap.Mailb
|
||||
}
|
||||
|
||||
// CreateMessage creates a new message on the remote.
|
||||
//
|
||||
// nolint:funlen
|
||||
func (conn *imapConnector) CreateMessage(
|
||||
ctx context.Context,
|
||||
mailboxID imap.MailboxID,
|
||||
@ -589,7 +587,7 @@ func toIMAPMessage(message proton.MessageMetadata) imap.Message {
|
||||
}
|
||||
}
|
||||
|
||||
func (conn *imapConnector) createDraft(ctx context.Context, literal []byte, addrKR *crypto.KeyRing, sender proton.Address) (proton.Message, error) { //nolint:funlen
|
||||
func (conn *imapConnector) createDraft(ctx context.Context, literal []byte, addrKR *crypto.KeyRing, sender proton.Address) (proton.Message, error) {
|
||||
// Create a new message parser from the reader.
|
||||
parser, err := parser.New(bytes.NewReader(literal))
|
||||
if err != nil {
|
||||
|
||||
@ -218,8 +218,6 @@ func (h *sendRecorder) getWaitCh(hash string) (<-chan struct{}, bool) {
|
||||
// - the Content-Type header of each (leaf) part,
|
||||
// - the Content-Disposition header of each (leaf) part,
|
||||
// - the (decoded) body of each part.
|
||||
//
|
||||
// nolint:funlen
|
||||
func getMessageHash(b []byte) (string, error) {
|
||||
section := rfc822.Parse(b)
|
||||
|
||||
|
||||
@ -47,8 +47,6 @@ import (
|
||||
)
|
||||
|
||||
// sendMail sends an email from the given address to the given recipients.
|
||||
//
|
||||
// nolint:funlen
|
||||
func (user *User) sendMail(authID string, from string, to []string, r io.Reader) error {
|
||||
return safe.RLockRet(func() error {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
@ -165,7 +163,7 @@ func (user *User) sendMail(authID string, from string, to []string, r io.Reader)
|
||||
}
|
||||
|
||||
// sendWithKey sends the message with the given address key.
|
||||
func sendWithKey( //nolint:funlen
|
||||
func sendWithKey(
|
||||
ctx context.Context,
|
||||
client *proton.Client,
|
||||
sentry reporter.Reporter,
|
||||
@ -247,7 +245,7 @@ func sendWithKey( //nolint:funlen
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func getParentID( //nolint:funlen
|
||||
func getParentID(
|
||||
ctx context.Context,
|
||||
client *proton.Client,
|
||||
authAddrID string,
|
||||
@ -375,7 +373,6 @@ func createDraft(
|
||||
})
|
||||
}
|
||||
|
||||
// nolint:funlen
|
||||
func createAttachments(
|
||||
ctx context.Context,
|
||||
client *proton.Client,
|
||||
|
||||
@ -87,7 +87,6 @@ func (user *User) doSync(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// nolint:funlen
|
||||
func (user *User) sync(ctx context.Context) error {
|
||||
return safe.RLockRet(func() error {
|
||||
return withAddrKRs(user.apiUser, user.apiAddrs, user.vault.KeyPass(), func(_ *crypto.KeyRing, addrKRs map[string]*crypto.KeyRing) error {
|
||||
@ -218,7 +217,7 @@ func toMB(v uint64) float64 {
|
||||
return float64(v) / float64(Megabyte)
|
||||
}
|
||||
|
||||
// nolint:funlen,gocyclo
|
||||
// nolint:gocyclo
|
||||
func syncMessages(
|
||||
ctx context.Context,
|
||||
userID string,
|
||||
|
||||
@ -90,8 +90,6 @@ type User struct {
|
||||
}
|
||||
|
||||
// New returns a new user.
|
||||
//
|
||||
// nolint:funlen
|
||||
func New(
|
||||
ctx context.Context,
|
||||
encVault *vault.User,
|
||||
@ -101,7 +99,7 @@ func New(
|
||||
crashHandler async.PanicHandler,
|
||||
showAllMail bool,
|
||||
maxSyncMemory uint64,
|
||||
) (*User, error) { //nolint:funlen
|
||||
) (*User, error) {
|
||||
logrus.WithField("userID", apiUser.ID).Info("Creating new user")
|
||||
|
||||
// Get the user's API addresses.
|
||||
@ -419,8 +417,6 @@ func (user *User) NewIMAPConnectors() (map[string]connector.Connector, error) {
|
||||
}
|
||||
|
||||
// SendMail sends an email from the given address to the given recipients.
|
||||
//
|
||||
// nolint:funlen
|
||||
func (user *User) SendMail(authID string, from string, to []string, r io.Reader) error {
|
||||
defer user.goPollAPIEvents(true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user