Credo v1.4.0 Credo.Execution View Source

Every run of Credo is configured via a Execution struct, which is created and manipulated via the Credo.Execution module.

Link to this section Summary

Functions

The Execution struct is created and manipulated via the Credo.Execution module.

Builds an Execution struct for the the given argv.

Returns the checks that should be run for a given exec struct.

Ensures that the given value is a %Credo.Execution{} struct, raises an error otherwise.

Returns the assign with the given name for the given exec struct (or return the given default value).

Returns the name of the command, which should be run by the given execution.

Returns all config files for the given exec struct.

Returns all issues for the given exec struct.

Returns all issues for the given exec struct that relate to the given filename.

Returns the result with the given name for the given exec struct (or return the given default value).

Returns all source files for the given exec struct.

Returns all valid command names.

Halts further execution of the pipeline.

Puts the given value with the given name as assign into the given exec struct.

Puts the given value with the given name as result into the given exec struct.

Puts the given source_files into the given exec struct.

Sets the issues for the given exec struct, overwriting any existing issues.

Sets the exec values which strict implies (if applicable).

Link to this section Types

Link to this type

t()

View Source
t() :: %Credo.Execution{
  all: term(),
  argv: term(),
  assigns: term(),
  checks: term(),
  cli_aliases: term(),
  cli_options: term(),
  cli_switch_plugin_param_converters: term(),
  cli_switches: term(),
  color: term(),
  commands: term(),
  config_comment_map: term(),
  config_files: term(),
  config_files_pid: term(),
  crash_on_error: term(),
  current_task: term(),
  debug: term(),
  enable_disabled_checks: term(),
  files: term(),
  format: term(),
  halted: term(),
  help: term(),
  ignore_checks: term(),
  ignore_checks_tags: term(),
  initializing_plugin: term(),
  issues_pid: term(),
  min_priority: term(),
  mute_exit_status: term(),
  only_checks: term(),
  only_checks_tags: term(),
  parent_task: term(),
  parse_timeout: term(),
  pipeline_map: term(),
  plugins: term(),
  read_from_stdin: term(),
  requires: term(),
  results: term(),
  skipped_checks: term(),
  source_files_pid: term(),
  strict: term(),
  timing_pid: term(),
  verbose: term(),
  version: term()
}

Link to this section Functions

Link to this function

%Credo.Execution{}

View Source (struct)

The Execution struct is created and manipulated via the Credo.Execution module.

Builds an Execution struct for the the given argv.

Returns the checks that should be run for a given exec struct.

Takes all checks from the checks: field of the exec, matches those against any patterns to include or exclude certain checks given via the command line.

Link to this function

ensure_execution_struct(value, fun_name)

View Source

Ensures that the given value is a %Credo.Execution{} struct, raises an error otherwise.

Example:

exec
|> mod.init()
|> Execution.ensure_execution_struct("#{mod}.init/1")
Link to this function

get_assign(exec, name, default \\ nil)

View Source

Returns the assign with the given name for the given exec struct (or return the given default value).

Returns the name of the command, which should be run by the given execution.

Returns all config files for the given exec struct.

Link to this function

get_given_cli_switch(exec, switch_name)

View Source

Returns all issues for the given exec struct.

Link to this function

get_issues(exec, filename)

View Source

Returns all issues for the given exec struct that relate to the given filename.

Link to this function

get_plugin_param(exec, plugin_mod, param_name)

View Source
Link to this function

get_result(exec, name, default \\ nil)

View Source

Returns the result with the given name for the given exec struct (or return the given default value).

Returns all source files for the given exec struct.

Link to this function

get_valid_command_names(exec)

View Source

Returns all valid command names.

Halts further execution of the pipeline.

Link to this function

put_assign(exec, name, value)

View Source

Puts the given value with the given name as assign into the given exec struct.

Link to this function

put_pipeline(exec, pipeline_key, pipeline)

View Source
Link to this function

put_plugin_param(exec, plugin_mod, param_name, param_value)

View Source
Link to this function

put_result(exec, name, value)

View Source

Puts the given value with the given name as result into the given exec struct.

Link to this function

put_source_files(exec, source_files)

View Source

Puts the given source_files into the given exec struct.

Link to this function

set_issues(exec, issues)

View Source

Sets the issues for the given exec struct, overwriting any existing issues.

Sets the exec values which strict implies (if applicable).