-@
: Reject compilation/documentation if none of the supplied --<cfg|rev>
s set any compiletest revision unless --force
d
#27
Labels
C-medium
Technical complexity: Medium
K-feature-request
Kind: Feature request
P-low
Priority: Low
S-in-progress
Status: In progress
It's probably a common user mistake to invoke rruxwry/-@ on a file which defines compiletest revisions without specifying any of them on the command line. Compiletest only tests the file under these exact revisions after all.
However, since rruxwry is meant to be dev-empowering tool, I also want the option to sidestep this hard error (we don't have many yet, mostly just warnings / non-fatal errors). For that I want us to introduce
-f
/--force
.Steps:
-f
/--cargo-feature
or at least change the shortflag-f
: I don't think it will actually be used much – well, maybe for files minimized from Cargo projects.--cargo-feature
was removed altogether, consider renaming--rustc-feature
, since it no longer needs to be that awkwardly named.-f
/--force
and make use of it, too (e.g., turn some(!) directive parse errors into hard errors unless--force
'd).Remove(I changed my mind: see "discussion" at the end of this bullet point). Just reuse the preexisting--rev
--cfg
for revisions, too. Adjust the CLI docs for--cfg
. Under-@
throw a hard error if none of the--cfg
s specify a declared compiletest revision unless--force
'd. For example, with//@ revisions: one two
rr{c,d} file.rs -@
would throw sth. likeerror[rruxwry]: no revision specified on the command line
//help: specify at least one revision with `--cfg` (+ listing available revisions in some way) (or ~
help: at least one of the supplied--cfg
s should mention a revision if the CLI invocation actually specifies--cfg
s (+ we can do Levenshtein-distance based typo detection to provide an even better diagnostic)) // ~use `-f`/`--force` to continue regardless
.--cfg
. One thing tho: Should we actually require all cfgs to mention legal revisions unless--force
'd to run? That might catch more typos for example in//@ revisions: one two
rr{c,d} file.rs -@ --cfg one --cfg twp
. However, how often would someone actually run multiple revisions at once (note--all-revs
(TBI) wouldn't enable all revs but run rruxwry per rev)? We could throw a hard error if the user to specified multiple--cfg
if revs were specified unless--force
'd. Update: Nah, I guess we should keep--rev
(and maybe change it so you're not allowed to specify it multiple times? not sure). If the user wants to specify rev and cfg, they can use--rev one --cfg other
. That begs the question: Should--force
disable the rev check, too? I guess. So--cfg other
and--rev other -f
would basically behave the same (diagnostics can mention that).key="value"
(mod shell esc). Add support for that. Well, we do supportrr{c,d} f.rs --cfg 'feature = "feature"'
for example by virtue of pass-through. However, I'm pretty sure we don't properly support it as a revision (compiletest likely doesn't either). I mean://@ revisions: '--feature="feature"' '--feature = "feature"'
should raise an error bc of the dupe revisions (unless--force'
d). We actually need to restrict the grammar of revisions from non-whitespace sequence to IDENT or IDENT="VALUE" (mod shell esc). Not a high prio though.The text was updated successfully, but these errors were encountered: