alexfertel / bulloak

Generate tests based on the Branching Tree Technique.
https://bulloak.dev
Apache License 2.0
260 stars 14 forks source link

feature request: case-insensitivity OR control over output comment style #20

Closed mds1 closed 1 year ago

mds1 commented 1 year ago

This a bit nitpicky (hope you don't mind all my recent comments 😅), but I always write comments as full sentences. Bulloak is currently case sensitive, e.g. It is not recognized as a keyword but it is. I tried to write my spec as It should do x. so the resulting comment in the test file is a full sentence (starts with capital letter and ends with a period).

I see two ways to support this:

  1. Make the keywords case insensitive and copy them as-is into the test.
  2. Keep them as case-sensitive, and automatically convert the requirement into a sentence by (when necessary) capitalizing the first letter or adding a period. Different users have different preferences so this would require a new CLI flag

This is a simple change so I'm happy to PR this one in. I think option 1 is probably the way to go here to keep the interface simple, but curious to hear your thoughts and if you're open to this.

alexfertel commented 1 year ago

hope you don't mind all my recent comments 😅

Not at all! Keep 'em coming! 😄

but I always write [comments as full sentences]

Same, I think it's good practice!

I kept it (actions) as is, because I thought of it more like a throw-away comment, i.e., after emitting the tests, the user would fill in the bodies, removing the comments. However, I realize this is a silly assumption.

I think option 1 is probably the way to go here to keep the interface simple

Yes, I agree! I think it's less surprising to a user to change the spec's style (as you tried to do), than realize it's hidden behind a cli flag.

This is a simple change so I'm happy to PR this one in.

Please do! Lmk if you need any pointers.

PaulRBerg commented 1 year ago

Also in favor of option 1