From a121265430638ecf448eb7927c4fce8f0d0de7ea Mon Sep 17 00:00:00 2001 From: rainy liu Date: Fri, 28 Jun 2024 10:52:14 +0800 Subject: [PATCH] add formatter --- .github/workflows/formatter.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/formatter.yaml diff --git a/.github/workflows/formatter.yaml b/.github/workflows/formatter.yaml new file mode 100644 index 00000000..be590a48 --- /dev/null +++ b/.github/workflows/formatter.yaml @@ -0,0 +1,24 @@ +on: + push: + pull_request: + +name: Format Code + +jobs: + build: + name: format code + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Flutter + uses: subosito/flutter-action@v1 + - name: Format code + run: | + dart format --line-length 110 \ + $(find lib test -name '*.dart' -not -name '*.g.dart' -and -not -name '*.freezed.dart') + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "dart format ✅" + branch: ${{ github.head_ref }}