cqfn / pdd

Command line toolkit for collecting TODO markers from your code, known as Puzzle Driven Development (PDD)
https://www.0pdd.com
MIT License
76 stars 25 forks source link

todo! keyword support #220

Open xamgore opened 1 year ago

xamgore commented 1 year ago

A common approach for writing stubs in Rust programming language is the todo! macro. First, it satisfies the type-checker and makes the code compileable. On the other hand, it calls a panic at runtime while printing the provided message.

fn fibonacci(n: usize) -> usize {
  if n == 0 { 0 } else { todo!("I can't figure out how to implement it now") }
}

So, if a project would like to use PDD during the development, it would be verbose since only three keywords are supported: @todo, TODO and TODO:. I suggest extending this amazing triplet with todo!.

todo!("#234:15m/DEV This is something to do later in one of the next releases.") }

instead of

// TODO #234:15m/DEV This is something to do later in one of the next releases.
todo!() }

As far as I know, @yegor256 does write in Rust, so I would like to hear an opinion from the project's founder.

yegor256 commented 1 year ago

@xamgore sounds like a good idea to me. Would you be willing to submit a pull request with this extension?