From 7436cf33c8b1e9f09f038a440eebeaedabb97374 Mon Sep 17 00:00:00 2001 From: Renan <6718144+renancaraujo@users.noreply.github.com> Date: Wed, 17 May 2023 12:26:33 +0100 Subject: [PATCH] feat: add `format_line_length` input (#114) --- .github/workflows/dart_package.yml | 6 +++++- .github/workflows/flutter_package.yml | 6 +++++- README.md | 12 ++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart_package.yml b/.github/workflows/dart_package.yml index faae7dd..7e72194 100644 --- a/.github/workflows/dart_package.yml +++ b/.github/workflows/dart_package.yml @@ -23,6 +23,10 @@ on: required: false type: string default: "." + format_line_length: + required: false + type: string + default: "80" min_coverage: required: false type: number @@ -77,7 +81,7 @@ jobs: run: ${{inputs.setup}} - name: ✨ Check Formatting - run: dart format --set-exit-if-changed ${{inputs.format_directories}} + run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}} - name: 🕵️ Analyze run: dart analyze --fatal-infos --fatal-warnings ${{inputs.analyze_directories}} diff --git a/.github/workflows/flutter_package.yml b/.github/workflows/flutter_package.yml index 566dede..17bc771 100644 --- a/.github/workflows/flutter_package.yml +++ b/.github/workflows/flutter_package.yml @@ -27,6 +27,10 @@ on: required: false type: string default: "lib test" + format_line_length: + required: false + type: string + default: "80" min_coverage: required: false type: number @@ -87,7 +91,7 @@ jobs: run: ${{inputs.setup}} - name: ✨ Check Formatting - run: dart format --set-exit-if-changed ${{inputs.format_directories}} + run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}} - name: 🕵️ Analyze run: flutter analyze ${{inputs.analyze_directories}} diff --git a/README.md b/README.md index a52c776..6ca6e0c 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,12 @@ The Dart package workflow consists of the following steps: **Default** `"stable"` +#### `format_line_length` + +**Optional** The line-length preferred to run the `dart format` command with. Be aware that this does not change the behavior of the analysis step and longer lines could still make the workflow fail if the rule `lines_longer_than_80_chars` is used. + +**Default** `"80"` + #### `min_coverage` **Optional** The minimum coverage percentage allowed. @@ -195,6 +201,12 @@ The Flutter package workflow consists of the following steps: **Default** `""` +#### `format_line_length` + +**Optional** The line-length preferred to run the `dart format` command with. Be aware that this does not change the behavior of the analysis step and longer lines could still make the workflow fail if the rule `lines_longer_than_80_chars` is used. + +**Default** `"80"` + #### `min_coverage` **Optional** The minimum coverage percentage allowed.