ProbablyClem / cargo-todo

Cargo tool to display TODOs
26 stars 4 forks source link

Doesn't work whith leading whitespace #11

Closed Hasenn closed 2 years ago

Hasenn commented 3 years ago

leading tabulation or whitespace makes it fail, as in

    //todo the stuff i need to do

^\N*\/\/todo *(\N*?)$ would capture your arguments and not cause that issue https://regex101.com/r/dM5yP5/1/

Hasenn commented 3 years ago

I have found those in the source

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

I'm not sure if these are escaped by rust like rstrings would be, but they are broken s matches an s character, and not \s which would match all whitespace characters. This is maybe escaped by code ? But even then \s would match newlines and could parse more than intended, and not work with comments at the end of a code line

ProbablyClem commented 2 years ago

Fixed it, ty for the feedback