zrhoffman commented on a change in pull request #5506:
URL: https://github.com/apache/trafficcontrol/pull/5506#discussion_r574052782



##########
File path: .github/actions/pr-to-update-go/pr_to_update_go/GoPRMaker.py
##########
@@ -0,0 +1,210 @@
+#!/usr/bin/env python3
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import json
+import os
+import re
+import requests
+import sys
+
+from github.InputGitAuthor import InputGitAuthor
+from github.Label import Label
+from requests import Response
+
+from github.Branch import Branch
+from github.GithubException import BadCredentialsException, GithubException, 
UnknownObjectException
+from github.MainClass import Github
+from github.Milestone import Milestone
+from github.PaginatedList import PaginatedList
+from github.PullRequest import PullRequest
+from github.Repository import Repository
+
+from pr_to_update_go.constants import ENV_GITHUB_TOKEN, GO_VERSION_URL, 
ENV_GITHUB_REPOSITORY, \
+    ENV_GITHUB_REPOSITORY_OWNER, GO_REPO_NAME, RELEASE_PAGE_URL, 
ENV_GO_VERSION_FILE, ENV_GIT_AUTHOR_NAME, \
+    GIT_AUTHOR_EMAIL_TEMPLATE
+
+
+class GoPRMaker:
+    gh: Github
+    latest_go_version: str
+    repo: Repository
+
+    def __init__(self, gh: Github) -> None:
+        self.gh = gh
+        repo_name: str = self.get_repo_name()
+        self.repo = self.get_repo(repo_name)
+
+    def run(self) -> None:

Review comment:
       I like `-> None:` because then PyCharm gives you warnings when trying to 
use a value returned by a function whose return type is `None` without needing 
to analyze control flow. For example, on line 6 of this snippet,
   
   ```python
   def a() -> None:
        if False:
                return 1
        print('Returns nothing')
   
   b: int = a()
   ```
   
   it warns
   > Expected type 'int', got 'None' instead.
   
   But that warning is gone if `-> None` is removed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to