Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/package_analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ jobs:
run: dart analyze --fatal-warnings --fatal-infos .

- name: Analyze by Dart Code Metrics
uses: dart-code-checker/dart-code-metrics-action@v1
uses: dart-code-checker/dart-code-metrics-action@v1.5.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
folders: "bin, example, lib, test"
pull_request_comment: true
fatal_warnings: true
fatal_performance: true
fatal_style: true
check_unused_files: true
check_unused_files_folders: "bin, example, lib"
pull_request_comment: true

- name: Verify formatting
run: dart format --set-exit-if-changed .
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Checkstyle",
"codeclimate",
"codecov",
"codemagic",
"codequality",
"commitlint",
"cyclomatic",
Expand Down
27 changes: 18 additions & 9 deletions website/docs/integrations/github-action.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GitHub Action

Dart Code Metrics GitHub Action allows you to integrate Dart Code Metrics into your CI/CD process and get code quality reports inside PR's.
[Dart Code Metrics GitHub Action](https://github.com/marketplace/actions/dart-code-metrics-action) allows you to integrate Dart Code Metrics into your CI/CD process and get code quality reports inside PR's.

## Usage {#usage}

Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: dart-code-metrics
uses: dart-code-checker/dart-code-metrics-action@v1
Expand All @@ -28,13 +28,22 @@ jobs:

### Inputs {#inputs}

| Name | Required | Description | Default |
| :--------------------- | :------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ |
| **github_token** | ☑️ | Required to post a report on GitHub. _Note:_ the secret [`GITHUB_TOKEN`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token) is already provided by GitHub and you don't have to set it up yourself. | |
| **folders** | | List of folders whose contents will be scanned. | [`lib`] |
| **relative_path** | | If your package isn't at the root of the repository, set this input to indicate its location. | |
| **github_pat** | Required if you had private GitHub repository in the package dependencies | [**Personal access token**](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) must access to _repo_ and _read:user_ [scopes](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes) | |
| **check_unused_files** | | Additional scan for find unused files in package. | `false` |
### Inputs

| Name | Required | Description | Default |
| :------------------------------------ | :------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------ |
| **github_token** | ☑️ | Required to post a report on GitHub. *Note:* the secret [`GITHUB_TOKEN`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token) is already provided by GitHub and you don't have to set it up yourself. | |
| **github_pat** | Required if you had private GitHub repository in the package dependencies | [**Personal access token**](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) must access to *repo* and *read:user* [scopes](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes) | |
| **folders** | | List of folders whose contents will be scanned. | [`lib`] |
| **relative_path** | | If your package isn't at the root of the repository, set this input to indicate its location. | |
| **pull_request_comment** | | Publish detailed report commented directly into your pull request. | `false` |
| **analyze_report_title_pattern** | | Configurable analyze report title pattern. | `Dart Code Metrics analyze report of $packageName` |
| **fatal_warnings** | | Treat warning level issues as fatal. | `false` |
| **fatal_performance** | | Treat performance level issues as fatal. | `false` |
| **fatal_style** | | Treat style level issues as fatal. | `false` |
| **check_unused_files** | | Additional scan for find unused files in package. | `false` |
| **check_unused_files_folders** | | List of folders whose contents will be scanned for find unused files. | Taken from `folders` argument |
| **unused_files_report_title_pattern** | | Configurable unused files report title pattern. | `Dart Code Metrics unused files report of $packageName` |

### Output example {#output-example}

Expand Down