This GitHub Action (written in JavaScript) allows you to leverage GitHub Actions to analyze your Dart project's Dart code, including Flutter. This runs both the dart analyze
and dartfmt
commands under the hood.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
For more information on these inputs, see the Workflow syntax for GitHub Actions
fail-on-infos
: The action fails if any info was found. This will always fail on errors. Optional. Default: false
fail-on-warnings
: The action fails if any warning was found. This will always fail on errors. Optional. Default: false
working-directory
: The working directory. Optional. Default: ./
line-length
: The maximum line length. Optional. The formatter will use its default: 80
None.
Sample Workflow Summary:
Sample Files Changed:
on: push
name: Sample Workflow
jobs: build: name: Example runs-on: ubuntu-latest container: image: google/dart:latest steps:
on: push
name: Sample Workflow
jobs: build: name: Example runs-on: ubuntu-latest steps:
After following the common workflow above, lint rules can be customized. For more details see:
pedantic
for rules enforced internally at Googleeffective_dart
for rules corresponding to the Effective Dart style guideThis is used in my opinionated GitHub Actions: Flutter Workflows repository along with other actions for a complete end-to-end DevOps experience.
The scripts and documentation in this project are released under the MIT License