Add tagref source code annotations

Source Code Annotation Tags:

Global tags (in tagref format <https://github.com/stepchowfun/tagref>)
for source code annotation:

- [tag:hardcoded_color_value] Replace hardcoded color values with user
   configurable ones.
- [tag:needs_unit_test]
- [tag:needs_user_doc]
- [tag:needs_dev_doc]
- [tag:FIXME]
- [tag:TODO]
- [tag:VERIFY] Verify whether this is the correct way to do something
- [tag:DEBT] Technical debt
pull/260/head
Manos Pitsidianakis 11 months ago
parent a5770c89f4
commit d4e605c098
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -21,6 +21,7 @@
CARGO_TARGET_DIR ?= target CARGO_TARGET_DIR ?= target
MIN_RUSTC ?= 1.65.0 MIN_RUSTC ?= 1.65.0
CARGO_BIN ?= cargo CARGO_BIN ?= cargo
TAGREF_BIN ?= tagref
CARGO_ARGS ?= CARGO_ARGS ?=
CARGO_SORT_BIN = cargo-sort CARGO_SORT_BIN = cargo-sort
PRINTF = /usr/bin/printf PRINTF = /usr/bin/printf
@ -94,7 +95,7 @@ help:
@#@echo "* CARGO_COLOR = ${CARGO_COLOR}" @#@echo "* CARGO_COLOR = ${CARGO_COLOR}"
.PHONY: check .PHONY: check
check: check: check-tagrefs
@${CARGO_BIN} check ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" ${FEATURES} --all --tests --examples --benches --bins @${CARGO_BIN} check ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" ${FEATURES} --all --tests --examples --benches --bins
.PHONY: fmt .PHONY: fmt
@ -185,3 +186,13 @@ deb-dist:
.PHONY: build-rustdoc .PHONY: build-rustdoc
build-rustdoc: build-rustdoc:
@RUSTDOCFLAGS="--crate-version ${VERSION}_${GIT_COMMIT}_${DATE}" ${CARGO_BIN} doc ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --all-features --no-deps --workspace --document-private-items --open @RUSTDOCFLAGS="--crate-version ${VERSION}_${GIT_COMMIT}_${DATE}" ${CARGO_BIN} doc ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --all-features --no-deps --workspace --document-private-items --open
.PHONY: check-tagrefs
check-tagrefs:
@(if ! command -v "$(TAGREF_BIN)" > /dev/null;\
then \
$(PRINTF) "Warning: tagref binary not in PATH.\n" 1>&2;\
exit;\
else \
$(TAGREF_BIN);\
fi)

@ -717,7 +717,7 @@ for PGP configuration.
.It Cm save-draft .It Cm save-draft
saves a copy of the draft in the Draft folder saves a copy of the draft in the Draft folder
.El .El
.\" TODO add contacts section .\" [ref:TODO]: add contacts section
.Sh THEMES .Sh THEMES
See See
.Xr meli-themes 5 .Xr meli-themes 5

@ -31,7 +31,7 @@ use smallvec::SmallVec;
use super::*; use super::*;
use crate::{conf::accounts::JobRequest, types::segment_tree::SegmentTree}; use crate::{conf::accounts::JobRequest, types::segment_tree::SegmentTree};
// TODO: emoji_text_presentation_selector should be printed along with the chars // [ref:TODO]: emoji_text_presentation_selector should be printed along with the chars
// before it but not as a separate Cell // before it but not as a separate Cell
//macro_rules! emoji_text_presentation_selector { //macro_rules! emoji_text_presentation_selector {
// () => { // () => {
@ -55,7 +55,7 @@ pub const DEFAULT_SNOOZED_FLAG: &str = "💤";
pub struct RowsState<T> { pub struct RowsState<T> {
pub selection: HashMap<EnvelopeHash, bool>, pub selection: HashMap<EnvelopeHash, bool>,
pub row_updates: SmallVec<[EnvelopeHash; 8]>, pub row_updates: SmallVec<[EnvelopeHash; 8]>,
/// FIXME: env vec should have at least one element guaranteed /// [ref:FIXME]: env vec should have at least one element guaranteed
pub thread_to_env: HashMap<ThreadHash, SmallVec<[EnvelopeHash; 8]>>, pub thread_to_env: HashMap<ThreadHash, SmallVec<[EnvelopeHash; 8]>>,
pub env_to_thread: HashMap<EnvelopeHash, ThreadHash>, pub env_to_thread: HashMap<EnvelopeHash, ThreadHash>,
pub thread_order: HashMap<ThreadHash, usize>, pub thread_order: HashMap<ThreadHash, usize>,

@ -589,7 +589,7 @@ impl ListingTrait for CompactListing {
.get_thread_under_cursor(self.cursor_pos.2 + 1) .get_thread_under_cursor(self.cursor_pos.2 + 1)
.is_some() .is_some()
{ {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Down(1)); self.movement = Some(PageMovement::Down(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -609,7 +609,7 @@ impl ListingTrait for CompactListing {
.get_thread_under_cursor(self.cursor_pos.2 - 1) .get_thread_under_cursor(self.cursor_pos.2 - 1)
.is_some() .is_some()
{ {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Up(1)); self.movement = Some(PageMovement::Up(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -1848,7 +1848,7 @@ impl Component for CompactListing {
self.sort = (*field, *order); self.sort = (*field, *order);
self.sortcmd = true; self.sortcmd = true;
if !self.filtered_selection.is_empty() { if !self.filtered_selection.is_empty() {
// FIXME: perform sort // [ref:FIXME]: perform sort
self.set_dirty(true); self.set_dirty(true);
} else { } else {
self.refresh_mailbox(context, false); self.refresh_mailbox(context, false);
@ -1857,10 +1857,11 @@ impl Component for CompactListing {
} }
Action::SubSort(field, order) if !self.unfocused() => { Action::SubSort(field, order) if !self.unfocused() => {
self.subsort = (*field, *order); self.subsort = (*field, *order);
// FIXME: perform subsort. // [ref:FIXME]: perform subsort.
return true; return true;
} }
Action::Listing(ToggleThreadSnooze) if !self.unfocused() => { Action::Listing(ToggleThreadSnooze) if !self.unfocused() => {
// [ref:FIXME]: Re-implement toggle thread snooze
/* /*
let thread = self.get_thread_under_cursor(self.cursor_pos.2); let thread = self.get_thread_under_cursor(self.cursor_pos.2);
let account = &mut context.accounts[&self.cursor_pos.0]; let account = &mut context.accounts[&self.cursor_pos.0];

@ -402,7 +402,7 @@ impl ListingTrait for ConversationsListing {
.get_thread_under_cursor(self.cursor_pos.2 + 1) .get_thread_under_cursor(self.cursor_pos.2 + 1)
.is_some() .is_some()
{ {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Down(1)); self.movement = Some(PageMovement::Down(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -422,7 +422,7 @@ impl ListingTrait for ConversationsListing {
.get_thread_under_cursor(self.cursor_pos.2 - 1) .get_thread_under_cursor(self.cursor_pos.2 - 1)
.is_some() .is_some()
{ {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Up(1)); self.movement = Some(PageMovement::Up(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;

@ -319,7 +319,7 @@ impl ListingTrait for PlainListing {
fn next_entry(&mut self, context: &mut Context) { fn next_entry(&mut self, context: &mut Context) {
if self.get_env_under_cursor(self.cursor_pos.2 + 1).is_some() { if self.get_env_under_cursor(self.cursor_pos.2 + 1).is_some() {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Down(1)); self.movement = Some(PageMovement::Down(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -336,7 +336,7 @@ impl ListingTrait for PlainListing {
return; return;
} }
if self.get_env_under_cursor(self.cursor_pos.2 - 1).is_some() { if self.get_env_under_cursor(self.cursor_pos.2 - 1).is_some() {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Up(1)); self.movement = Some(PageMovement::Up(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;

@ -435,7 +435,7 @@ impl ListingTrait for ThreadListing {
fn next_entry(&mut self, context: &mut Context) { fn next_entry(&mut self, context: &mut Context) {
if self.get_env_under_cursor(self.cursor_pos.2 + 1).is_some() { if self.get_env_under_cursor(self.cursor_pos.2 + 1).is_some() {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Down(1)); self.movement = Some(PageMovement::Down(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -450,7 +450,7 @@ impl ListingTrait for ThreadListing {
return; return;
} }
if self.get_env_under_cursor(self.cursor_pos.2 - 1).is_some() { if self.get_env_under_cursor(self.cursor_pos.2 - 1).is_some() {
// TODO: makes this less ugly. // [ref:TODO]: makes this less ugly.
self.movement = Some(PageMovement::Up(1)); self.movement = Some(PageMovement::Up(1));
self.force_draw = true; self.force_draw = true;
self.dirty = true; self.dirty = true;
@ -757,7 +757,6 @@ impl ThreadListing {
fn highlight_line_self(&mut self, _idx: usize, _context: &Context) { fn highlight_line_self(&mut self, _idx: usize, _context: &Context) {
/* /*
* FIXME
if self.length == 0 { if self.length == 0 {
return; return;
} }

@ -653,7 +653,7 @@ impl Component for MailView {
/* autosend or open unsubscribe option */ /* autosend or open unsubscribe option */
let unsubscribe = actions.unsubscribe.as_ref().unwrap(); let unsubscribe = actions.unsubscribe.as_ref().unwrap();
for option in unsubscribe.iter() { for option in unsubscribe.iter() {
/* TODO: Ask for confirmation before proceding with an action */ /* [ref:TODO]: Ask for confirmation before proceding with an action */
match option { match option {
list_management::ListAction::Email(email) => { list_management::ListAction::Email(email) => {
if let Ok(mailto) = Mailto::try_from(*email) { if let Ok(mailto) = Mailto::try_from(*email) {

@ -152,7 +152,7 @@ impl EnvelopeView {
err.to_string(), err.to_string(),
Some(NotificationType::Error(melib::ErrorKind::External)), Some(NotificationType::Error(melib::ErrorKind::External)),
))); )));
// FIXME: add `v` configurable shortcut // [ref:FIXME]: add `v` configurable shortcut
let comment = Some(format!( let comment = Some(format!(
"Failed to start html filter process: `{}`. Press `v` to open in web \ "Failed to start html filter process: `{}`. Press `v` to open in web \
browser. \n\n", browser. \n\n",
@ -166,7 +166,7 @@ impl EnvelopeView {
}); });
} }
Ok(text) => { Ok(text) => {
// FIXME: add `v` configurable shortcut // [ref:FIXME]: add `v` configurable shortcut
let comment = Some(format!( let comment = Some(format!(
"Text piped through `{}`. Press `v` to open in web browser. \n\n", "Text piped through `{}`. Press `v` to open in web browser. \n\n",
filter_invocation filter_invocation

@ -941,7 +941,7 @@ impl ThreadView {
&& stack.len() > 1 && stack.len() > 1
&& stack[stack.len() - 2] >= e.indentation => && stack[stack.len() - 2] >= e.indentation =>
{ {
//FIXME pop all until e.indentation // [ref:FIXME]: pop all until e.indentation
visies.push(vec![idx]); visies.push(vec![idx]);
stack.pop(); stack.pop();
(visies, stack, e.hidden) (visies, stack, e.hidden)

@ -126,7 +126,7 @@ pub struct VSplit {
impl fmt::Display for VSplit { impl fmt::Display for VSplit {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// TODO display focused component // [ref:TODO]: display focused component
Display::fmt(&self.right, f) Display::fmt(&self.right, f)
} }
} }

@ -300,7 +300,7 @@ impl Component for TextField {
/* Ctrl+E End of line */ /* Ctrl+E End of line */
self.inner.set_cursor(self.inner.as_str().len()); self.inner.set_cursor(self.inner.as_str().len());
} }
/* TODO: add rest of readline shortcuts */ /* [ref:TODO]: add rest of readline shortcuts */
_ => { _ => {
return false; return false;
} }

@ -863,7 +863,7 @@ impl AutoComplete {
return false; return false;
} }
// FIXME: remove hardcoded color values // [ref:hardcoded_color_value]
let mut content = CellBuffer::new( let mut content = CellBuffer::new(
entries entries
.iter() .iter()

@ -2102,7 +2102,7 @@ impl Account {
&self.mailbox_entries, &self.mailbox_entries,
&mut self.mailboxes_order, &mut self.mailboxes_order,
); );
// FIXME remove from settings as well // [ref:FIXME] remove from settings as well
self.main_loop_handler.send(ThreadEvent::UIEvent( self.main_loop_handler.send(ThreadEvent::UIEvent(
UIEvent::Notification( UIEvent::Notification(
@ -2196,7 +2196,7 @@ impl Account {
if err.kind.is_timeout() { if err.kind.is_timeout() {
self.watch(); self.watch();
} else { } else {
//TODO: relaunch watch job with ratelimit for failure // [ref:TODO]: relaunch watch job with ratelimit for failure
self.main_loop_handler.send(ThreadEvent::UIEvent( self.main_loop_handler.send(ThreadEvent::UIEvent(
UIEvent::Notification( UIEvent::Notification(
Some(format!("{}: watch thread failed", &self.name)), Some(format!("{}: watch thread failed", &self.name)),

@ -155,7 +155,7 @@ impl MailcapEntry {
let mut f = None; let mut f = None;
let mut needs_stdin = true; let mut needs_stdin = true;
let params = a.parameters(); let params = a.parameters();
/* TODO: See mailcap(5) /* [ref:TODO]: See mailcap(5)
* - replace "\%" with "%" and unescape other blackslash uses. * - replace "\%" with "%" and unescape other blackslash uses.
* - "%n" and "%F". * - "%n" and "%F".
* - test=xxx field. * - test=xxx field.

@ -956,8 +956,9 @@ impl MailBackend for ImapType {
} }
} }
/* FIXME Do not try to CREATE a sub-mailbox in a mailbox /* [ref:FIXME] Do not try to CREATE a sub-mailbox in a
* that has the \Noinferiors flag set. */ * mailbox that has the \Noinferiors flag
* set. */
} }
let mut response = Vec::with_capacity(8 * 1024); let mut response = Vec::with_capacity(8 * 1024);
@ -1403,7 +1404,7 @@ impl ImapType {
.iter() .iter()
.any(|cap| cap.eq_ignore_ascii_case(b"LIST-STATUS")); .any(|cap| cap.eq_ignore_ascii_case(b"LIST-STATUS"));
if has_list_status { if has_list_status {
// TODO(#222): imap-codec does not support "LIST Command Extensions" currently. // [ref:TODO]: (#222) imap-codec does not support "LIST Command Extensions" currently.
conn.send_command_raw(b"LIST \"\" \"*\" RETURN (STATUS (MESSAGES UNSEEN))") conn.send_command_raw(b"LIST \"\" \"*\" RETURN (STATUS (MESSAGES UNSEEN))")
.await?; .await?;
conn.read_response( conn.read_response(

@ -423,7 +423,7 @@ impl ImapConnection {
// "SEARCH MODSEQ <cached-value>". // "SEARCH MODSEQ <cached-value>".
// 2. tag1 UID FETCH <lastseenuid+1>:* <descriptors> // 2. tag1 UID FETCH <lastseenuid+1>:* <descriptors>
// TODO(#222): imap-codec does not support "CONDSTORE/QRESYNC" currently. // [ref:TODO]: (#222) imap-codec does not support "CONDSTORE/QRESYNC" currently.
self.send_command_raw( self.send_command_raw(
format!( format!(
"UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \ "UID FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] \
@ -519,7 +519,7 @@ impl ImapConnection {
mailbox_exists.lock().unwrap().insert_set(payload_hash_set); mailbox_exists.lock().unwrap().insert_set(payload_hash_set);
// 3. tag2 UID FETCH 1:<lastseenuid> FLAGS // 3. tag2 UID FETCH 1:<lastseenuid> FLAGS
if cached_max_uid == 0 { if cached_max_uid == 0 {
// TODO(#222): imap-codec does not support "CONDSTORE/QRESYNC" currently. // [ref:TODO]: (#222) imap-codec does not support "CONDSTORE/QRESYNC" currently.
self.send_command_raw( self.send_command_raw(
format!( format!(
"UID FETCH 1:* FLAGS (CHANGEDSINCE {})", "UID FETCH 1:* FLAGS (CHANGEDSINCE {})",
@ -529,7 +529,7 @@ impl ImapConnection {
) )
.await?; .await?;
} else { } else {
// TODO(#222): imap-codec does not support "CONDSTORE/QRESYNC" currently. // [ref:TODO]: (#222) imap-codec does not support "CONDSTORE/QRESYNC" currently.
self.send_command_raw( self.send_command_raw(
format!( format!(
"UID FETCH 1:{} FLAGS (CHANGEDSINCE {})", "UID FETCH 1:{} FLAGS (CHANGEDSINCE {})",

@ -247,7 +247,7 @@ impl ImapStream {
} }
{ {
// FIXME: This is blocking // [ref:FIXME]: This is blocking
let socket = socket.into_inner()?; let socket = socket.into_inner()?;
let mut conn_result = connector.connect(path, socket); let mut conn_result = connector.connect(path, socket);
if let Err(native_tls::HandshakeError::WouldBlock(midhandshake_stream)) = if let Err(native_tls::HandshakeError::WouldBlock(midhandshake_stream)) =

@ -152,7 +152,7 @@ impl BackendOp for ImapOp {
if v.len() != 1 { if v.len() != 1 {
debug!("responses len is {}", v.len()); debug!("responses len is {}", v.len());
debug!(String::from_utf8_lossy(&response)); debug!(String::from_utf8_lossy(&response));
/* TODO: Trigger cache invalidation here. */ /* [ref:TODO]: Trigger cache invalidation here. */
debug!("message with UID {} was not found", uid); debug!("message with UID {} was not found", uid);
return Err( return Err(
Error::new(format!("Invalid/unexpected response: {:?}", response)) Error::new(format!("Invalid/unexpected response: {:?}", response))

@ -48,7 +48,7 @@ pub async fn poll_with_examine(kit: ImapWatchKit) -> Result<()> {
for (_, mailbox) in mailboxes.clone() { for (_, mailbox) in mailboxes.clone() {
examine_updates(mailbox, &mut conn, &uid_store).await?; examine_updates(mailbox, &mut conn, &uid_store).await?;
} }
//FIXME: make sleep duration configurable //[ref:FIXME]: make sleep duration configurable
smol::Timer::after(std::time::Duration::from_secs(3 * 60)).await; smol::Timer::after(std::time::Duration::from_secs(3 * 60)).await;
} }
} }
@ -261,7 +261,7 @@ pub async fn examine_updates(
.iter() .iter()
.any(|cap| cap.eq_ignore_ascii_case(b"LIST-STATUS")); .any(|cap| cap.eq_ignore_ascii_case(b"LIST-STATUS"));
if has_list_status { if has_list_status {
// TODO(#222): imap-codec does not support "LIST Command Extensions" currently. // [ref:TODO]: (#222) imap-codec does not support "LIST Command Extensions" currently.
conn.send_command_raw( conn.send_command_raw(
format!( format!(
"LIST \"{}\" \"\" RETURN (STATUS (MESSAGES UNSEEN))", "LIST \"{}\" \"\" RETURN (STATUS (MESSAGES UNSEEN))",

@ -743,7 +743,7 @@ impl MailBackend for JmapType {
Flag::REPLIED => "$answered", Flag::REPLIED => "$answered",
Flag::TRASHED => "$junk", Flag::TRASHED => "$junk",
Flag::PASSED => "$passed", Flag::PASSED => "$passed",
_ => continue, //FIXME _ => continue, // [ref:VERIFY]
} }
), ),
if *value { if *value {

@ -368,7 +368,7 @@ impl JmapConnection {
index: _, index: _,
} in added } in added
{ {
// FIXME // [ref:TODO] do something with added items
} }
} }
Ok(_) => {} Ok(_) => {}

@ -101,7 +101,7 @@ impl BackendMailbox for JmapMailbox {
fn set_is_subscribed(&mut self, new_val: bool) -> Result<()> { fn set_is_subscribed(&mut self, new_val: bool) -> Result<()> {
self.is_subscribed = new_val; self.is_subscribed = new_val;
// FIXME: jmap subscribe // [ref:FIXME]: jmap subscribe
Ok(()) Ok(())
} }

@ -655,7 +655,7 @@ impl From<crate::search::Query> for Filter<EmailFilterCondition, EmailObject> {
); );
} }
AllAddresses(_) => { AllAddresses(_) => {
//TODO // [ref:TODO]: implement AllAddresses query for jmap
} }
Flags(v) => { Flags(v) => {
fn flag_to_filter(f: &str) -> Filter<EmailFilterCondition, EmailObject> { fn flag_to_filter(f: &str) -> Filter<EmailFilterCondition, EmailObject> {
@ -736,16 +736,16 @@ impl From<crate::search::Query> for Filter<EmailFilterCondition, EmailObject> {
*f = !qhs; *f = !qhs;
} }
Answered => { Answered => {
// TODO // [ref:TODO]: implement Answered query for jmap
} }
AnsweredBy { .. } => { AnsweredBy { .. } => {
// TODO // [ref:TODO]: implement AnsweredBy query for jmap
} }
Larger { .. } => { Larger { .. } => {
// TODO // [ref:TODO]: implement Larger than query for jmap
} }
Smaller { .. } => { Smaller { .. } => {
// TODO // [ref:TODO]: implement Smaller than query for jmap
} }
} }
} }

@ -27,7 +27,7 @@ pub struct Comparator<OBJ: Object> {
property: String, property: String,
#[serde(default = "bool_true")] #[serde(default = "bool_true")]
is_ascending: bool, is_ascending: bool,
//FIXME // [ref:TODO] implement collations
collation: Option<String>, collation: Option<String>,
//#[serde(flatten)] //#[serde(flatten)]
additional_properties: Vec<String>, additional_properties: Vec<String>,

@ -841,7 +841,7 @@ impl FetchState {
let new_low = std::cmp::max(low, high.saturating_sub(CHUNK_SIZE)); let new_low = std::cmp::max(low, high.saturating_sub(CHUNK_SIZE));
high_low_total.as_mut().unwrap().0 = new_low; high_low_total.as_mut().unwrap().0 = new_low;
// FIXME: server might not implement OVER capability // [ref:FIXME]: server might not implement OVER capability
conn.send_command(format!("OVER {}-{}", new_low, high).as_bytes()) conn.send_command(format!("OVER {}-{}", new_low, high).as_bytes())
.await?; .await?;
conn.read_response(&mut res, true, command_to_replycodes("OVER")) conn.read_response(&mut res, true, command_to_replycodes("OVER"))

@ -146,7 +146,7 @@ impl NntpStream {
} }
{ {
// FIXME: This is blocking // [ref:FIXME]: This is blocking
let socket = ret.stream.into_inner()?; let socket = ret.stream.into_inner()?;
let mut conn_result = connector.connect(path, socket); let mut conn_result = connector.connect(path, socket);
if let Err(native_tls::HandshakeError::WouldBlock(midhandshake_stream)) = if let Err(native_tls::HandshakeError::WouldBlock(midhandshake_stream)) =

@ -792,7 +792,7 @@ impl MailBackend for NotmuchDb {
_mailbox_hash: MailboxHash, _mailbox_hash: MailboxHash,
flags: Option<Flag>, flags: Option<Flag>,
) -> ResultFuture<()> { ) -> ResultFuture<()> {
// FIXME call notmuch_database_index_file ? // [ref:FIXME]: call notmuch_database_index_file ?
let path = self let path = self
.save_messages_to .save_messages_to
.as_ref() .as_ref()

@ -127,7 +127,7 @@ use crate::{
}; };
#[cfg(feature = "imap_backend")] #[cfg(feature = "imap_backend")]
// TODO(#222): Make this `const` as soon as it is possible. // [ref:TODO]: (#222) Make this `const` as soon as it is possible.
pub(crate) fn common_attributes() -> MacroOrMessageDataItemNames<'static> { pub(crate) fn common_attributes() -> MacroOrMessageDataItemNames<'static> {
MacroOrMessageDataItemNames::MessageDataItemNames(vec![ MacroOrMessageDataItemNames::MessageDataItemNames(vec![
MessageDataItemName::Uid, MessageDataItemName::Uid,
@ -675,7 +675,7 @@ impl Envelope {
} }
pub fn set_in_reply_to(&mut self, new_val: &[u8]) -> &mut Self { pub fn set_in_reply_to(&mut self, new_val: &[u8]) -> &mut Self {
// FIXME msg_id_list // [ref:FIXME]: msg_id_list
let new_val = new_val.trim(); let new_val = new_val.trim();
if !new_val.is_empty() { if !new_val.is_empty() {
let val = match parser::address::msg_id(new_val) { let val = match parser::address::msg_id(new_val) {

@ -672,7 +672,7 @@ impl Attachment {
.. ..
} => { } => {
ret.push(att.clone()); ret.push(att.clone());
// FIXME: Wrong count // [ref:FIXME]: Wrong count
for a in sub_att_vec { for a in sub_att_vec {
count_recursive(a, ret); count_recursive(a, ret);
} }

@ -201,7 +201,7 @@ impl Draft {
ret.headers_mut() ret.headers_mut()
.insert(HeaderName::TO, envelope.field_from_to_string()); .insert(HeaderName::TO, envelope.field_from_to_string());
} }
// FIXME: add To/Cc // [ref:FIXME]: add To/Cc
} else if let Some(reply_to) = envelope.other_headers().get("Mail-Reply-To") { } else if let Some(reply_to) = envelope.other_headers().get("Mail-Reply-To") {
ret.headers_mut() ret.headers_mut()
.insert(HeaderName::TO, reply_to.to_string()); .insert(HeaderName::TO, reply_to.to_string());

@ -83,7 +83,7 @@ pub fn encode_header(value: &str) -> String {
} }
#[cfg(not(feature = "unicode_algorithms"))] #[cfg(not(feature = "unicode_algorithms"))]
{ {
/* TODO: test this. If it works as fine as the one above, there's no need to /* [ref:VERIFY] [ref:TODO]: test this. If it works as fine as the one above, there's no need to
* keep the above implementation. */ * keep the above implementation. */
for (i, g) in value.char_indices() { for (i, g) in value.char_indices() {
match (g.is_ascii(), is_current_window_ascii) { match (g.is_ascii(), is_current_window_ascii) {

@ -373,7 +373,7 @@ mod tests {
// 'mailto' URI: // 'mailto' URI:
// <mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org>. // <mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org>.
// [tag:FIXME] // [ref:FIXME]
//assert_eq!( //assert_eq!(
// mlt!("mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org"). // mlt!("mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org").
// address, vec![addr!(r#"\"it's ugly\"@example.org"#)] // address, vec![addr!(r#"\"it's ugly\"@example.org"#)]
@ -399,7 +399,6 @@ mod tests {
// The same subject, this time using an encoded-word (escaping the "=" // The same subject, this time using an encoded-word (escaping the "="
// and "?" characters used in the encoded-word syntax, because they are // and "?" characters used in the encoded-word syntax, because they are
// reserved): // reserved):
// [tag:FIXME]
// <mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D> // <mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D>
assert_eq!( assert_eq!(
&mlt!("mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D").headers &mlt!("mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D").headers
@ -410,7 +409,6 @@ mod tests {
// The same subject, this time encoded as iso-8859-1: // The same subject, this time encoded as iso-8859-1:
// <mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D> // <mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D>
// [tag:FIXME]
assert_eq!( assert_eq!(
&mlt!("mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D").headers &mlt!("mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D").headers
[HDR::SUBJECT], [HDR::SUBJECT],

@ -2800,7 +2800,7 @@ mod tests {
); );
} }
// //FIXME: add file // // [ref:FIXME]: add file
//#[test] //#[test]
//fn test_attachments() { //fn test_attachments() {
// use std::io::Read; // use std::io::Read;

@ -19,6 +19,9 @@
* along with meli. If not, see <http://www.gnu.org/licenses/>. * along with meli. If not, see <http://www.gnu.org/licenses/>.
*/ */
// [ref:DEBT] segfaults on libgpgme code can crash the entire app; it should be
// handled.
use std::{ use std::{
borrow::Cow, borrow::Cow,
collections::HashMap, collections::HashMap,

@ -53,6 +53,20 @@
clippy::significant_drop_in_scrutinee, clippy::significant_drop_in_scrutinee,
clippy::cognitive_complexity clippy::cognitive_complexity
)] )]
/* Source Code Annotation Tags:
*
* Global tags (in tagref format <https://github.com/stepchowfun/tagref>) for source code
* annotation:
*
* - [tag:hardcoded_color_value] Replace hardcoded color values with user configurable ones.
* - [tag:needs_unit_test]
* - [tag:needs_user_doc]
* - [tag:needs_dev_doc]
* - [tag:FIXME]
* - [tag:TODO]
* - [tag:VERIFY] Verify whether this is the correct way to do something
* - [tag:DEBT] Technical debt
*/
//! A crate that performs mail client operations such as //! A crate that performs mail client operations such as
//! - Hold an [`Envelope`](./email/struct.Envelope.html) with methods convenient //! - Hold an [`Envelope`](./email/struct.Envelope.html) with methods convenient

@ -217,7 +217,7 @@ impl<'a> Iterator for LineBreakCandidateIter<'a> {
* NS SJ Any * NS SJ Any
*/ */
// TODO: LB1 // [ref:TODO]: LB1
/* Check if next character class allows breaks before it */ /* Check if next character class allows breaks before it */
let mut next_char: Option<&(usize, &str)> = iter.peek(); let mut next_char: Option<&(usize, &str)> = iter.peek();

@ -343,7 +343,7 @@ impl SubjectPrefix for &[u8] {
continue; continue;
} }
if slice.starts_with(b" ") || slice.starts_with(b"\t") || slice.starts_with(b"\r") { if slice.starts_with(b" ") || slice.starts_with(b"\t") || slice.starts_with(b"\r") {
//FIXME just trim whitespace // [ref:FIXME]: just trim whitespace
slice = &slice[b" ".len()..]; slice = &slice[b" ".len()..];
continue; continue;
} }
@ -418,7 +418,7 @@ impl SubjectPrefix for &str {
continue; continue;
} }
if slice.starts_with(' ') || slice.starts_with('\t') || slice.starts_with('\r') { if slice.starts_with(' ') || slice.starts_with('\t') || slice.starts_with('\r') {
//FIXME just trim whitespace // [ref:FIXME]: just trim whitespace
slice = &slice[1..]; slice = &slice[1..];
continue; continue;
} }
@ -1155,7 +1155,7 @@ impl Threads {
} }
fn inner_subsort_by(&self, _subsort: (SortField, SortOrder), _envelopes: &Envelopes) { fn inner_subsort_by(&self, _subsort: (SortField, SortOrder), _envelopes: &Envelopes) {
//FIXME: self\.thread_nodes needs interior mutability */ // [ref:FIXME]: self\.thread_nodes needs interior mutability */
/* /*
let Threads { let Threads {
ref tree_index, ref tree_index,
@ -1499,7 +1499,7 @@ impl Threads {
} }
pub fn roots(&self) -> SmallVec<[ThreadHash; 1024]> { pub fn roots(&self) -> SmallVec<[ThreadHash; 1024]> {
//FIXME: refactor filter // [ref:FIXME]: refactor filter
self.groups self.groups
.iter() .iter()
.filter_map(|(h, g)| g.root().map(|_| *h)) .filter_map(|(h, g)| g.root().map(|_| *h))

@ -82,7 +82,7 @@ impl Connection {
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
Tls(ref t) => t.get_ref().set_nonblocking(nonblocking), Tls(ref t) => t.get_ref().set_nonblocking(nonblocking),
Fd(fd) => { Fd(fd) => {
//FIXME TODO Review // [ref:VERIFY]
nix::fcntl::fcntl( nix::fcntl::fcntl(
*fd, *fd,
nix::fcntl::FcntlArg::F_SETFL(if nonblocking { nix::fcntl::FcntlArg::F_SETFL(if nonblocking {
@ -146,7 +146,7 @@ impl Connection {
keepalive.is_some() as c_int, keepalive.is_some() as c_int,
)?; )?;
if let Some(dur) = keepalive { if let Some(dur) = keepalive {
// TODO: checked cast here // [ref:TODO]: checked cast here
self.setsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION, dur.as_secs() as c_int)?; self.setsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION, dur.as_secs() as c_int)?;
} }
Ok(()) Ok(())

Loading…
Cancel
Save