https://github.com/kitek/dartanalyzer-annotations-action
Github action that creates annotations from dartanalyzer output.
https://github.com/kitek/dartanalyzer-annotations-action
dart flutter lint linter linter-plugin
Last synced: 4 months ago
JSON representation
Github action that creates annotations from dartanalyzer output.
- Host: GitHub
- URL: https://github.com/kitek/dartanalyzer-annotations-action
- Owner: kitek
- License: mit
- Created: 2020-04-15T18:27:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T19:26:10.000Z (almost 4 years ago)
- Last Synced: 2025-10-10T18:16:43.533Z (8 months ago)
- Topics: dart, flutter, lint, linter, linter-plugin
- Language: JavaScript
- Homepage:
- Size: 229 KB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dartanalyzer-annotations-action
Creates [annotations](https://developer.github.com/v3/checks/runs/) from dartanalyzer output.
This action requires installed `dartanalyzer` - you can provide it by adding another action for example [flutter-action](https://github.com/subosito/flutter-action).
Recommended is to use with one of the lint rulesets:
- [effective_dart](https://pub.dev/packages/effective_dart)
- [pedantic](https://pub.dev/packages/pedantic)
## Inputs
### `check_name`
**Required** The name of the check run to add annotations to. This should be the same as the job that uses this action.
### `commit_sha`
**Required** Commit to attach the check to. If the trigger is `push`, this should just be `github.sha`. If the trigger is `pull_request`, this should be the `github.event.pull_request.head.sha`.
### `working-directory`
Working directory to run analysis. If not specified will use the root project folder.
## Example usage
On pull requests branch:
```
name: Run lint on pull requests
on:
pull_request:
branches: [ develop ]
jobs:
lint:
name: Check code style
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Get packages in a Flutter project
run: flutter pub get
- name: Run lint
uses: kitek/dartanalyzer-annotations-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
check_name: 'Check code style'
commit_sha: ${{ github.event.pull_request.head.sha }}
```
On develop branch:
```
name: Build and release app to beta testers
on:
push:
branches: [ develop ]
jobs:
build-android:
name: Build Android App
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v2
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Get packages in a Flutter project
run: flutter pub get
- name: Run lint
uses: kitek/dartanalyzer-annotations-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
check_name: 'Build Android App'
commit_sha: ${{ github.sha }}
```
## Example output:
