Skip to main content

Crate bynk_driver

Crate bynk_driver 

Source
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: one path:line:col: severity[category]: message line per attributed error (an unattributed project-level error falls back to severity[category]: message). Backs both the printer above and the bynkc test --format json compile-error document, whose diagnostics the VS Code bynkc problem-matcher re-parses.
project_options
Root a directory project the way every project command should (#46): a bynk.toml or a src/ subdir selects project mode, whose flat [paths] include/exclude layout (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, and dev all route through this so the conventional layout works the same from any of them.
run_check
The check command body shared by bynkc check and bynk check: a directory routes through project::compile_project, a single file through bynk_emit::compile_with_warnings. short selects the one-line --format short rendering. prog prefixes messages (bynk: …).
run_fmt
The fmt command body shared by bynkc fmt and bynk fmt: each input is formatted and rewritten only when it changes; --check reports non-canonical files without writing; - reads stdin and writes the formatted result to stdout. prog prefixes messages (bynk fmt: …).