mix raxol.gen.specs (Raxol v2.0.1)

View Source

Automatically generates type specs for private functions in Raxol modules.

This task analyzes private functions and generates appropriate @spec annotations based on function signatures, pattern matching, and usage patterns.

Usage

# Generate specs for a specific file
mix raxol.gen.specs lib/raxol/terminal/color/true_color.ex

# Generate specs for all files in a directory
mix raxol.gen.specs lib/raxol/terminal --recursive

# Dry run to see what would be generated
mix raxol.gen.specs lib/raxol/terminal/color/true_color.ex --dry-run

# Generate only for functions with certain patterns
mix raxol.gen.specs lib/raxol --filter validate_

Options

  • --dry-run - Show what would be generated without modifying files
  • --recursive - Process all .ex files in directory recursively
  • --filter - Only generate specs for functions matching pattern
  • --interactive - Prompt for confirmation on each spec
  • --backup - Create backup files before modifying

Summary

Types

spec_info()

@type spec_info() :: %{
  function: atom(),
  arity: non_neg_integer(),
  args: [String.t()],
  return_type: String.t(),
  line: non_neg_integer()
}