~poldi1405/aerc

97875a84 — Moritz Poldrack 15 days ago master
lint: add information about false positive on missing notmuch
4eac45fc — Moritz Poldrack 20 days ago
lint: add golangci-lint to the linters

go vet has been removed from the lint step as it is run by the new
linter.
17909c88 — Moritz Poldrack 19 days ago
lint: work nicely with wrapped errors (errorlint)

Error wrapping as introduced in Go 1.13 adds some additional logic to
use for comparing errors and adding information to it.
254bd187 — Moritz Poldrack 19 days ago
lint: homogenize operations and minor fixes (gocritic)

Apply GoDoc comment policy (comments for humans should have a space
after the //; machine-readable comments shouldn't)

Use strings.ReplaceAll instead of strings.Replace when appropriate

Remove if/else chains by replacing them with switches

Use short assignment/increment notation

Replace single case switches with if statements

Combine else and if when appropriate
5b5995b6 — Moritz Poldrack 20 days ago
lint: removed unused code (deadcode, structcheck, unused)
aa05e801 — Moritz Poldrack 21 days ago
lint: ensure errors are at least logged (errcheck)
9e7ff4bc — Moritz Poldrack 21 days ago
lint: merge declaration and assignment (S1021)
0479ae17 — Moritz Poldrack 21 days ago
lint: simplify code (gosimple)

Replaces infinite for loops containing a select on a channel with a
single case with a range over the channel.

Removes redundant assignments to blank identifiers.

Remove unnecessary guard clause around delete().

Remove `if condition { return true } return false` with return condition
d443d225 — Moritz Poldrack 21 days ago
lint: remove ineffectual assignments (ineffassign)
49337c7b — Moritz Poldrack 21 days ago
lint: remove unused structs and functions (unused)
9cc609b0 — Moritz Poldrack 21 days ago
lint: remove redundant returns (S1023)
af73b1cb — Moritz Poldrack 21 days ago
lint: fix function parameters being overwritten before they are used (SA4009)
bf52bef5 — Moritz Poldrack 15 days ago
lint: fix ineffective assignments (SA4005)
35681dc1 — Moritz Poldrack 21 days ago
lint: remove conditions that are always true (SA4003)
9869e37b — Moritz Poldrack 21 days ago
lint: remove empty branches (SA9003)

Empty branches are effectively dead code and should therefore be
removed.
39c47e10 — Moritz Poldrack 15 days ago
lint: formatted code
seqmap: refactor seqmap to use slice instead of map

The imap worker's seqmap is represented as a map of sequence number to
UID. This presents a problem when expunging group of messages from the
mailbox: each individual expunge decrements the sequence numbers by 1
(for every sequence number greater than the expunged). This requires a
looping around the map to update the keys. The use of a map also
requires that both the sequence number and the UID of a message be known
in order to insert it into the map. This is only discovered by fetching
individual message body parts (flags, headers, etc), leaving the seqmap
to be empty until we have fetched information about each message. In
certain instances (if a mailbox has recently been loaded), all
information is loaded in memory and no new information is fetched -
leaving the seqmap empty and the UI out of sync with the worker.

Refactor the seqmap as a slice, so that any expunge automatically
decrements the rest of the sequences.

Use the results of FetchDirectoryContents or FetchDirectoryThreaded to
initialize the seqmap with all discovered UIDs. Sort the UIDs in
ascending order: IMAP specification requires that sequence numbers start
at 1 increase in order of ascending UID.

Add individual messages to the map if they come via a MessageUpdate and
have a sequence number larger than our slice.

Update seqmap tests with new logic.

Reference: https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.1.2
Fixes: https://todo.sr.ht/~rjarry/aerc/69
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
seqmap: compare ints instead of uints

When a test fails with a uint comparison, assert displays the hex code
instead of an int, making it harder to debug. Use ints in sequmap test
asserts instead of uints for better readability when tests fail

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
seqmap: re-order test asserts

Reorder seqmap asserts to properly show display expected and actual when
performing go test -v ./...

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
filters: make it explicit that encoding is UTF-8

Document filter input charset
Add w3m filter example to default config
Adapt html and html-unsafe filters

Fixes: https://todo.sr.ht/~rjarry/aerc/65
Signed-off-by: q3cpma <q3cpma@posteo.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Next