allwpilib
allwpilib copied to clipboard
[cmd] Add `andThenWaitUntil`, `andThenWaitSeconds`, `andThenWaitTime` command decorators
I can add Python later and try to add C++ implementation. English is not my first language, so I'd appreciate suggestion for improving the docs.
This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR.
thenAwait or andThenAwait?
/format
Maybe (and)ThenWaitUntil()?
Maybe
(and)ThenWaitUntil()?
I think "await" == "wait until", no? The "and" can be added, I don't know what the preferences are for more than two words for decorators.
/format
The format command won't work cause the PR is from the main branch of your form
The format command won't work cause the PR is from the main branch of your form
I created a new branch in my repo (then-wait-await) but GitHub lets me change the destination branch only. Can someone with higher permissions edit the PR? Otherwise I'll open a new one, if the formatting is incorrect.
Java format is failing, locally you can just run ./gradlew spotlessApply which should fix it
Personally I'd like these to be (and)Then... followed by the named of the Commands factory (e.g., thenWaitUntil(BooleanSupplier) or andThenWaitUntil(BooleanSupplier)), since that should make it easier for people to remember.
I'm not a fan of adding these.
andThenWaitUntil(foo())
andThen(waitUntil(foo()))
andThenWaitSeconds(foo())
andThen(waitSeconds(foo()))
You save two characters.
I'm not a fan of adding these.
andThenWaitUntil(foo())andThen(waitUntil(foo()))
andThenWaitSeconds(foo())andThen(waitSeconds(foo()))You save two characters.
True. I did imagine them more concise, with it initially being thenAwait. But it does save you the Commands. part.