Expand description
bynk-driver — the shared front-end of the bynkc and bynk CLIs (#521).
Both binaries expose fmt and check with identical semantics; before
this crate each re-implemented the command bodies (and the project-failure
flattening layer, and the project-rooting rule) as by-hand copies pinned
only by comments and a skip-able parity test. The single implementation
lives here, parameterised by the program name that prefixes messages.
Functions§
- print_
project_ failure - Render a project build failure with per-file ariadne context, exactly as single-file mode had rich rendering. Unattributed (project-level) errors keep the plain form.
- print_
project_ failure_ short - The project-failure analogue of
bynk_render::print_errors_short: each attributed error is positioned against its file’s snapshot; an unattributed (project-level) error falls back to<severity>[<category>]: <message>. - print_
project_ warnings - v0.89 (ADR 0117): print a successful build’s non-failing warnings. A
successful build keeps no per-file snapshots, so warnings render in the
plain
warning[<category>]: <message>form (with the owning file, when known) rather than ariadne source context. - project_
failure_ short_ lines - The string form of
print_project_failure_short: onepath:line:col: severity[category]: messageline per attributed error (an unattributed project-level error falls back toseverity[category]: message). Backs both the printer above and thebynkc test --format jsoncompile-error document, whosediagnosticsthe VS Codebynkcproblem-matcher re-parses. - project_
options - Root a directory project the way every project command should (#46): a
bynk.tomlor asrc/subdir selects project mode, whose flat[paths] include/excludelayout (v0.113, DECISION S) defaults to the conventional roots that exist (src,tests) or the project root itself; otherwise the legacy single-tree where<dir>is itself the root.check,compile,test, anddevall route through this so the conventional layout works the same from any of them. - run_
check - The
checkcommand body shared bybynkc checkandbynk check: a directory routes throughproject::compile_project, a single file throughbynk_emit::compile_with_warnings.shortselects the one-line--format shortrendering.progprefixes messages (bynk: …). - run_fmt
- The
fmtcommand body shared bybynkc fmtandbynk fmt: each input is formatted and rewritten only when it changes;--checkreports non-canonical files without writing;-reads stdin and writes the formatted result to stdout.progprefixes messages (bynk fmt: …).