NAME
Git::Lint::Config - configuration for Git::Lint
SYNOPSIS
use Git::Lint::Config;
my $config = Git::Lint::Config->load();
my $profiles = $config->{profiles};
DESCRIPTION
Git::Lint::Config
defines and loads settings for Git::Lint.
CONSTRUCTOR
load
Loads check modules and user config, then returns the Git::Lint::Config
object.
METHODS
user_config
Reads, parses, and returns the user config settings from git config
.
CONFIGURATION
Configuration is done through git config
files (~/.gitconfig or /repo/.git/config).
Only one profile, default
, is defined internally. default
contains all check modules by default.
The default
profile can be overridden through git config
files (~/.gitconfig or /repo/.git/config).
To set the default profile to only run the Whitespace
commit check:
[lint "profiles.commit"]
default = Whitespace
Or set the default profile to Whitespace
and the fictional commit check, Flipdoozler
:
[lint "profiles.commit"]
default = Whitespace, Flipdoozler
Additional profiles can be added with a new name and list of checks to run.
[lint "profiles.commit"]
default = Whitespace, Flipdoozler
hardcore = Other, Module, Names
Message check profiles can also be defined.
[lint "profiles.message"]
# override the default profile to only contain SummaryLength, SummaryEndingPeriod, and BlankLineAfterSummary
default = SummaryLength, SummaryEndingPeriod, BlankLineAfterSummary
# create a summary profile with specific modules
summary = SummaryEndingPeriod, SummaryLength
An example configuration is provided in the examples
directory of this project.