Skip to content

Commit 7436cf3

Browse files
authored
feat: add format_line_length input (#114)
1 parent a6d1ada commit 7436cf3

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/dart_package.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
required: false
2424
type: string
2525
default: "."
26+
format_line_length:
27+
required: false
28+
type: string
29+
default: "80"
2630
min_coverage:
2731
required: false
2832
type: number
@@ -77,7 +81,7 @@ jobs:
7781
run: ${{inputs.setup}}
7882

7983
- name: ✨ Check Formatting
80-
run: dart format --set-exit-if-changed ${{inputs.format_directories}}
84+
run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}}
8185

8286
- name: 🕵️ Analyze
8387
run: dart analyze --fatal-infos --fatal-warnings ${{inputs.analyze_directories}}

.github/workflows/flutter_package.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727
required: false
2828
type: string
2929
default: "lib test"
30+
format_line_length:
31+
required: false
32+
type: string
33+
default: "80"
3034
min_coverage:
3135
required: false
3236
type: number
@@ -87,7 +91,7 @@ jobs:
8791
run: ${{inputs.setup}}
8892

8993
- name: ✨ Check Formatting
90-
run: dart format --set-exit-if-changed ${{inputs.format_directories}}
94+
run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}}
9195

9296
- name: 🕵️ Analyze
9397
run: flutter analyze ${{inputs.analyze_directories}}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ The Dart package workflow consists of the following steps:
7373

7474
**Default** `"stable"`
7575

76+
#### `format_line_length`
77+
78+
**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.
79+
80+
**Default** `"80"`
81+
7682
#### `min_coverage`
7783

7884
**Optional** The minimum coverage percentage allowed.
@@ -195,6 +201,12 @@ The Flutter package workflow consists of the following steps:
195201

196202
**Default** `""`
197203

204+
#### `format_line_length`
205+
206+
**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.
207+
208+
**Default** `"80"`
209+
198210
#### `min_coverage`
199211

200212
**Optional** The minimum coverage percentage allowed.

0 commit comments

Comments
 (0)