Skip to content

Commit 3cd9976

Browse files
authoredJul 27, 2023
Sort exports alphabetically (#75)
* Sort exports alphabetically * Allow tests to be run manually
1 parent 4055398 commit 3cd9976

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎.github/workflows/test.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Test
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [main]
67
pull_request:
@@ -10,12 +11,11 @@ jobs:
1011
test:
1112
runs-on: ubuntu-latest
1213

13-
1414
steps:
1515
- uses: actions/checkout@v3
1616
- uses: subosito/flutter-action@v2
1717
with:
18-
channel: 'stable'
18+
channel: "stable"
1919

2020
- run: flutter --version
2121
- run: flutter pub get

‎tool/export_protos.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io';
22

3+
import 'package:collection/collection.dart';
34
import 'package:path/path.dart' as path;
45

56
String get _protoPath {
@@ -73,7 +74,7 @@ Future<void> _populateExports(Map<String, Iterable<File>> dirStructure) async {
7374
'// THIS FILE IS AUTOMATICALLY GENERATED',
7475
'// DO NOT OVERWRITE\n',
7576
], '\n');
76-
for (final export in fEntry.value) {
77+
for (final export in fEntry.value.sorted((a, b) => a.path.toString().compareTo(b.path.toString()))) {
7778
final relativeExport = path.relative(export.path, from: file.path);
7879
writer.writeln('export \'$relativeExport\';');
7980
}

0 commit comments

Comments
 (0)