fabro/lib/crates/fabro-util/src
Bryan Helmkamp 19939c5f07
lint(clippy): disallow blocking std::fs on Tokio paths
Phase 2/3 of the std::fs lint initiative (Phase 1 refactors landed in
commit 9d1c0d98c).

clippy.toml additions (appended to disallowed-methods):
  std::fs::read, read_to_string, write, read_dir, copy, canonicalize
  std::fs::File::open, File::create, File::create_new
  std::fs::OpenOptions::open

File::options was deliberately excluded — it returns an OpenOptions
builder with no syscall. OpenOptions::open is where the block happens.
Non-blocking std::fs items (metadata, exists, create_dir_all, remove_*,
rename, and all std::fs types) remain legal.

Annotation policy (per updated plan):
  - Mixed async/sync production source: function- or statement-scoped
    #[expect(...)] so future accidental Tokio-path regressions in the
    same file still fire.
  - Fully-sync production source, test modules, integration tests,
    build.rs: file-level #![expect(...)].
  - Every #[expect] has a specific reason identifying the sync context.

Annotations added in ~90 files across the workspace. Notable narrow
placements: fabro-server server.rs current_server_target,
build_disk_usage_response, create_test_app_state_with_session_key;
fabro-server install.rs read_to_string rollback snapshot;
fabro-sandbox local.rs list_recursive; fabro-agent cli.rs FOLLOW-UP on
the JSON-stdout writer; fabro-llm providers/common.rs FOLLOW-UP for
load_file_as_base64 (7 translator call sites; revisit if file:// URL
usage grows).

build.rs blanket allows: fabro-api/build.rs, fabro-util/build.rs.

Pre-existing unrelated nightly-clippy warnings fixed under scope:
fabro-sandbox sandbox_spec.rs (unused_imports, unused_async),
reconnect.rs (unused_variables, unused_async).

Verified: cargo +nightly-2026-04-14 clippy --workspace --all-targets
-- -D warnings passes; fmt clean; 4129/4131 tests pass (two known
flakes under parallel nextest load, both pass individually and are
unrelated to this change).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 17:22:21 -04:00
..
redact fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
backoff.rs deps: bump rand 0.8 → 0.9 (#163) 2026-04-17 07:57:10 -04:00
check_report.rs Show fabro secret set command in doctor remediation output 2026-04-14 15:22:25 -04:00
dev_token.rs lint(clippy): disallow blocking std::fs on Tokio paths 2026-04-19 17:22:21 -04:00
env.rs feat(template): unify workflow and config template syntax 2026-04-11 10:58:50 -04:00
home.rs feat(install): add browser-based setup flow 2026-04-19 11:20:58 -04:00
json.rs refactor: remove remaining event json indirection 2026-04-04 13:24:19 -04:00
lib.rs refactor(auth): deduplicate session secret, remove dead code, tighten test helpers 2026-04-13 12:18:01 -04:00
path.rs Improve install command output ordering and path display 2026-04-14 15:16:21 -04:00
printer.rs refactor(cli): route command output through Printer 2026-04-11 14:40:33 -04:00
run_log.rs lint(clippy): disallow blocking std::fs on Tokio paths 2026-04-19 17:22:21 -04:00
session_secret.rs deps: bump rand 0.8 → 0.9 (#163) 2026-04-17 07:57:10 -04:00
terminal.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
text.rs Enable 7 additional pedantic clippy lints 2026-03-29 13:47:08 -04:00
version.rs Move git SHA/build date from fabro-util to fabro-cli build.rs 2026-03-13 15:03:12 -04:00
warnings.rs chore: fix warnings and test stability 2026-04-04 13:31:04 -04:00