diff options
Diffstat (limited to 'src/flake8/exceptions.py')
| -rw-r--r-- | src/flake8/exceptions.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/flake8/exceptions.py b/src/flake8/exceptions.py index bef6f4b..ea9bc98 100644 --- a/src/flake8/exceptions.py +++ b/src/flake8/exceptions.py @@ -93,51 +93,3 @@ class PluginExecutionFailed(Flake8Exception): "name": self.plugin["plugin_name"], "exc": self.original_exception, } - - -class HookInstallationError(Flake8Exception): - """Parent exception for all hooks errors.""" - - -class GitHookAlreadyExists(HookInstallationError): - """Exception raised when the git pre-commit hook file already exists.""" - - def __init__(self, path): # type: (str) -> None - """Initialize the exception message from the `path`.""" - self.path = path - tmpl = ( - "The Git pre-commit hook ({0}) already exists. To convince " - "Flake8 to install the hook, please remove the existing " - "hook." - ) - super(GitHookAlreadyExists, self).__init__(tmpl.format(self.path)) - - -class MercurialHookAlreadyExists(HookInstallationError): - """Exception raised when a mercurial hook is already configured.""" - - hook_name = None # type: str - - def __init__(self, path, value): # type: (str, str) -> None - """Initialize the relevant attributes.""" - self.path = path - self.value = value - tmpl = ( - 'The Mercurial {0} hook already exists with "{1}" in {2}. ' - "To convince Flake8 to install the hook, please remove the " - "{0} configuration from the [hooks] section of your hgrc." - ) - msg = tmpl.format(self.hook_name, self.value, self.path) - super(MercurialHookAlreadyExists, self).__init__(msg) - - -class MercurialCommitHookAlreadyExists(MercurialHookAlreadyExists): - """Exception raised when the hg commit hook is already configured.""" - - hook_name = "commit" - - -class MercurialQRefreshHookAlreadyExists(MercurialHookAlreadyExists): - """Exception raised when the hg commit hook is already configured.""" - - hook_name = "qrefresh" |
