Skip to content

Commit a6d1ada

Browse files
feat: Add format_directories option (#113)
* feat: Add `format_directory` input to dart package * feat: Add `format_directory` input to flutter package * docs: Add format_directories to README --------- Co-authored-by: Renan <[email protected]>
1 parent 618f3e0 commit a6d1ada

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/dart_package.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
required: false
2020
type: string
2121
default: "stable"
22+
format_directories:
23+
required: false
24+
type: string
25+
default: "."
2226
min_coverage:
2327
required: false
2428
type: number
@@ -73,7 +77,7 @@ jobs:
7377
run: ${{inputs.setup}}
7478

7579
- name: ✨ Check Formatting
76-
run: dart format --set-exit-if-changed .
80+
run: dart format --set-exit-if-changed ${{inputs.format_directories}}
7781

7882
- name: 🕵️ Analyze
7983
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
@@ -23,6 +23,10 @@ on:
2323
required: false
2424
type: string
2525
default: ""
26+
format_directories:
27+
required: false
28+
type: string
29+
default: "lib test"
2630
min_coverage:
2731
required: false
2832
type: number
@@ -83,7 +87,7 @@ jobs:
8387
run: ${{inputs.setup}}
8488

8589
- name: ✨ Check Formatting
86-
run: dart format --set-exit-if-changed lib test
90+
run: dart format --set-exit-if-changed ${{inputs.format_directories}}
8791

8892
- name: 🕵️ Analyze
8993
run: flutter analyze ${{inputs.analyze_directories}}

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ The Dart package workflow consists of the following steps:
9191

9292
**Default** `"lib test"`
9393

94+
#### `format_directories`
95+
96+
**Optional** A space separated list of folders that should be formatted.
97+
98+
**Default** `"."`
99+
94100
#### `check_ignore`
95101

96102
**Optional** Allows ignoring lines from [coverage][coverage].
@@ -159,6 +165,12 @@ The Flutter package workflow consists of the following steps:
159165

160166
**Default** `"lib test"`
161167

168+
#### `format_directories`
169+
170+
**Optional** A space separated list of folders that should be formatted.
171+
172+
**Default** `"lib test"`
173+
162174
#### `concurrency`
163175

164176
**Optional** The number of concurrent test suites run.
@@ -592,4 +604,4 @@ jobs:
592604
[very_good_workflows_blog_link]: https://verygood.ventures/blog/configuring-workflows-for-your-flutter-projects?utm_source=github&utm_medium=readme&utm_campaign=workflows_readme
593605
[commitizen]: https://github.com/commitizen/conventional-commit-types
594606
[coverage]: https://pub.dev/packages/coverage
595-
[github_actions_secrets_docs]: https://docs.github.com/en/rest/actions/secrets
607+
[github_actions_secrets_docs]: https://docs.github.com/en/rest/actions/secrets

0 commit comments

Comments
 (0)