@@ -18,15 +18,15 @@ def generate_github_annotation(match: re.Match[str], branch_url: str) -> Tuple[s
1818 func = match .group (3 )
1919 msg = match .group (4 )
2020 assert isinstance (msg , str )
21- msg_splitpos = msg .find (" " , 21 )
21+ msg_split_pos = msg .find (" " , 21 )
2222 file = match .group (1 )
23- linktext = os .path .basename (file ).split ("." )[0 ]
24- source_link = f"[`{ linktext } `]({ branch_url } /{ file } #L{ lineno } )"
23+ link_text = os .path .basename (file ).split ("." )[0 ]
24+ source_link = f"[`{ link_text } `]({ branch_url } /{ file } #L{ lineno } )"
2525 row = {
2626 "Location" : source_link ,
2727 "Function" : f"`{ func } `" ,
2828 "Error code" : code ,
29- "Error message" : msg [:msg_splitpos ] + "<br>" + msg [msg_splitpos + 1 :],
29+ "Error message" : msg [:msg_split_pos ] + "<br>" + msg [msg_split_pos + 1 :],
3030 "Error description" : "" ,
3131 }
3232 # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message
@@ -49,8 +49,8 @@ def skip_uninteresting_lines(line: str) -> bool:
4949 return True
5050 if line [0 ] == "[" :
5151 pos = line .rfind (os .getcwd ())
52- printfrom = pos + len (os .getcwd ()) + 1 if pos > 0 else line .index ("]" ) + 2
53- info ("PROGRESS: " + line [1 :].split ("]" )[0 ] + ": " + line [printfrom :])
52+ print_from = pos + len (os .getcwd ()) + 1 if pos > 0 else line .index ("]" ) + 2
53+ info ("PROGRESS: " + line [1 :].split ("]" )[0 ] + ": " + line [print_from :])
5454 return True
5555 if line .startswith ("ninja: " ):
5656 line = line [7 :]
@@ -139,17 +139,17 @@ def run_pytype_and_parse_annotations(xfail_files: List[str], branch_url: str):
139139
140140
141141def to_markdown (me , fp , returncode , results , branch_url ):
142- mylink = f"[{ me } ]({ branch_url } /{ me } .py)"
142+ my_link = f"[{ me } ]({ branch_url } /{ me } .py)"
143143 pytype_link = "[pytype](https://google.github.io/pytype)"
144144 if len (results ) or returncode :
145- fp .write (f"\n #### { mylink } reports these { pytype_link } error messages:\n " )
145+ fp .write (f"\n #### { my_link } reports these { pytype_link } error messages:\n " )
146146 fp .write (pd .DataFrame (results ).to_markdown ())
147147 else :
148- fp .write (f"\n #### Congratulations, { mylink } reports no { pytype_link } errors.\n " )
148+ fp .write (f"\n #### Congratulations, { my_link } reports no { pytype_link } errors.\n " )
149149 fp .write ("\n " )
150150
151151
152- def setup_and_run_pytype_action (scriptname : str ):
152+ def setup_and_run_pytype_action (script_name : str ):
153153 config = load ("pyproject.toml" )
154154 pytype = config ["tool" ].get ("pytype" )
155155 xfail_files = pytype .get ("xfail" , []) if pytype else []
@@ -167,12 +167,12 @@ def setup_and_run_pytype_action(scriptname: str):
167167 summary_file = os .environ .get ("GITHUB_STEP_SUMMARY" , None )
168168 if summary_file :
169169 with open (summary_file , "w" , encoding = "utf-8" ) as fp :
170- to_markdown (scriptname , fp , retcode , results , filelink_baseurl )
170+ to_markdown (script_name , fp , retcode , results , filelink_baseurl )
171171 else :
172- to_markdown (scriptname , sys .stdout , retcode , results , filelink_baseurl )
172+ to_markdown (script_name , sys .stdout , retcode , results , filelink_baseurl )
173173
174174
175175if __name__ == "__main__" :
176176 script_basename = os .path .basename (__file__ ).split ("." )[0 ]
177177 basicConfig (format = script_basename + ": %(message)s" , level = INFO )
178- sys .exit (setup_and_run_pytype_action (scriptname = script_basename ))
178+ sys .exit (setup_and_run_pytype_action (script_name = script_basename ))
0 commit comments