Skip to content

Commit

Permalink
build!: require Dart 3 (#52)
Browse files Browse the repository at this point in the history
* feat!: support Dart 3

* chore: use new package config

See more: https://github.com/dart-lang/language/blob/main/accepted/2.8/language-versioning/package-config-file-v2.md

* chore: use available analysis rules

* test: actual value instead of fake

* ci: fixed tested versions

* docs: update changelog

* ci: fixed tested versions
  • Loading branch information
mrverdant13 committed Jul 30, 2023
1 parent 5f5358d commit e486a24
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@v1
- name: Install melos
run: dart pub global activate melos
run: dart pub global activate melos 2.9.0
- name: Initialize melos
run: melos bs
- name: Format and analyze
Expand Down Expand Up @@ -52,9 +52,9 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@v1
- name: Install melos
run: dart pub global activate melos
run: dart pub global activate melos 2.9.0
- name: Install coverage
run: dart pub global activate coverage
run: dart pub global activate coverage 1.6.3
- name: Install coverde
run: dart pub global activate --source path .
- name: Initialize melos
Expand Down Expand Up @@ -95,9 +95,9 @@ jobs:
- name: Install dart
uses: dart-lang/setup-dart@v1
- name: Install melos
run: dart pub global activate melos
run: dart pub global activate melos 2.9.0
- name: Install pana
run: dart pub global activate pana
run: dart pub global activate pana 0.21.35
- name: Initialize melos
run: melos bs
- name: Verify pub score (10pts of tolerance)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [Unreleased]

- **FEAT (BREAKING)**: require Dart 3.

## 0.1.0+1

- **FIX**: use proper version for update check.
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:very_good_analysis/analysis_options.2.4.0.yaml
include: package:very_good_analysis/analysis_options.2.0.0.yaml

analyzer:
exclude:
Expand Down
4 changes: 2 additions & 2 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ scripts:

t:
description: Run tests and generate coverage tracefile for a selected package in random order.
run: melos exec -c 1 -- "dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random --color && format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib"
run: melos exec -c 1 -- "dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random --color && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib"
select-package:
dir-exists: test
T:
description: Run tests and generate coverage tracefiles for all packages in random order.
run: melos run t --no-select
T:ci:
description: Run tests and generate coverage tracefiles for all packages in random order.
run: melos exec --fail-fast --dir-exists=test -- "dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random && format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib"
run: melos exec --fail-fast --dir-exists=test -- "dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib"

MC:
description: Merge all packages coverage tracefiles ignoring data related to generated files.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository: https://github.com/mrverdant13/coverde
issue_tracker: https://github.com/mrverdant13/coverde/issues

environment:
sdk: ">=2.16.1 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
args: ^2.3.0
Expand Down
8 changes: 3 additions & 5 deletions test/src/commands/report/report_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ extension _FixturedString on String {

class MockProcessManager extends Mock implements ProcessManager {}

class FakeProcessResult extends Mock implements ProcessResult {}

void main() {
test(
'''
A trace file report generator command should be instantiable
''',
() {
Expand Down Expand Up @@ -136,7 +134,7 @@ AND an existing tracefile <${proj.name}>
WHEN the command is invoqued
THEN a coverage report should be launched
├─ BY generating an HTML report
├─ AND launching it in a browser
├─ AND launching it in a browser
''',
() async {
// ARRANGE
Expand All @@ -154,7 +152,7 @@ THEN a coverage report should be launched
),
).thenAnswer(
(_) async => Future.value(
FakeProcessResult(),
ProcessResult(0, 0, '', ''),
),
);

Expand Down

0 comments on commit e486a24

Please sign in to comment.