-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY #16343
Conversation
These aliases are not "useless", they let me get away with writing specs without constantly looking at the documentation. A world where "target" and "targets" are different is the really confusing world. I'm merging this anyway, just trying to outline the ideas behind the testament aliases. |
Since testament is now an official tool, I added back the aliases "c++" and "target". |
ok for backward compatiblity argument (but probably a warning would be best in future work);
nim (stdlib etc) rightfully avoids this kind of aliasing usually, and testament seems to be an odd exception; aliases complicate other tasks such as grepping, and lead to people copying their favorite alias and making the problem worse. I prefer a tool that is strict but also suggests spell corrections, and it's in fact easy to write a generic spellSuggest as a followup after #16067, via a completely generic case statement macro: spellSuggest:
case arg
of "targets": ...
of "output": ...
else: raise newException(ValueError, spellCorrect) which adds spell corrections automatically simply by invoking a generic macro
=> This would be generally applicable (nim cmdline etc) |
I don't see this to work well for testament as I usually run batches of tests. However, TabNine is getting so good at this that we don't have to do anything here, not anymore. |
…ointless alias target vs targets; document matrix; DRY (nim-lang#16343) * testament: error instead of silently ignore invalid targets * s/target/targets/ * fix test; refs nim-lang#16344 * address comments * Update testament/specs.nim Co-authored-by: Andreas Rumpf <[email protected]>
…ointless alias target vs targets; document matrix; DRY (nim-lang#16343) * testament: error instead of silently ignore invalid targets * s/target/targets/ * fix test; refs nim-lang#16344 * address comments * Update testament/specs.nim Co-authored-by: Andreas Rumpf <[email protected]>
matrix
in testament.rsttargets vs target
and instead only allowtargets
which is much more common (and fix tests); helps with searching especially for users not aware that the less commontarget
even existedthis will do the right thing:
these will fail:
or after adding an invalid target in tests/stdlib/thashes.nim: