File tree Expand file tree Collapse file tree 3 files changed +27
-8
lines changed
std_proxy_metrics_calculator Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 1- # UCMA | Std Metrics Calculator Plugin
1+ # UCMA | Std Proxy Metrics Calculator Plugin
22
33Metrics plugin, which can be used to calculate source code tree metrics with external programs or plugins using ` stdin ` , ` stdout ` and ` stderr ` streams.
4+
5+ ** Install**
6+
7+ ``` bash
8+ poetry add git+https://github.com/Universal-code-metrics-analyzer/std-proxy-metrics-calculator.git@v0.1.1
9+ ```
10+
11+ ** Runner configuration**
12+
13+ ``` yaml
14+ # config.yml
15+
16+ metrics_calculator :
17+ plugin : std_proxy_metrics_calculator
18+ config :
19+ cmd : " cmd to execute"
20+ # try to coerce stdout json keys to snake case
21+ preprocess_keys : True
22+ ` ` `
Original file line number Diff line number Diff line change 11[tool .poetry ]
2- name = " std_metrics_calculator "
3- version = " 0.1.0 "
2+ name = " std_proxy_metrics_calculator "
3+ version = " 0.1.1 "
44description = " "
55authors = [" Alex Pirogov <pirogovalexandr00@mail.ru>" ]
66readme = " README.md"
@@ -44,4 +44,4 @@ known_first_party = ["."]
4444
4545
4646[tool .poetry .plugins ."ucma .metrics_calculator .plugin" ]
47- export = " std_metrics_calculator .calculator:StdMetricsCalculator "
47+ export = " std_proxy_metrics_calculator .calculator:StdProxyMetricsCalculator "
Original file line number Diff line number Diff line change 1111from pydantic .alias_generators import to_snake
1212
1313
14- class StdMetricsCalculatorConfigShape (MetricsCalculatorConfigShape ):
14+ class StdProxyMetricsCalculatorConfigShape (MetricsCalculatorConfigShape ):
1515 cmd : str
1616 preprocess_keys : bool = False
1717
@@ -26,9 +26,9 @@ def dict_to_snake_keys[T: dict[str, Any]](data: T) -> T:
2626 return {to_snake (k ): dict_to_snake_keys (v ) for k , v in data .items ()}
2727
2828
29- class StdMetricsCalculator (
30- MetricsCalculator [StdMetricsCalculatorConfigShape ],
31- config_shape = StdMetricsCalculatorConfigShape ,
29+ class StdProxyMetricsCalculator (
30+ MetricsCalculator [StdProxyMetricsCalculatorConfigShape ],
31+ config_shape = StdProxyMetricsCalculatorConfigShape ,
3232):
3333 async def calculate (self ) -> TreeMetrics :
3434 proc = await asyncio .create_subprocess_shell (
You can’t perform that action at this time.
0 commit comments