mix just_bash.audit (JustBash v0.4.0)

View Source

Scans Elixir source for filesystem call shapes that the 0.3 → 0.4 migration broke in ways the compiler cannot catch (see UPGRADING.md). The legacy patterns still compile and then misbehave at runtime:

RuleLegacy shapeFailure mode in 0.4
legacy_moduleJustBash.Fs / InMemoryFs referencecompile error (undefined module)
stale_ok_tuple{:ok, x} matched on a readsilently falls through to the error clause
atom_error{:error, :enoent} clausenever matches; falls to catch-all or crashes
exists_truthyFS.exists?/2 in a conditiontuple is always truthy — branch always taken
legacy_optmkdir recursive: / rm force:raises ArgumentError at runtime
stat_boolean_fieldstat.is_file etc.KeyError at runtime
fs_data_accessbash.fs.dataKeyError — bash.fs is a %VFS{}

Calls are recognized on the JustBash.FS module, a discovered alias JustBash.FS[, as: ...], or the bare FS name (heuristic).

mix just_bash.audit             # scans lib/
mix just_bash.audit lib test    # scans multiple paths
mix just_bash.audit path/to/file.ex

Prints one line per finding (file:line [rule] message) and exits non-zero when anything is found, so it can gate CI.

This task exists for the 0.3 → 0.4 migration window and will be removed once the legacy shapes are gone.