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.
find_config_file
(options, base)[source]¶ Returns the configuration file from a prioritized list of locations.
- Locations are prioritized as:
- From the command line. Fail if specified but not found
- The repository’s root directory, as the file .git-lint
- The repository’s root directory, as the file .git-lint/config
- The user’s home directory, as file .git-lint
- 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.
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¶
-
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