@@ -266,7 +266,7 @@ def merge_replacement_files(tmpdir: Path, mergefile: Path):
266266 yaml .safe_dump (output , out )
267267
268268
269- def load_clang_tidy_warnings (fixes_file ) -> Dict :
269+ def load_clang_tidy_warnings (fixes_file : Path ) -> Dict :
270270 """Read clang-tidy warnings from fixes_file. Can be produced by build_clang_tidy_warnings"""
271271 try :
272272 with fixes_file .open () as f :
@@ -955,9 +955,7 @@ def create_review(
955955 files = filter_files (diff , include , exclude )
956956
957957 if files == []:
958- with message_group ("No files to check!" ), Path (REVIEW_FILE ).open (
959- "w"
960- ) as review_file :
958+ with message_group ("No files to check!" ), REVIEW_FILE .open ("w" ) as review_file :
961959 json .dump (
962960 {
963961 "body" : "clang-tidy found no files to check" ,
@@ -972,7 +970,7 @@ def create_review(
972970
973971 line_ranges = get_line_ranges (diff , files )
974972 if line_ranges == "[]" :
975- with message_group ("No lines added in this PR!" ), Path ( REVIEW_FILE ) .open (
973+ with message_group ("No lines added in this PR!" ), REVIEW_FILE .open (
976974 "w"
977975 ) as review_file :
978976 json .dump (
@@ -1071,7 +1069,7 @@ def create_review(
10711069 review = create_review_file (
10721070 clang_tidy_warnings , diff_lookup , offset_lookup , build_dir
10731071 )
1074- with Path ( REVIEW_FILE ) .open ("w" ) as review_file :
1072+ with REVIEW_FILE .open ("w" ) as review_file :
10751073 json .dump (review , review_file )
10761074
10771075 return review
@@ -1111,23 +1109,25 @@ def download_artifacts(pull: PullRequest, workflow_id: int):
11111109
11121110 metadata = (
11131111 json .loads (data .read (str (METADATA_FILE )))
1114- if METADATA_FILE in filenames
1112+ if str ( METADATA_FILE ) in filenames
11151113 else None
11161114 )
11171115 review = (
1118- json .loads (data .read (str (REVIEW_FILE ))) if REVIEW_FILE in filenames else None
1116+ json .loads (data .read (str (REVIEW_FILE )))
1117+ if str (REVIEW_FILE ) in filenames
1118+ else None
11191119 )
11201120 return metadata , review
11211121
11221122
11231123def load_metadata () -> Optional [Metadata ]:
11241124 """Load metadata from the METADATA_FILE path"""
11251125
1126- if not pathlib . Path ( METADATA_FILE ) .exists ():
1126+ if not METADATA_FILE .exists ():
11271127 print (f"WARNING: Could not find metadata file ('{ METADATA_FILE } ')" , flush = True )
11281128 return None
11291129
1130- with Path ( METADATA_FILE ) .open () as metadata_file :
1130+ with METADATA_FILE .open () as metadata_file :
11311131 return json .load (metadata_file )
11321132
11331133
@@ -1136,7 +1136,7 @@ def save_metadata(pr_number: int) -> None:
11361136
11371137 metadata : Metadata = {"pr_number" : pr_number }
11381138
1139- with Path ( METADATA_FILE ) .open ("w" ) as metadata_file :
1139+ with METADATA_FILE .open ("w" ) as metadata_file :
11401140 json .dump (metadata , metadata_file )
11411141
11421142
@@ -1154,7 +1154,7 @@ def load_review(review_file: pathlib.Path) -> Optional[PRReview]:
11541154
11551155def load_and_merge_profiling () -> Dict :
11561156 result = {}
1157- for profile_file in Path ( PROFILE_DIR ) .glob ("*.json" ):
1157+ for profile_file in PROFILE_DIR .glob ("*.json" ):
11581158 profile_dict = json .load (profile_file .open ())
11591159 filename = profile_dict ["file" ]
11601160 current_profile = result .get (filename , {})
0 commit comments