-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include ///
and //!
comments when searching for TODO
s
#13
base: master
Are you sure you want to change the base?
Conversation
Also trim `:` if it's found after the TODO (e.g. `// TODO: something`)
TODO comments are for the developer and should not be in the documentation |
I'm fine with maintaining a fork for this feature if you don't want to merge this, but here's some reasoning for why it should be considered:
An example from /// Finds `substr` in `container`, ignoring case, starting at `start_index`.
/// TODO boyer-moore algorithm
pub fn indexOfIgnoreCasePos(container: []const u8, start_index: usize, substr: []const u8) ?usize { I'd argue that seeing this Note that if |
const todo_msg = msg: { | ||
// skip colon character if it's immediately after TODO | ||
const msg_start: usize = if (std.mem.startsWith(u8, comment_str[4..], ":")) 5 else 4; | ||
break :msg std.mem.trim(u8, comment_str[msg_start..], " "); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be replaced with std.mem.trimLeft(u8, msg, ": ");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally avoided that. From the OP:
Note: The logic for skipping
:
is a little verbose to avoid the (admittedly unlikely) situation where it could trim too many colons from something like// TODO ::SomeWeirdThing
Also trim
:
if it's found after the TODO (e.g.// TODO: something
)Note: The logic for skipping
:
is a little verbose to avoid the (admittedly unlikely) situation where it could trim too many colons from something like// TODO ::SomeWeirdThing