View Source Chaps.Settings (chaps v1.0.0)

Configurable options used for calculating and displaying coverage status

schema

Schema

  • :default_stop_words - A default set of words for which coverage should be ignored. This option should not be customized. Instead configure the :custom_stop_words key. The default value is [~r/defmodule/, ~r/defrecord/, ~r/defimpl/, ~r/defexception/, ~r/defprotocol/, ~r/defstruct/, ~r/def.+(.+\\.+).+do/, ~r/^\s+use\s+/].

  • :custom_stop_words - A customizable set of words for which coverage should be ignored. The cover module has some difficulty discovering coverage on compile-time constructs in Elixir, so it can be useful to fully ignore some words. The default value is [].

  • :skip_files - A list of regular expressions to use to ignore matching path names from the coverage calculation. The default value is [~r/^test/, ~r/deps/].

  • :print_summary - Whether or not to print the summary of the overall coverage to the terminal. The default value is true.

  • :terminal_options - A set of terminal-output specific configuration options. See the Terminal Options section below for inner configuration. The default value is [].

  • :coverage_options - A set of options that configure how Chaps calculates coverage. See the Coverage Options section below for inner configuration. The default value is [].

terminal-options

Terminal Options

  • :print_files - Whether or not to print a table of files with the coverage of each file. If set to false, the table will not be printed but the overall coverage will be printed. The default value is true.

  • :file_column_width - The width of the column to fit in file names in the terminal output table. Set this option to something larger like 80 or 100 if your project has files with long path names. The default value is 80.

  • :filter_fully_covered - Wether to filter fully covered modules from the terminal table. The default value is true.

coverage-options

Coverage Options

  • :treat_no_relevant_lines_as_covered - Wether or not to treat files which have no significant lines of code as covered (true) at 100% or or not covered (false) at 0%. The default value is true.

  • :output_dir - The output directory to place the HTML report, if generating an HTML report with mix chaps.html. The default value is "cover".

  • :template_path - A path to source a custom template for rendering HTML reports. Defaults to the internal EEx template within the Chaps library.

  • :xml_base_dir - Where to output the XML report if generating an XML report. The default value is "".

  • :minimum_coverage - A percentage target for coverage. If the overall coverage falls below this target, the mix chaps tasks will exit with status code 1. Coverage is floored to the tenths place. The default value is 100.0.

  • :html_filter_fully_covered - Wether or not to filter fully covered modules from the HTML source. The default value is true.