NAME

Module::Checkstyle::Config - Handles configuration directives

SYNOPSIS

use Module::Checkstyle::Config;
my $config = Module::Checkstyle::Config->new();
my $value = $config->get_directive('max-per-file');

DESCRIPTION

METHODS

new ($source)

Constructs a new Module::Checkstyle::Config object. The optional argument $source can be either a reference to a GLOB as in new(\*DATA), a reference to a scalar containing the configuration new(\$config) or a scalar containing a path to a configuration file.

If the $source is ommited it will look for the configuration file located at ~/.module-checkstyle/config.

get_enabled_sections

Returns a list of enabled sections.

get_severity ($check, $directive)

Returns the severity level for a given directive specified by $directive in the section specified by $check. If $check is ommited it will try to figure out what section to read from by investigating the callers package and removing Module::Checkstyle::Check.

get_directive ($check, $directive)

Returns a the directive specified by $directive in the section specified by $check. If $check is ommited it will try to figure out what section to read from by investigating the callers package and removing Module::Checkstyle::Check.

FORMAT

Module::Checkstyle uses the INI file-format for its configuration file. The following example illustrates a sample config file:

; this is a sample config
global-error-level = warn

[Whitespace]
after-comma     = true
after-fat-comma = true

[Package]
max-per-file    = 1

Here we have a global configuration diretive, global-error-level, and a few directives applicable to a specified check.

SEE ALSO

Config::Tiny Module::Checkstyle