Raxol.PreCommit.Config (Raxol v2.0.1)

View Source

Configuration system for Raxol pre-commit checks.

Loads and merges configuration from multiple sources:

  1. Default configuration
  2. Project-level .raxol.exs file
  3. Command-line options (highest priority)

Configuration File Format

Create a .raxol.exs file in your project root:

[
  pre_commit: [
    checks: [:format, :compile, :credo, :tests],
    parallel: true,
    fail_fast: false,
    auto_fix: [:format],
    test_timeout: 5_000,
    ignore_paths: ["deps/", "_build/", "priv/static/"],
    custom_checks: [],
    check_config: [
      format: [
        inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
      ],
      tests: [
        timeout: 10_000,
        max_failures: 10
      ],
      credo: [
        strict: true,
        all: false
      ]
    ]
  ]
]

Summary

Functions

Get configuration for a specific check.

Load configuration from all sources and merge them.

Check if a path should be ignored based on configuration.

Functions

get_check_config(config, check_name)

Get configuration for a specific check.

load(cli_opts \\ %{})

Load configuration from all sources and merge them.

Priority (highest to lowest):

  1. Command-line options
  2. .raxol.exs file
  3. Default configuration

should_ignore?(config, path)

Check if a path should be ignored based on configuration.