Browse Source

ref: upgrade pre-commit (#26237)

josh 3 years ago
parent
commit
89de2f690d

+ 1 - 1
.github/workflows/issue-status-helper.yml

@@ -13,4 +13,4 @@ jobs:
           GH_REPO: ${{ github.repository }}
         run: |
           labels_to_remove=$(gh api --paginate "/repos/$GH_REPO/labels" -q '[.[].name | select(startswith("Status: ") and . != "${{ github.event.label.name }}")] | join(",")')
-          gh issue edit ${{ github.event.issue.number }} --remove-label "$labels_to_remove" --add-label "${{ github.event.label.name }}"
+          gh issue edit ${{ github.event.issue.number }} --remove-label "$labels_to_remove" --add-label "${{ github.event.label.name }}"

+ 2 - 2
bin/load-mocks

@@ -129,8 +129,8 @@ def generate_commits(user):
             author = (user.name, user.email)
         else:
             author = (
-                "{} {}".format(random.choice(loremipsum.words), random.choice(loremipsum.words)),
-                "{}@example.com".format(random.choice(loremipsum.words)),
+                f"{random.choice(loremipsum.words)} {random.choice(loremipsum.words)}",
+                f"{random.choice(loremipsum.words)}@example.com",
             )
 
         commits.append(

+ 3 - 3
requirements-pre-commit.txt

@@ -1,5 +1,5 @@
-pre-commit==2.9.3
-black==20.8b1
+pre-commit==2.13.0
+black==21.5b1
 sentry-flake8==1.0.0
-pyupgrade==2.10.0
+pyupgrade==2.18.3
 isort==5.8.0

+ 2 - 2
src/sentry/api/bases/external_actor.py

@@ -82,7 +82,7 @@ class ExternalUserSerializer(ExternalActorSerializerBase):
     user_id = serializers.IntegerField(required=True)
 
     def validate_user_id(self, user_id: int) -> User:
-        """ Ensure that this user exists and that they belong to the organization. """
+        """Ensure that this user exists and that they belong to the organization."""
 
         try:
             return User.objects.get(
@@ -102,7 +102,7 @@ class ExternalTeamSerializer(ExternalActorSerializerBase):
     team_id = serializers.IntegerField(required=True)
 
     def validate_team_id(self, team_id: int) -> Team:
-        """ Ensure that this team exists and that they belong to the organization. """
+        """Ensure that this team exists and that they belong to the organization."""
         try:
             return Team.objects.get(id=team_id, organization=self.organization)
         except Team.DoesNotExist:

+ 1 - 1
src/sentry/api/endpoints/internal_packages.py

@@ -11,7 +11,7 @@ class InternalPackagesEndpoint(Endpoint):
 
     def get(self, request):
         data = {
-            "modules": sorted([(p.project_name, p.version) for p in pkg_resources.working_set]),
+            "modules": sorted((p.project_name, p.version) for p in pkg_resources.working_set),
             "extensions": [
                 (p.get_title(), f"{p.__module__}.{p.__class__.__name__}")
                 for p in plugins.all(version=None)

+ 1 - 1
src/sentry/api/endpoints/internal_warnings.py

@@ -30,7 +30,7 @@ class InternalWarningsEndpoint(Endpoint):
 
         data = {
             "groups": sorted(
-                [(groupings[key], sort_by_message(values)) for key, values in groups.items()]
+                (groupings[key], sort_by_message(values)) for key, values in groups.items()
             ),
             "warnings": sort_by_message(warnings),
         }

+ 1 - 1
src/sentry/api/endpoints/organization_events_meta.py

@@ -35,7 +35,7 @@ class OrganizationEventsMetaEndpoint(OrganizationEventsEndpointBase):
 
 class OrganizationEventBaseline(OrganizationEventsEndpointBase):
     def get(self, request, organization):
-        """ Find the event id with the closest value to an aggregate for a given query """
+        """Find the event id with the closest value to an aggregate for a given query"""
         if not self.has_feature(organization, request):
             return Response(status=404)
 

+ 1 - 1
src/sentry/api/endpoints/organization_events_trace.py

@@ -457,7 +457,7 @@ class OrganizationEventsTraceLightEndpoint(OrganizationEventsTraceEndpointBase):
         event_id: Optional[str],
         detailed: bool = False,
     ) -> Sequence[LightResponse]:
-        """ Because the light endpoint could potentially have gaps between root and event we return a flattened list """
+        """Because the light endpoint could potentially have gaps between root and event we return a flattened list"""
         if event_id is None:
             raise ParseError(detail="An event_id is required for the light trace")
         snuba_event, nodestore_event = self.get_current_transaction(transactions, errors, event_id)

+ 1 - 1
src/sentry/api/endpoints/organization_events_trends.py

@@ -106,7 +106,7 @@ class OrganizationEventsTrendsEndpointBase(OrganizationEventsV2EndpointBase):
         }
 
     def get_trend_columns(self, baseline_function, column, middle):
-        """ Construct the columns needed to calculate high confidence trends """
+        """Construct the columns needed to calculate high confidence trends"""
         trend_column = self.trend_columns.get(baseline_function)
         if trend_column is None:
             raise ParseError(detail=f"{baseline_function} is not a supported trend function")

+ 1 - 1
src/sentry/api/endpoints/organization_group_index.py

@@ -79,7 +79,7 @@ def inbox_search(
     # can be.
     earliest_date = now - timedelta(days=7)
     start_params = [date_from, earliest_date, get_search_filter(search_filters, "date", ">")]
-    start = max([_f for _f in start_params if _f])
+    start = max(_f for _f in start_params if _f)
     end = max([earliest_date, end])
 
     if start >= end:

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