Skip to content

Commit cf5f10a

Browse files
authored
Merge pull request #202 from ysk8hori/feature/metrics-diff
feat: show-metrics :true を指定することでメトリクスを表示する
2 parents 0f1033a + b014544 commit cf5f10a

31 files changed

+5201
-1419
lines changed

.github/workflows/test-dummy_project.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1414
- name: Delta Typescript Graph
1515
id: tsg
16-
uses: ysk8hori/delta-typescript-graph-action@7d17376b59ac5d63b67aabd79c614535da4ebbfd
16+
uses: ysk8hori/delta-typescript-graph-action@3a2463ae804a9c18d42b98e22a4ed12ba14c265a
1717
with:
1818
access-token: ${{ secrets.GITHUB_TOKEN }}
1919
tsconfig: './dummy_project/tsconfig-dummy.json'
@@ -22,3 +22,4 @@ jobs:
2222
debug: true
2323
include-index-file-dependencies: true
2424
comment-title: 'Dummy project dependency graph'
25+
show-metrics: true

.github/workflows/test-no-params.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14-
- uses: ysk8hori/delta-typescript-graph-action@7d17376b59ac5d63b67aabd79c614535da4ebbfd
14+
- uses: ysk8hori/delta-typescript-graph-action@3a2463ae804a9c18d42b98e22a4ed12ba14c265a
1515
with:
1616
max-size: 50

.github/workflows/test-with-params.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ jobs:
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1414
- name: Delta Typescript Graph
1515
id: tsg
16-
uses: ysk8hori/delta-typescript-graph-action@7d17376b59ac5d63b67aabd79c614535da4ebbfd
16+
uses: ysk8hori/delta-typescript-graph-action@3a2463ae804a9c18d42b98e22a4ed12ba14c265a
1717
with:
1818
access-token: ${{ secrets.GITHUB_TOKEN }}
1919
tsconfig-root: './'
20-
max-size: 3
20+
max-size: 50
2121
orientation: LR
2222
debug: true
2323
in-details: true
2424
exclude: 'test'
2525
include-index-file-dependencies: true
2626
comment-title: 'Delta TSG with params'
27+
show-metrics: true

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ This Action provides several parameters to customize its behavior. You can speci
123123
| `exclude` | `string` | `'node_modules, test'` | Specifies a comma-separated list of files to exclude from the graph. |
124124
| `include-index-file-dependencies` | `boolean` | `false` | Determines whether to display dependency files when the changed file is referenced from an index.ts in the same directory. |
125125
| `comment-title` | `string` | `Delta TypeScript Graph` | Specifies the title of the comment posted on the PR. Useful for distinguishing analyses in monorepos or multiple CI runs. |
126+
| `show-metrics` | `boolean` | `false` | Specifies whether to calculate and display metrics for the graph. |
126127

127128
To use these parameters, include them under the `with` section of your workflow file when using this Action. For example:
128129

@@ -138,6 +139,7 @@ steps:
138139
in-details: true
139140
exclude: 'node_modules, test'
140141
include-index-file-dependencies: true
142+
show-metrics: true
141143
```
142144

143145
This configuration will set up the Action with the specified parameters, allowing you to customize its behavior according to your project's needs.
@@ -148,3 +150,12 @@ Using the `tsg` command found in the comments generated by this action, you can
148150

149151
For more information about the `tsg` command, please refer to the following repository:
150152
https://github.com/ysk8hori/typescript-graph
153+
154+
## About the metrics
155+
156+
This is a beta feature for measuring code metrics, including the Maintainability Index and Cognitive Complexity, among others.
157+
While these metrics are widely recognized, their accuracy in TypeScript-specific contexts may vary.
158+
Nonetheless, they can serve as helpful indicators for evaluating code quality.
159+
160+
For more details, please refer to the TypeScript Graph README:
161+
[TypeScript Graph README](https://github.com/ysk8hori/typescript-graph)

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ inputs:
4141
description: 'Specifies the title of the comment posted on the PR.'
4242
required: false
4343
default: 'Delta TypeScript Graph'
44+
show-metrics:
45+
description: 'Calculate and display metrics for the graph'
46+
required: false
47+
default: false
4448
runs:
4549
using: 'node20'
4650
main: 'dist/index.js'

0 commit comments

Comments
 (0)