git_lint package

Submodules

git_lint.git_lint module

class git_lint.git_lint.Linters(linters, filenames)[source]
dryrun()[source]
static encode_shell_messages(prefix, messages)[source]
static run_external_linter(filename, linter, linter_name)[source]

Run one linter against one file.

If the result matches the error condition specified in the configuration file, return the error code and messages, otherwise return nothing.

static run_one_linter(linter, filenames)[source]

Runs one linter against a set of files

Creates a match filter for the linter, extract the files to be linted, and runs the linter against each file, returning the result as a list of successes and failures. Failures have a return code and the output of the lint process.

class git_lint.git_lint.MatchFilter(config)[source]
static make_match_filter_matcher(extensions)[source]
class git_lint.git_lint.StagingRunner(filenames)[source]
class git_lint.git_lint.WorkspaceRunner(filenames)[source]

Bases: object

git_lint.git_lint.get_filelist(options, extras)[source]

Returns the list of files against which we’ll run the linters.

git_lint.git_lint.get_git_base()[source]
git_lint.git_lint.get_git_head()[source]
git_lint.git_lint.get_git_response(cmd)[source]
git_lint.git_lint.get_git_response_raw(cmd)[source]
git_lint.git_lint.get_linter_status(config)[source]
git_lint.git_lint.get_shell_response(fullcmd)[source]
git_lint.git_lint.linter_exists(linter, label)[source]
git_lint.git_lint.load_config(options, base)[source]

Loads the git-lint configuration file.

Returns the configuration file as a dictionary of dictionaries. Performs substitutions as specified in the SafeConfigParser specification; the only one performed currently is the ‘repodir’ will be replaced with the base directory of the repository. Combined with the option to specify the .git-lint configuration as a directory, this allows users to keep per-project configuration files for specific linters.

git_lint.git_lint.run_git_command(cmd)[source]
git_lint.git_lint.run_linters(options, config, extras=[])[source]
git_lint.git_lint.split_git_response(cmd)[source]

git_lint.option_handler module

class git_lint.option_handler.Arguments(arguments, filenames, excluded)

Bases: tuple

arguments

Alias for field number 0

excluded

Alias for field number 2

filenames

Alias for field number 1

class git_lint.option_handler.Option(short, long, takes, help, conflicts)

Bases: tuple

conflicts

Alias for field number 4

help

Alias for field number 3

long

Alias for field number 1

short

Alias for field number 0

takes

Alias for field number 2

git_lint.option_handler.cleanup_options(options, commandline)[source]
Takes a table of options and the commandline, and returns a
dictionary of those options that appear on the commandline along with any extra arguments.
:param List(Tuple (string, string, boolean, string, List(string))) options,
The table of options: One-letter option, long option, takes arguments, Help text, list of (long) options superseded by this one.
: param List(strings) commandline
The arguments as received by the start-up process
: returns List(strings), List(strings), List(strings)
The longopt dictionary of arguments and associated values (if any) The list of filenames left after argument processing The longopt list of arguments that were excluded by argument precedence

git_lint.options module

git_lint.reporters module

git_lint.reporters.print_help(options, name)[source]
git_lint.reporters.print_linters(config, broken_linter_names)[source]
git_lint.reporters.print_report(results, unlintable_filenames, cant_lint_filenames, broken_linter_names, unfindable_filenames, options={'bylinter': True})[source]
git_lint.reporters.print_version(name, version)[source]

Module contents