From d40b7957822460b75ebce5771b4d933a182406ea Mon Sep 17 00:00:00 2001 From: Dmitry Krutskikh Date: Sun, 20 Mar 2022 21:31:05 +0300 Subject: [PATCH 1/2] chore: bump dart-code-metrics-action --- .github/workflows/package_analyze.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package_analyze.yaml b/.github/workflows/package_analyze.yaml index 70dbf6e314..aa36747ac4 100644 --- a/.github/workflows/package_analyze.yaml +++ b/.github/workflows/package_analyze.yaml @@ -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 . From ea331f941ac65c3c5e36a0058660bc8d97d5a8ef Mon Sep 17 00:00:00 2001 From: Dmitry Krutskikh Date: Sun, 20 Mar 2022 21:42:51 +0300 Subject: [PATCH 2/2] docs: update documentation --- .vscode/settings.json | 1 + website/docs/integrations/github-action.md | 27 ++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8db8a86ff7..ef13718748 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,6 +9,7 @@ "Checkstyle", "codeclimate", "codecov", + "codemagic", "codequality", "commitlint", "cyclomatic", diff --git a/website/docs/integrations/github-action.md b/website/docs/integrations/github-action.md index cd3d2ad1af..9fdcc2443e 100644 --- a/website/docs/integrations/github-action.md +++ b/website/docs/integrations/github-action.md @@ -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} @@ -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 @@ -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}