style: rename class
This commit is contained in:
		
							parent
							
								
									a0c6bfd63c
								
							
						
					
					
						commit
						e0da740871
					
				|  | @ -114,7 +114,7 @@ class Executor(BaseModel): | ||||||
|     with_: ExecutorWith = Field(..., serialization_alias="with") |     with_: ExecutorWith = Field(..., serialization_alias="with") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ParserConfig(BaseModel): | class Parser(BaseModel): | ||||||
|     name: str |     name: str | ||||||
|     with_: Dict[str, Any] = Field(..., serialization_alias="with") |     with_: Dict[str, Any] = Field(..., serialization_alias="with") | ||||||
| 
 | 
 | ||||||
|  | @ -123,7 +123,7 @@ class StageDetail(BaseModel): | ||||||
|     name: str |     name: str | ||||||
|     group: Optional[str] = "" |     group: Optional[str] = "" | ||||||
|     executor: Executor |     executor: Executor | ||||||
|     parsers: List[ParserConfig] |     parsers: List[Parser] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class Stage(BaseModel): | class Stage(BaseModel): | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ def get_teapot_stage(repo_conf: repo.Config) -> result.StageDetail: | ||||||
|                 cases=[], |                 cases=[], | ||||||
|             ), |             ), | ||||||
|         ), |         ), | ||||||
|         parsers=[result.ParserConfig(name="log", with_={"msg": "joj3 summary"})], |         parsers=[result.Parser(name="log", with_={"msg": "joj3 summary"})], | ||||||
|     ) |     ) | ||||||
|     return stage_conf |     return stage_conf | ||||||
| 
 | 
 | ||||||
|  | @ -87,8 +87,8 @@ def get_health_check_stage(repo_conf: repo.Config) -> result.StageDetail: | ||||||
|             ), |             ), | ||||||
|         ), |         ), | ||||||
|         parsers=[ |         parsers=[ | ||||||
|             result.ParserConfig(name="healthcheck", with_={"score": 1}), |             result.Parser(name="healthcheck", with_={"score": 1}), | ||||||
|             result.ParserConfig(name="debug", with_={"score": 0}), |             result.Parser(name="debug", with_={"score": 0}), | ||||||
|         ], |         ], | ||||||
|     ) |     ) | ||||||
|     return health_check_stage |     return health_check_stage | ||||||
|  |  | ||||||
|  | @ -24,10 +24,7 @@ def get_conf_stage( | ||||||
|             with_=get_executor_with(task_stage, cached), |             with_=get_executor_with(task_stage, cached), | ||||||
|         ), |         ), | ||||||
|         parsers=( |         parsers=( | ||||||
|             [ |             [result.Parser(name=parser, with_={}) for parser in task_stage.parsers] | ||||||
|                 result.ParserConfig(name=parser, with_={}) |  | ||||||
|                 for parser in task_stage.parsers |  | ||||||
|             ] |  | ||||||
|         ), |         ), | ||||||
|     ) |     ) | ||||||
|     processed_dict = get_processed_dict(task_stage) |     processed_dict = get_processed_dict(task_stage) | ||||||
|  | @ -44,10 +41,8 @@ def get_conf_stage( | ||||||
| 
 | 
 | ||||||
| def get_processed_dict( | def get_processed_dict( | ||||||
|     task_stage: task.Stage, |     task_stage: task.Stage, | ||||||
| ) -> Dict[str, Tuple[Callable[[Any, result.ParserConfig], None], Any]]: | ) -> Dict[str, Tuple[Callable[[Any, result.Parser], None], Any]]: | ||||||
|     processed_dict: Dict[ |     processed_dict: Dict[str, Tuple[Callable[[Any, result.Parser], None], Any]] = { | ||||||
|         str, Tuple[Callable[[Any, result.ParserConfig], None], Any] |  | ||||||
|     ] = { |  | ||||||
|         "clangtidy": (fix_keyword, task_stage.clangtidy), |         "clangtidy": (fix_keyword, task_stage.clangtidy), | ||||||
|         "keyword": (fix_keyword, task_stage.keyword), |         "keyword": (fix_keyword, task_stage.keyword), | ||||||
|         "cppcheck": (fix_keyword, task_stage.cppcheck), |         "cppcheck": (fix_keyword, task_stage.cppcheck), | ||||||
|  | @ -91,7 +86,7 @@ def get_executor_with(task_stage: task.Stage, cached: Set[str]) -> result.Execut | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def fix_keyword( | def fix_keyword( | ||||||
|     keyword_config: task.ParserKeyword, keyword_parser_: result.ParserConfig |     keyword_config: task.ParserKeyword, keyword_parser_: result.Parser | ||||||
| ) -> None: | ) -> None: | ||||||
|     keyword_weight: List[result.KeywordConfig] = [] |     keyword_weight: List[result.KeywordConfig] = [] | ||||||
|     unique_weight = list(set(keyword_config.weight)) |     unique_weight = list(set(keyword_config.weight)) | ||||||
|  | @ -114,7 +109,7 @@ def fix_keyword( | ||||||
| 
 | 
 | ||||||
| def fix_result_detail( | def fix_result_detail( | ||||||
|     result_detail_parser_config: task.ParserResultDetail, |     result_detail_parser_config: task.ParserResultDetail, | ||||||
|     result_detail_parser: result.ParserConfig, |     result_detail_parser: result.Parser, | ||||||
| ) -> None: | ) -> None: | ||||||
|     show_files = [] |     show_files = [] | ||||||
|     if result_detail_parser_config.stdout: |     if result_detail_parser_config.stdout: | ||||||
|  | @ -134,7 +129,7 @@ def fix_result_detail( | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def fix_dummy( | def fix_dummy( | ||||||
|     dummy_parser_config: task.ParserDummy, dummy_parser: result.ParserConfig |     dummy_parser_config: task.ParserDummy, dummy_parser: result.Parser | ||||||
| ) -> None: | ) -> None: | ||||||
|     # we don't use dummy parser in real application |     # we don't use dummy parser in real application | ||||||
|     if dummy_parser_config is None: |     if dummy_parser_config is None: | ||||||
|  | @ -149,9 +144,7 @@ def fix_dummy( | ||||||
|     return |     return | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def fix_file( | def fix_file(file_parser_config: task.ParserFile, file_parser: result.Parser) -> None: | ||||||
|     file_parser_config: task.ParserFile, file_parser: result.ParserConfig |  | ||||||
| ) -> None: |  | ||||||
|     file_parser.with_.update( |     file_parser.with_.update( | ||||||
|         result.FileConfig(name=file_parser_config.name).model_dump(by_alias=True) |         result.FileConfig(name=file_parser_config.name).model_dump(by_alias=True) | ||||||
|     ) |     ) | ||||||
|  | @ -160,7 +153,7 @@ def fix_file( | ||||||
| def fix_diff( | def fix_diff( | ||||||
|     task_stage: task.Stage, |     task_stage: task.Stage, | ||||||
|     task_conf: task.Config, |     task_conf: task.Config, | ||||||
|     diff_parser_config: result.ParserConfig, |     diff_parser_config: result.Parser, | ||||||
|     conf_stage: result.StageDetail, |     conf_stage: result.StageDetail, | ||||||
| ) -> None: | ) -> None: | ||||||
|     diff_parser = diff_parser_config |     diff_parser = diff_parser_config | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user