git_lint package¶
Submodules¶
git_lint.git_lint module¶
-
class
git_lint.git_lint.
Linters
(linters, filenames)[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.
-
static
-
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.
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.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