ProbablyClem / cargo-todo

Cargo tool to display TODOs
26 stars 4 forks source link

Default Regex? #9

Closed AldaronLau closed 2 years ago

AldaronLau commented 4 years ago

The default regex file:

^s*//s*todo\b
^s*//s*fix\b
^s*//s*fixme\b

matches

What I'm wondering is why that's the default. I have never seen anyone use //stodo before. I think something like // todo should be matched by default. Unfortunately, when I change the regex I get

src/main.rs line: 1 // TODO: my todo message

instead of (with the default regex and no space):

src/main.rs line: 1 // TODO: my todo message

Here's the regex file (~/.cargo/todo_config) I used:

^s*//.todo\b
^s*//.fix\b
^s*//.fixme\b
xmo-odoo commented 2 years ago

I think the regex are in error and were probably intended to be ^\s*//\s*todo\b, as in:

this way both //todo and // todo would work fine.

ProbablyClem commented 2 years ago

@xmo-odoo is right ! I fixed it, it will be in the next release. If you're still alive (and still using cargo-todo) you can either delete the config file so the new default will be generated or update it by yourself. Sorry for the latency, I'm really busy irl. Don't hesitate to do pull requests if you have any other issue. Thanks