ralph-workflow 0.7.18

PROMPT-driven multi-agent orchestrator for git repos
Documentation
# ============================================================================
# LINT POLICY FILE -- DO NOT WEAKEN, DISABLE, OR RELAX RULES WITHOUT EXPLICIT
# USER/MAINTAINER DIRECTION. REFACTOR THE CODE INSTEAD. "BEING LAZY TO
# REFACTOR" IS NOT A VALID REASON TO CHANGE LINTING BEHAVIOR. THE ONLY
# EXCEPTION IS DOCUMENTED AUTOGENERATED CODE HANDLED BY THE REPOSITORY'S
# APPROVED MECHANISM.
# ============================================================================
#
# Each section below maps to documentation in docs/code-style/* that explains
# WHY the rule exists and HOW to refactor code to comply. Reference these
# guides when fixing lint violations:
#
#   - docs/code-style/boundaries.md       # IO, prints, env vars, process spawning
#   - docs/code-style/functional-transformations.md  # Pure functions, no mutation
#   - docs/code-style/coding-patterns.md  # Iterator pipelines, refactor patterns
#   - docs/code-style/architecture.md      # Reader/Writer/Except patterns
#   - docs/code-style/testing.md           # Test strictness rules
# ============================================================================

# Package-local clippy configuration for ralph-workflow.

# --- Test strictness: no escape hatches ---
# See: docs/code-style/testing.md
#
# WHY: Tests should verify behavior, not contain implementation shortcuts that hide bugs.
#      Using unwrap/expect/panic in tests masks failures and gives false confidence.
#
# HOW TO FIX:
#   - Use `?` operator for Result/Option propagation
#   - Use `match` or `if let` for explicit control flow
#   - Use `unwrap_or`, `unwrap_or_else`, or `unwrap_or_default` with meaningful fallbacks
allow-unwrap-in-tests = false
allow-expect-in-tests = false
allow-panic-in-tests = false
allow-print-in-tests = false
allow-indexing-slicing-in-tests = false

# --- Iterator loops ---
# See: docs/code-style/coding-patterns.md ("Iterator transformation patterns")
#
# WHY: Reborrowing in iterator loops can cause ownership issues and unexpected behavior.
#
# HOW TO FIX:
#   - Use `.iter()` instead of borrowing the iterator directly
enforce-iter-loop-reborrow = true

# --- Arithmetic ---
# See: docs/code-style/functional-transformations.md
#
# WHY: Arithmetic operations can panic on overflow in debug mode. Allowing safe operations
#      enables pure functional code to use math without Result wrappers.
#
# HOW TO FIX:
#   - Use checked arithmetic (e.g., `checked_add`) when overflow is possible
#   - For known-safe operations, the allowed list suffices
arithmetic-side-effects-allowed = ["*", "+", "-", "/", "%", "+=", "-=", "*=", "/=", "-"]

# --- Disallowed types (interior mutability / shared mutable state) ---
# NOTE: Enforced by dylint's forbid_interior_mutability lint, which correctly distinguishes
#       domain code from boundary modules. Clippy's blanket rules are too broad.
#       See: docs/tooling/dylint.md
disallowed-types = []

# --- Disallowed methods (mutation / imperative patterns) ---
# NOTE: Enforced by dylint's forbid_mutating_receiver_methods lint, which correctly distinguishes
#       domain code from boundary modules. Clippy's blanket rules are too broad.
#       See: docs/tooling/dylint.md
disallowed-methods = []

# --- Disallowed macros (side effects) ---
# NOTE: Terminal output (println/eprintln) is appropriate in boundary modules (io/, runtime/).
#       dylint enforces the domain/boundary distinction correctly.
disallowed-macros = [
  { path = "std::dbg", reason = "No debug leftovers" },
]

# --- large_stack_frames: deliberate test-only code allowances via #[expect] ---
# The test harness generates large stack frames that are unavoidable.
# These are suppressed with #[expect(clippy::large_stack_frames, reason = "...")] at item scope.
# The generated lib-test harness error is also filtered by the xtask verify strip step.
# This is a deliberate exception documented in the lint policy.
# See: CODE_STYLE.md and the lint policy exception table.