Browse Source

chore(various): Fix typos, add/clarify comments, apply auto-formatting (#48347)

This is a collection of tiny fixes to comments and formatting I've accumulated over the last month or so. No code changes.
Katie Byers 1 year ago
parent
commit
e45aafb8a6

+ 1 - 1
config/hooks/pre-commit

@@ -25,7 +25,7 @@ except ModuleNotFoundError:
 
 text_type = str
 
-# git usurbs your bin path for hooks and will always run system python
+# git usurps your bin path for hooks and will always run system python
 if "VIRTUAL_ENV" in os.environ:
     # If pre-commit is not installed outside of the virtualenv, glob will return []
     try:

+ 2 - 2
pyproject.toml

@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
 
 [tool.black]
 # File filtering is taken care of in pre-commit.
-line-length=100
-target-version=['py38']
+line-length = 100
+target-version = ['py38']
 
 [tool.isort]
 profile = "black"

+ 3 - 2
src/sentry/api/base.py

@@ -196,8 +196,8 @@ class Endpoint(APIView):
 
         :param request:          The incoming request.
         :param exc:              The exception raised during handling.
-        :param handler_context:  (Optional) Extra data which will be attached to the event sent
-                                 to Sentry, under the "Request Handler Data" heading.
+        :param handler_context:  (Optional) Extra data which will be attached to the event sent to
+                                 Sentry, under the "Request Handler Data" heading.
         :param scope:            (Optional) A `Scope` object containing extra data which will be
                                  attached to the event sent to Sentry.
 
@@ -222,6 +222,7 @@ class Endpoint(APIView):
             response_body = {"detail": "Internal Error", "errorId": event_id}
             response = Response(response_body, status=500)
             response.exception = True
+
         return response
 
     def create_audit_entry(self, request: Request, transaction_id=None, **kwargs):

+ 4 - 4
src/sentry/features/__init__.py

@@ -14,10 +14,10 @@ from .manager import *  # NOQA
 #
 # Registering a new feature:
 #
-# - Determine what scope your feature falls under. By convention we have a
-#   organizations and project scope which map to the OrganizationFeature and
-#   ProjectFeature feature objects. Scoping will provide the feature with
-#   context.
+# - Determine what scope your feature falls under. By convention we have
+#   organization and project scopes, which map to the OrganizationFeature and
+#   ProjectFeature feature objects, respectively. Scoping will provide the feature
+#   with context.
 #
 #   Organization and Project scoped features will automatically be added into
 #   the Organization and Project serialized representations.

+ 2 - 2
src/sentry/features/manager.py

@@ -153,8 +153,8 @@ class FeatureManager(RegisteredFeatureManager):
         """
         Register a feature.
 
-        The passed class is a Feature container object, this object can be used
-        to encapsulate the context associated to a feature.
+        The passed class is a Feature container object, which can be used
+        to encapsulate the context associated with a feature.
 
         >>> FeatureManager.has('my:feature', actor=request.user)
         """

+ 1 - 1
src/sentry/integrations/jira/endpoints/descriptor.py

@@ -35,7 +35,7 @@ class JiraDescriptorEndpoint(Endpoint):
         return self.respond(
             {
                 "name": "Sentry",
-                "description": "Connect your Sentry organization into one or more of your Jira cloud instances. Get started streamlining your bug squashing workflow by unifying your Sentry and Jira instances together.",
+                "description": "Connect your Sentry organization to one or more of your Jira cloud instances. Get started streamlining your bug-squashing workflow by allowing your Sentry and Jira instances to work together.",
                 "key": JIRA_KEY,
                 "baseUrl": absolute_uri(),
                 "vendor": {"name": "Sentry", "url": "https://sentry.io"},

+ 4 - 0
src/sentry/integrations/mixins/repositories.py

@@ -96,6 +96,10 @@ class RepositoryMixin:
         raise NotImplementedError
 
     def get_unmigratable_repositories(self) -> Sequence[Repository]:
+        """
+        Get all repositories which are in our database but no longer exist as far as
+        the external service is concerned.
+        """
         return []
 
     def reinstall_repositories(self) -> None:

+ 2 - 2
src/sentry/models/integrations/integration.py

@@ -47,8 +47,8 @@ class Integration(DefaultFieldsModel):
     external_id = models.CharField(max_length=64)
     name = models.CharField(max_length=200)
     # metadata might be used to store things like credentials, but it should NOT
-    # be used to store organization-specific information, as the Integration
-    # instance is shared among multiple organizations
+    # be used to store organization-specific information, as an Integration
+    # instance can be shared by multiple organizations
     metadata = JSONField(default=dict)
     status = BoundedPositiveIntegerField(
         default=ObjectStatus.VISIBLE, choices=ObjectStatus.as_choices(), null=True

+ 1 - 0
src/sentry/models/rule.py

@@ -35,6 +35,7 @@ class Rule(Model):
     project = FlexibleForeignKey("sentry.Project")
     environment_id = BoundedPositiveIntegerField(null=True)
     label = models.CharField(max_length=64)
+    # `data` contain all the specifics of the rule - conditions, actions, frequency, etc.
     data = GzippedDictField()
     status = BoundedPositiveIntegerField(
         default=RuleStatus.ACTIVE,

+ 2 - 2
src/sentry/options/defaults.py

@@ -464,8 +464,8 @@ register("store.background-grouping-before", default=False)
 # Store release files bundled as zip files
 register("processing.save-release-archives", default=False)  # unused
 
-# Minimum number of files in an archive. Small archives are extracted and its contents
-# are stored as separate release files.
+# Minimum number of files in an archive. Archives with fewer files are extracted and have their
+# contents stored as separate release files.
 register("processing.release-archive-min-files", default=10)
 
 # Try to read release artifacts from zip archives

Some files were not shown because too many files changed in this diff