Skip to content

Commit

Permalink
Update some docstrings, remove unused test file
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpierce committed Apr 4, 2022
1 parent aab5b95 commit 2221c72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 0 additions & 7 deletions gator/constants.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import re

# Resource Values
RESOURCE_KIND_GENERIC = "GenericResource"
RESOURCE_VERSION_UNUSABLE = "Unusable"


DEFAULT_REGEX_MODES = re.MULTILINE

GIT_INTERNALS_DIRECTORY = ".git"

VERSION_V1_ALPHA = "v1alpha"
12 changes: 10 additions & 2 deletions gator/resources/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@


class _ResourceWithValidation(GatorResource):
"""Define a subclass of Gator Resource that tricks"""
"""
Define a subclass of Gator Resource for Pydantic deserialization purposes.
This subclass uses Pydantic validators to look up the classes associated
with given resource names in a registry, allowing deserialization of
resources not present in the registry at import time (Custom Resources).
"""

@classmethod
def __get_validators__(cls):
Expand All @@ -45,6 +51,7 @@ def return_kind(cls, values):


class ChangesetSpecV1AlphaSpec(BaseModelForbidExtra):
"""Changeset Specification."""
name: str
issue_title: Optional[str]
issue_body: Optional[str]
Expand All @@ -53,6 +60,7 @@ class ChangesetSpecV1AlphaSpec(BaseModelForbidExtra):


class Changeset(BaseModelForbidExtra):
"""Define Changeset."""
kind = "Changeset"
version = "v1alpha"
spec: ChangesetSpecV1AlphaSpec
Expand Down Expand Up @@ -107,7 +115,7 @@ def register_custom_resource(resource_class: Type) -> None:
"""
Register a custom Gator resource.
Use this function to register a custom resource with Gator. This
Use this function to register a custom resource with Gator.
:param resource_class: Pydantic class, extending CodeChangeResource or FilterResource,
that contains the business logic for executing the resource
"""
Expand Down
Empty file removed tests/resources/test_changeset.py
Empty file.

0 comments on commit 2221c72

Please sign in to comment.