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.executable_exists(script, label)[source]
git_lint.git_lint.find_config_file(options, base)[source]

Returns the configuration file from a prioritized list of locations.

Locations are prioritized as:
  1. From the command line. Fail if specified but not found
  2. The repository’s root directory, as the file .git-lint
  3. The repository’s root directory, as the file .git-lint/config
  4. The user’s home directory, as file .git-lint
  5. The user’s home directory, as the file .git-lint/config

If no configuration file is found, this is an error.

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.get_working_linter_names(config)[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

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

git_lint.options module

git_lint.reporters module

git_lint.reporters.base_file_cleaner(files)[source]
git_lint.reporters.group_by(iterable, field_id)[source]
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