Credo v1.2.0 API Reference
Modules
Credo builds upon four building blocks
This module provides functions from the Enum
module which are not supported
in all Elixir versions supported by Credo
Command
is used to describe commands which can be executed from the command line
This module can be used to handle filenames given at the command line
The Options
struct represents the options given on the command line
This module provides helper functions regarding command line output
This module can be used to easily delegate print-statements for different formats to different modules
This module provides functions used to create the UI
Check
modules represent the checks which are run during Credo’s analysis
ConfigComment
structs represent comments which follow control Credo’s behaviour
A behavior for modules that walk through source files and identify consistency issues
This module provides functions for handling parameters (“params”) given to
checks through .credo.exs
(i.e. the Credo.ConfigFile
)
Creating atoms from unknown or external sources dynamically is a potentially unsafe operation because atoms are not garbage-collected by the runtime
Credo.Code
contains a lot of utility or helper functions that deal with the
analysis of - you guessed it - code
This module provides helper functions to analyse blocks, e.g. the block taken
by the if
macro
This module lets you strip charlists from source code
This module lets you strip heredocs from source code
This module provides helper functions to analyse modules, return the defined funcions or module attributes
This module provides helper functions to process names of functions, module attributes and modules
This module provides helper functions to analyse the parameters taken by a function
This is an internal Issue
raised by Credo when it finds itself unable to
parse the source code in a file
This module provides helper functions to determine the scope name at a certain point in the analysed code
This module lets you strip sigils from source code
This module lets you strip strings from source code
This module provides helper functions to analyse tokens returned by Credo.Code.to_tokens/1
Every run of Credo is configured via a Execution
struct, which is created and
manipulated via the Credo.Execution
module
The ExecutionTiming
module can help in timing the execution of code parts and
storing those timing inside the Credo.Execution
struct
A ProcessDefinition
can be used to define a process which consists of
several tasks and can be called with a Credo.Execution
struct
Issue
structs represent all issues found during the code analysis
IssueMeta provides helper functions for meta information which a check wants
to pass to the issue_for(...)
function, i.e. the current SourceFile and check
params (by default)
SourceFile
structs represent a source file in the codebase
This module is used to find and read all source files for analysis
Mix Tasks
Run code analysis (use --help
for options)
Generate a new custom check for Credo
Generate a new config for Credo