[pre-commit] Add initial pre-commit config
This change adds configuration for the pre-commit tool, follow-up changes will address the remaining issues in a phased approach to make the reviews simpler. This is based on the pre-commit config used in nova with some additional hooks. Follow-up changes will address the FIXME comments related to sphinx-lint and codespell, as well as update tox to enforce these checks in ci. Change-Id: I87681a19f7fa88366c2b0d310c8b3153aa6a137b
This commit is contained in:
@@ -229,6 +229,7 @@ class ActionCollection(collection.Collection):
|
||||
|
||||
class ActionsController(rest.RestController):
|
||||
"""REST controller for Actions."""
|
||||
|
||||
def __init__(self):
|
||||
super(ActionsController, self).__init__()
|
||||
|
||||
|
||||
@@ -468,6 +468,7 @@ class AuditCollection(collection.Collection):
|
||||
|
||||
class AuditsController(rest.RestController):
|
||||
"""REST controller for Audits."""
|
||||
|
||||
def __init__(self):
|
||||
super(AuditsController, self).__init__()
|
||||
self.dc_client = rpcapi.DecisionEngineAPI()
|
||||
|
||||
@@ -475,6 +475,7 @@ class AuditTemplateCollection(collection.Collection):
|
||||
|
||||
class AuditTemplatesController(rest.RestController):
|
||||
"""REST controller for AuditTemplates."""
|
||||
|
||||
def __init__(self):
|
||||
super(AuditTemplatesController, self).__init__()
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ from watcher.decision_engine import rpcapi
|
||||
|
||||
class DataModelController(rest.RestController):
|
||||
"""REST controller for data model"""
|
||||
|
||||
def __init__(self):
|
||||
super(DataModelController, self).__init__()
|
||||
|
||||
|
||||
@@ -153,6 +153,7 @@ class GoalCollection(collection.Collection):
|
||||
|
||||
class GoalsController(rest.RestController):
|
||||
"""REST controller for Goals."""
|
||||
|
||||
def __init__(self):
|
||||
super(GoalsController, self).__init__()
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ class ScoringEngineCollection(collection.Collection):
|
||||
|
||||
class ScoringEngineController(rest.RestController):
|
||||
"""REST controller for Scoring Engines."""
|
||||
|
||||
def __init__(self):
|
||||
super(ScoringEngineController, self).__init__()
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ class ServiceCollection(collection.Collection):
|
||||
|
||||
class ServicesController(rest.RestController):
|
||||
"""REST controller for Services."""
|
||||
|
||||
def __init__(self):
|
||||
super(ServicesController, self).__init__()
|
||||
|
||||
|
||||
@@ -196,6 +196,7 @@ class StrategyCollection(collection.Collection):
|
||||
|
||||
class StrategiesController(rest.RestController):
|
||||
"""REST controller for Strategies."""
|
||||
|
||||
def __init__(self):
|
||||
super(StrategiesController, self).__init__()
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ class MultiType(wtypes.UserType):
|
||||
:param types: Variable-length list of types.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, *types):
|
||||
self.types = types
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ LOG = log.getLogger(__name__)
|
||||
|
||||
class WebhookController(rest.RestController):
|
||||
"""REST controller for webhooks resource."""
|
||||
|
||||
def __init__(self):
|
||||
super(WebhookController, self).__init__()
|
||||
self.dc_client = rpcapi.DecisionEngineAPI()
|
||||
|
||||
@@ -83,6 +83,7 @@ class NoExceptionTracebackHook(hooks.PecanHook):
|
||||
# 'on_error' never fired for wsme+pecan pair. wsme @wsexpose decorator
|
||||
# catches and handles all the errors, so 'on_error' dedicated for unhandled
|
||||
# exceptions never fired.
|
||||
|
||||
def after(self, state):
|
||||
# Omit empty body. Some errors may not have body at this level yet.
|
||||
if not state.response.body:
|
||||
|
||||
@@ -33,6 +33,7 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
|
||||
for public routes in the API.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, app, conf, public_api_routes=()):
|
||||
route_pattern_tpl = r'%s(\.json|\.xml)?$'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user