diff --git a/genindex.html b/genindex.html index bb1790b..c332df6 100644 --- a/genindex.html +++ b/genindex.html @@ -49,11 +49,9 @@

Index

- B - | C + C | D | E - | F | G | L | M @@ -63,16 +61,6 @@ | W
-

B

- - -
- -
base_file_cleaner() (in module git_lint.reporters) -
- -
-

C

@@ -109,16 +97,6 @@
-

F

- - -
- -
find_config_file() (in module git_lint.git_lint) -
- -
-

G

@@ -146,14 +124,10 @@
get_linter_status() (in module git_lint.git_lint)
- -
get_shell_response() (in module git_lint.git_lint) -
-
-
get_working_linter_names() (in module git_lint.git_lint) +
get_shell_response() (in module git_lint.git_lint)
@@ -176,10 +150,6 @@
git_lint.reporters (module)
- -
group_by() (in module git_lint.reporters) -
-
diff --git a/git_lint.html b/git_lint.html index 83d180f..3a2e986 100644 --- a/git_lint.html +++ b/git_lint.html @@ -110,24 +110,6 @@ return code and the output of the lint process.

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. -
  3. The repository’s root directory, as the file .git-lint
  4. -
  5. The repository’s root directory, as the file .git-lint/config
  6. -
  7. The user’s home directory, as file .git-lint
  8. -
  9. The user’s home directory, as the file .git-lint/config
  10. -
-
-
-

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

-
-
git_lint.git_lint.get_filelist(options, extras)[source]
@@ -164,11 +146,6 @@ return code and the output of the lint process.

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]
@@ -221,16 +198,6 @@ Help text, list of (long) options superseded by this one.

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]
diff --git a/modules/git_lint/git_lint.html b/modules/git_lint/git_lint.html index 79bc789..51dc8bc 100644 --- a/modules/git_lint/git_lint.html +++ b/modules/git_lint/git_lint.html @@ -73,39 +73,6 @@ # |___/ -
[docs]def find_config_file(options, base): - """ 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. - """ - - if 'config' in options: - config = options['config'] - configpath = os.path.abspath(config) - if not os.path.isfile(configpath): - sys.exit(_('Configuration file not found: {}\n').format(config)) - return configpath - - home = os.environ.get('HOME', None) - possibles = [os.path.join(base, '.git-lint'), - os.path.join(base, '.git-lint/config')] + ((home and [ - os.path.join(home, '.git-lint'), - os.path.join(home, '.git-lint/config')]) or []) - - matches = [p for p in possibles if os.path.isfile(p)] - if len(matches) == 0: - sys.exit(_('No configuration file found, tried: {}').format(':'.join(possibles))) - - return matches[0]
- - # (commandLineDictionary, repositoryLocation) -> (configurationDictionary | exit)
[docs]def load_config(options, base): """Loads the git-lint configuration file. @@ -119,6 +86,38 @@ files for specific linters. """ + def find_config_file(options, base): + """ 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. + """ + + if 'config' in options: + config = options['config'] + configpath = os.path.abspath(config) + if not os.path.isfile(configpath): + sys.exit(_('Configuration file not found: {}\n').format(config)) + return configpath + + home = os.environ.get('HOME', None) + possibles = [os.path.join(base, '.git-lint'), + os.path.join(base, '.git-lint/config')] + ((home and [ + os.path.join(home, '.git-lint'), + os.path.join(home, '.git-lint/config')]) or []) + + matches = [p for p in possibles if os.path.isfile(p)] + if len(matches) == 0: + sys.exit(_('No configuration file found, tried: {}').format(':'.join(possibles))) + + return matches[0] + Linter = namedtuple('Linter', ['name', 'linter']) path = find_config_file(options, base) configloader = configparser.SafeConfigParser() @@ -242,12 +241,12 @@ return (len(possibles) and possibles.pop(0)) or False
-
[docs]def get_working_linter_names(config): - return [i.name for i in config - if executable_exists(i.linter['command'], i.name)]
- -
[docs]def get_linter_status(config): + + def get_working_linter_names(config): + return [i.name for i in config + if executable_exists(i.linter['command'], i.name)] + working_linter_names = get_working_linter_names(config) broken_linter_names = (set([i.name for i in config]) - set(working_linter_names)) return working_linter_names, broken_linter_names
diff --git a/modules/git_lint/reporters.html b/modules/git_lint/reporters.html index dd34eab..b97dc43 100644 --- a/modules/git_lint/reporters.html +++ b/modules/git_lint/reporters.html @@ -54,26 +54,25 @@ _ = gettext.gettext -
[docs]def base_file_cleaner(files): - return [file.replace(git_base + '/', '', 1) for file in files]
- - -# ICK. Mutation, references, and hidden assignment. -
[docs]def group_by(iterable, field_id): - results = [] - keys = {} - for obj in iterable: - key = obj[field_id] - if key in keys: - keys[key].append(obj) - continue - keys[key] = [obj] - results.append((key, keys[key])) - return results
- -