Skip to content

Commit

Permalink
Sort exports alphabetically (#75)
Browse files Browse the repository at this point in the history
* Sort exports alphabetically

* Allow tests to be run manually
  • Loading branch information
njooma authored Jul 27, 2023
1 parent 4055398 commit 3cd9976
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
Expand All @@ -10,12 +11,11 @@ jobs:
test:
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"

- run: flutter --version
- run: flutter pub get
Expand Down
3 changes: 2 additions & 1 deletion tool/export_protos.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:collection/collection.dart';
import 'package:path/path.dart' as path;

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

0 comments on commit 3cd9976

Please sign in to comment.