Skip to content

Commit

Permalink
feat: update workflows, add spellcheck, update very_good_analysis (#16)
Browse files Browse the repository at this point in the history
* update very good analysis

* add spell check

* flutter on workflow

* Update .github/cspell.json

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* try to omit the thing
  • Loading branch information
renancaraujo committed Feb 24, 2023
1 parent b46d764 commit e741071
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 36 deletions.
18 changes: 18 additions & 0 deletions .github/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2",
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": ["vgv_allowed", "vgv_forbidden"],
"dictionaryDefinitions": [
{
"name": "vgv_allowed",
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/allowed.txt",
"description": "Allowed VGV Spellings"
},
{
"name": "vgv_forbidden",
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/forbidden.txt",
"description": "Forbidden VGV Spellings"
}
],
"useGitignore": true
}
11 changes: 10 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ jobs:
semantic-pull-request:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1

spell-check:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1
with:
includes: "**/*.md"
modified_files_only: false

build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_version: 2.10.3
flutter_version: 3.7.3

pana_score:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: package:very_good_analysis/analysis_options.2.4.0.yaml
include: package:very_good_analysis/analysis_options.4.0.0.yaml
50 changes: 25 additions & 25 deletions lib/src/models/test_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class StartTestEvent extends TestEvent {
required this.protocolVersion,
required this.runnerVersion,
required this.pid,
required int time,
}) : super(type: 'start', time: time);
required super.time,
}) : super(type: 'start');

/// {@macro start_test_event}
factory StartTestEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -96,8 +96,8 @@ class AllSuitesTestEvent extends TestEvent {
/// {@macro all_suites_test_event}
const AllSuitesTestEvent({
required this.count,
required int time,
}) : super(type: 'allSuites', time: time);
required super.time,
}) : super(type: 'allSuites');

/// {@macro all_suites_test_event}
factory AllSuitesTestEvent.fromJson(Map<String, dynamic> json) =>
Expand All @@ -118,8 +118,8 @@ class SuiteTestEvent extends TestEvent {
/// {@macro suite_test_event}
const SuiteTestEvent({
required this.suite,
required int time,
}) : super(type: 'suite', time: time);
required super.time,
}) : super(type: 'suite');

/// {@macro suite_test_event}
factory SuiteTestEvent.fromJson(Map<String, dynamic> json) =>
Expand All @@ -141,8 +141,8 @@ class DebugTestEvent extends TestEvent {
required this.suiteID,
required this.observatory,
required this.remoteDebugger,
required int time,
}) : super(type: 'debug', time: time);
required super.time,
}) : super(type: 'debug');

/// {@macro debug_test_event}
factory DebugTestEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -171,8 +171,8 @@ class GroupTestEvent extends TestEvent {
/// {@macro group_test_event}
const GroupTestEvent({
required this.group,
required int time,
}) : super(type: 'group', time: time);
required super.time,
}) : super(type: 'group');

/// {@macro group_test_event}
factory GroupTestEvent.fromJson(Map<String, dynamic> json) =>
Expand All @@ -192,8 +192,8 @@ class TestStartEvent extends TestEvent {
/// {@macro test_start_event}
const TestStartEvent({
required this.test,
required int time,
}) : super(type: 'testStart', time: time);
required super.time,
}) : super(type: 'testStart');

/// {@macro test_start_event}
factory TestStartEvent.fromJson(Map<String, dynamic> json) =>
Expand All @@ -216,8 +216,8 @@ class MessageTestEvent extends TestEvent {
required this.testID,
required this.messageType,
required this.message,
required int time,
}) : super(type: 'print', time: time);
required super.time,
}) : super(type: 'print');

/// {@macro message_test_event}
factory MessageTestEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -246,8 +246,8 @@ class ErrorTestEvent extends TestEvent {
required this.error,
required this.stackTrace,
required this.isFailure,
required int time,
}) : super(type: 'error', time: time);
required super.time,
}) : super(type: 'error');

/// {@macro error_test_event}
factory ErrorTestEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -290,8 +290,8 @@ class TestDoneEvent extends TestEvent {
required this.result,
required this.hidden,
required this.skipped,
required int time,
}) : super(type: 'testDone', time: time);
required super.time,
}) : super(type: 'testDone');

/// {@macro test_done_event}
factory TestDoneEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -319,8 +319,8 @@ class DoneTestEvent extends TestEvent {
/// {@macro done_test_event}
const DoneTestEvent({
required this.success,
required int time,
}) : super(type: 'done', time: time);
required super.time,
}) : super(type: 'done');

/// {@macro done_test_event}
factory DoneTestEvent.fromJson(Map<String, dynamic> json) =>
Expand All @@ -340,8 +340,8 @@ class DoneTestEvent extends TestEvent {
@JsonSerializable()
class ExitTestEvent extends TestEvent {
/// {@macro test_exit_event}
const ExitTestEvent({required int time, required this.exitCode})
: super(type: 'exit', time: time);
const ExitTestEvent({required super.time, required this.exitCode})
: super(type: 'exit');

/// {@macro test_exit_event}
factory ExitTestEvent.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -398,12 +398,12 @@ class TestGroup {
required this.id,
required this.name,
required this.suiteID,
this.parentID,
required this.testCount,
required this.metadata,
this.parentID,
this.line,
this.column,
this.url,
required this.metadata,
});

/// {@macro test_group}
Expand Down Expand Up @@ -470,13 +470,13 @@ class Test {
required this.name,
required this.suiteID,
required this.groupIDs,
required this.metadata,
this.line,
this.column,
this.url,
this.rootLine,
this.rootColumn,
this.rootUrl,
required this.metadata,
});

/// {@macro test}
Expand Down
12 changes: 6 additions & 6 deletions lib/src/very_good_test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ Stream<TestEvent> _runTestProcess(
Future<Process> Function() processRunner,
) {
final controller = StreamController<TestEvent>();
late StreamSubscription testEventSubscription;
late StreamSubscription errorSubscription;
late StreamSubscription<dynamic> testEventSubscription;
late StreamSubscription<dynamic> errorSubscription;
late Future<Process> processFuture;

Future<void> _onListen() async {
Future<void> onListen() async {
final stopwatch = Stopwatch()..start();
processFuture = processRunner();
final process = await processFuture;
Expand Down Expand Up @@ -105,16 +105,16 @@ Stream<TestEvent> _runTestProcess(
await controller.close();
}

Future<void> _onCancel() async {
Future<void> onCancel() async {
await controller.close();
(await processFuture).kill();
await errorSubscription.cancel();
await testEventSubscription.cancel();
}

controller
..onListen = _onListen
..onCancel = _onCancel;
..onListen = onListen
..onCancel = onCancel;

return controller.stream;
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ homepage: https://github.com/VeryGoodOpenSource/very_good_test_runner
version: 0.1.2

environment:
sdk: ">=2.16.0 <3.0.0"
sdk: ">=2.18.0 <3.0.0"

dependencies:
json_annotation: ^4.4.0
universal_io: ^2.0.0

dev_dependencies:
build_runner: ^2.0.0
build_verify: ^2.0.0
build_verify: ^3.1.0
json_serializable: ^6.0.0
mocktail: ^0.3.0
test: ^1.19.2
very_good_analysis: ^2.4.0
very_good_analysis: ^4.0.0

0 comments on commit e741071

Please sign in to comment.