Current section
Files
Jump to
Current section
Files
gleam.toml
name = "metamon"
version = "0.1.0"
description = "Property-based testing and metamorphic testing combinator library for Gleam"
licences = ["MIT"]
repository = { type = "github", user = "nao1215", repo = "metamon" }
[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
gleam_json = ">= 3.0.0 and < 4.0.0"
simplifile = ">= 2.0.0 and < 3.0.0"
[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
glinter = ">= 2.14.0 and < 3.0.0"
[tools.glinter]
warnings_as_errors = true
include = ["src/", "test/"]
[tools.glinter.rules]
assert_ok_pattern = "error"
# Runner / stateful / generator modules deliberately panic with
# structured messages on failed properties — this is the entire
# failure-report delivery channel and panic is the only signal
# gleeunit reads. The rule stays on globally so accidental panics
# in non-runner code still fail the build; the runner / stateful /
# generator modules waive it via the per-file ignore list below.
avoid_panic = "error"
avoid_todo = "error"
deep_nesting = "error"
# `Result` discarding is unavoidable in defensive paths
# (`simplifile.write` for the regression file, `dict.upsert`
# returning an unchanged value, `int.parse` in lenient parsers).
# The signal-to-noise on a property-testing library is too low for
# this rule.
discarded_result = "off"
division_by_zero = "error"
duplicate_import = "error"
echo = "error"
error_context_lost = "error"
# The metamon FFI seam (process state, microsecond clock,
# panic capture) is centralised in `src/metamon_ffi.{erl,mjs}`
# and the modules that wrap it.
ffi_usage = "error"
function_complexity = "error"
# Labelled-argument adoption is a follow-up project that touches
# every public function. Disabled globally for the v0.x line; the
# ratchet flips back on once the labelled-argument refactor lands.
label_possible = "off"
missing_labels = "error"
missing_type_annotation = "error"
module_complexity = "error"
panic_without_message = "error"
# Style rule that forces `use <- bool.guard` over `case True/False`.
# Both shapes read fine; the choice is local to each call site.
prefer_guard_clause = "off"
redundant_case = "error"
short_variable_name = "error"
# `string.inspect` is the failure-report renderer's only safe way
# to display values of unknown types. Disabled globally for the
# library; consumer code is welcome to flip it back on locally.
string_inspect = "off"
stringly_typed_error = "error"
# Defensive `Result` patterns return a default value for malformed
# input (regression file parser, coverage state coercion, dict
# lookups). Propagating the error would tear down the property run;
# silently falling back is the documented behaviour.
thrown_away_error = "off"
todo_without_message = "error"
trailing_underscore = "error"
unnecessary_string_concatenation = "error"
unnecessary_variable = "error"
unqualified_import = "error"
# `unused_exports` is a false-positive on a public-facing library:
# every API function is unused inside the library, by definition.
# The rule is fine for application codebases but useless here.
unused_exports = "off"
unwrap_used = "error"
[tools.glinter.ignore]
# gleeunit auto-discovers `pub fn ..._test` so all of those
# functions look unused, none have explicit `-> Nil`, and
# tests routinely use one-letter binders for compactness. These
# rule waivers are mechanical; production code keeps the ratchet
# tight.
"test/**/*.gleam" = [
"unused_exports",
"missing_type_annotation",
"short_variable_name",
"assert_ok_pattern",
"label_possible",
"discarded_result",
"thrown_away_error",
"prefer_guard_clause",
"redundant_case",
]
# Runner is the panic delivery mechanism; generator panics on a
# stuck `filter`; stateful panics on a failing command.
"src/metamon/internal/runner.gleam" = ["avoid_panic"]
"src/metamon/stateful.gleam" = ["avoid_panic"]
"src/metamon/generator.gleam" = ["avoid_panic", "assert_ok_pattern"]
# Process-dictionary FFI shims (BEAM + JS) intentionally form the
# metamon-FFI seam.
"src/metamon/internal/process_state.gleam" = ["ffi_usage"]
# The JS FFI module imports `Ok` / `Error` constructors from
# `gleam.mjs` to interop with Gleam-shaped Results. There is no
# stable replacement for this on the JS target.
"src/metamon_ffi.mjs" = ["ffi_usage"]