{"id":21073263,"url":"https://github.com/valentinvignal/action-dart-analyze","last_synced_at":"2025-05-16T06:30:51.964Z","repository":{"id":38000964,"uuid":"352286234","full_name":"ValentinVignal/action-dart-analyze","owner":"ValentinVignal","description":"This action analyzes dart code","archived":false,"fork":false,"pushed_at":"2024-04-25T03:16:58.000Z","size":2276,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-14T13:05:01.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ValentinVignal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-28T09:16:10.000Z","updated_at":"2024-10-03T10:38:22.000Z","dependencies_parsed_at":"2024-04-25T02:39:05.679Z","dependency_job_id":"a1b9e2ee-b07f-4acf-ac73-0f2113d30d64","html_url":"https://github.com/ValentinVignal/action-dart-analyze","commit_stats":{"total_commits":77,"total_committers":3,"mean_commits":"25.666666666666668","dds":0.06493506493506496,"last_synced_commit":"41eb016b014d6dd742b19b23ee7171bf62348cdd"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinVignal%2Faction-dart-analyze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinVignal%2Faction-dart-analyze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinVignal%2Faction-dart-analyze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinVignal%2Faction-dart-analyze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ValentinVignal","download_url":"https://codeload.github.com/ValentinVignal/action-dart-analyze/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225410903,"owners_count":17470241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T19:00:31.704Z","updated_at":"2025-05-16T06:30:51.952Z","avatar_url":"https://github.com/ValentinVignal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/ValentinVignal/action-dart-analyze/branch/main/graph/badge.svg?token=XESGUDU3E6)](https://codecov.io/gh/ValentinVignal/action-dart-analyze)\n[![wakatime](https://wakatime.com/badge/github/ValentinVignal/action-dart-analyze.svg)](https://wakatime.com/badge/github/ValentinVignal/action-dart-analyze)\n\n# action-dart-analyze\n\nThis action analyzes the modified lines dart code of the PR by running `dart analyze` and `dart format`.\n\n## How to use it\n\nCreate a `.yml` file in `./github/workflows/` in your project.\n\n## Inputs\n\n- `fail-on`: Specifies when the action should fail.\n  - Options:\n    - `'error'`: Fails only on analyze error.\n    - `'warning'`: Fails on warnings and errors.\n    - `'info'`: Fails on info, warnings and errors from `dart analyze`.\n    - `'format'`: Fails on everything, including bad formatting.\n    - `'nothing'`: Fails on nothing.\n  - Optional.\n  - Default: `'error'`.\n- `working-directory`: The working directory.\n  - Optional.\n  - Default: `'./'`.\n- `token`: Github token\n  - Optional.\n  - Default: Secret token provided by Github\n- `check-renamed-files`: If set to `'true'`, it will checks an entire renamed file even if there is no change in it.\n  - Options: `'false'`, `'true'`.\n  - Optional.\n  - Default: `'false'`.\n- `emojis`: `'false'` will remove the emojis from the comment.\n  - Options: `'true'`, `'false'`.\n  - Optional.\n  - Default: `'true'`.\n- `format`: `'false'` will remove the check on the format.\n  - Options: `'true'`, `'false'`.\n  - Optional.\n  - Default: `'true'`.\n- `line-length`: The line length for dart format command.\n  - Optional.\n  - Default: The default value used in `dart format`\n\n## Outputs\n\nNo output.\n\n## Result\n\nIt will fail the checks on your Pull Requests if any issue is found:\n\n![failed-workflow](https://github.com/ValentinVignal/action-dart-analyze/blob/main/doc/images/failed-workflow.png)\n\nIt will leave a comment explaining why it failed and what issues it found:\n\n![comment](https://github.com/ValentinVignal/action-dart-analyze/blob/main/doc/images/comment.png)\n\nIn the code change, it will display errors and warnings where the issues are found:\n\n![changes-warnings-errors](https://github.com/ValentinVignal/action-dart-analyze/blob/main/doc/images/changes-warnings-errors.png)\n\n## Example usage\n\n```yml\non: [pull_request]\n\njobs:\n  linter:\n    runs-on: ubuntu-latest\n    name: Lint flutter code\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n      - name: Set up Flutter\n        uses: subosito/flutter-action@v2\n      - run: flutter pub get\n      - name: Analyze Flutter\n        uses: ValentinVignal/action-dart-analyze@v0.17\n        with:\n          fail-on: \"warning\"\n```\n\n## Using the `GITHUB_TOKEN` in a workflow\n\nIn order to write comments, your `GITHUB_TOKEN` might need the `pull_request: write` permission.\n\n## Run it yourself\n\nAlternatively, you can download and run the script `scripts/run.sh`.\nIn order to run it, you will need to set-up node first\n\n```shell\nOptions:\n-t, --token \u003ctoken\u003e              Required authentication token.\n\n    --fail-on \u003cvalue\u003e            Set failure level (nothing, format, info, warning, error). Default: error.\n    --working-directory \u003cpath\u003e   Set the working directory. Default: ./\n    --[no-]check-renamed-files   Enable or disable checking renamed files. Default: false.\n    --[no-]emojis                Enable or disable emojis. Default: true.\n    --[no-]format                Enable or disable formatting. Default: true.\n    --line-length \u003cnumber\u003e       Set max line length. Default: null.\n-h, --help                       Show this help message.\n```\n\n```yml\non: [pull_request]\n\njobs:\n  linter:\n    runs-on: ubuntu-latest\n    name: Lint flutter code\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n      - name: Set up Flutter\n        uses: subosito/flutter-action@v2\n      - run: flutter pub get\n      - uses: actions/setup-node@v4 # You need to install node before running the script.\n      - run: |\n          curl https://raw.githubusercontent.com/ValentinVignal/action-dart-analyze/refs/heads/main/scripts/run.sh -o script.sh\n          bash script.sh -t ${{ github.token }} --fail-on warning\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinvignal%2Faction-dart-analyze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalentinvignal%2Faction-dart-analyze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinvignal%2Faction-dart-analyze/lists"}