Skip to content

Commit 3f83846

Browse files
authored
feat!: Only pass line-length to format if a value is provided (#330)
* feat: conditional line length * fix * fix * fix * fixing docs and addressing the dart package too
1 parent 7131cfc commit 3f83846

4 files changed

Lines changed: 2 additions & 8 deletions

File tree

.github/workflows/dart_package.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ on:
2626
format_line_length:
2727
required: false
2828
type: string
29-
default: "80"
3029
min_coverage:
3130
required: false
3231
type: number
@@ -100,7 +99,7 @@ jobs:
10099
run: ${{inputs.setup}}
101100

102101
- name: ✨ Check Formatting
103-
run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}}
102+
run: dart format ${{inputs.format_line_length && format('--line-length {0}', inputs.format_line_length) || ''}} --set-exit-if-changed ${{inputs.format_directories}}
104103

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

.github/workflows/flutter_package.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ on:
3030
format_line_length:
3131
required: false
3232
type: string
33-
default: "80"
3433
min_coverage:
3534
required: false
3635
type: number
@@ -101,7 +100,7 @@ jobs:
101100
run: ${{inputs.setup}}
102101

103102
- name: ✨ Check Formatting
104-
run: dart format --line-length ${{inputs.format_line_length}} --set-exit-if-changed ${{inputs.format_directories}}
103+
run: dart format ${{inputs.format_line_length && format('--line-length {0}', inputs.format_line_length) || ''}} --set-exit-if-changed ${{inputs.format_directories}}
105104

106105
- name: 🕵️ Analyze
107106
run: flutter analyze ${{inputs.analyze_directories}}

site/docs/workflows/dart_package.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ The Dart package workflow consists of the following steps:
4040

4141
**Optional** The preferred line length preferred for running the `dart format` command. 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.
4242

43-
**Default** `"80"`
44-
4543
### `min_coverage`
4644

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

site/docs/workflows/flutter_package.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ The Flutter package workflow consists of the following steps:
5858

5959
**Optional** The preferred line length preferred for running the `dart format` command. 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.
6060

61-
**Default** `"80"`
62-
6361
### `min_coverage`
6462

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

0 commit comments

Comments
 (0)