style(processors/task): fix_keyword
This commit is contained in:
		
							parent
							
								
									a319f59562
								
							
						
					
					
						commit
						5634b3e649
					
				|  | @ -125,12 +125,9 @@ def fix_keyword( | ||||||
|     task_stage: task.Stage, conf_stage: result.StageDetail |     task_stage: task.Stage, conf_stage: result.StageDetail | ||||||
| ) -> result.StageDetail: | ) -> result.StageDetail: | ||||||
|     keyword_parser = ["clangtidy", "keyword", "cppcheck", "cpplint"] |     keyword_parser = ["clangtidy", "keyword", "cppcheck", "cpplint"] | ||||||
|     if task_stage.parsers is not None: |     for parser in task_stage.parsers or []: | ||||||
|         for parser in task_stage.parsers: |  | ||||||
|         if parser in keyword_parser: |         if parser in keyword_parser: | ||||||
|                 keyword_parser_ = next( |             keyword_parser_ = next(p for p in conf_stage.parsers if p.name == parser) | ||||||
|                     p for p in conf_stage.parsers if p.name == parser |  | ||||||
|                 ) |  | ||||||
|             keyword_weight = [] |             keyword_weight = [] | ||||||
|             if getattr(task_stage, parser, None) is not None: |             if getattr(task_stage, parser, None) is not None: | ||||||
|                 unique_weight = list(set(getattr(task_stage, parser).weight)) |                 unique_weight = list(set(getattr(task_stage, parser).weight)) | ||||||
|  | @ -138,9 +135,7 @@ def fix_keyword( | ||||||
|                     keyword_weight.append({"keywords": [], "score": score}) |                     keyword_weight.append({"keywords": [], "score": score}) | ||||||
| 
 | 
 | ||||||
|                 for idx, score in enumerate(unique_weight): |                 for idx, score in enumerate(unique_weight): | ||||||
|                         for idx_, score_ in enumerate( |                     for idx_, score_ in enumerate(getattr(task_stage, parser).weight): | ||||||
|                             getattr(task_stage, parser).weight |  | ||||||
|                         ): |  | ||||||
|                         if score == score_: |                         if score == score_: | ||||||
|                             keyword_weight[idx]["keywords"].append( |                             keyword_weight[idx]["keywords"].append( | ||||||
|                                 getattr(task_stage, parser).keyword[idx_] |                                 getattr(task_stage, parser).keyword[idx_] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user