Skip to content

Commit 8b28122

Browse files
Merge pull request #93 from Workiva/allow_analyzer_10
Allow analyzer 10
2 parents ac038c4 + 916fbeb commit 8b28122

6 files changed

Lines changed: 38 additions & 60 deletions

File tree

.github/workflows/dart_ci.yaml

Lines changed: 14 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,22 @@
1-
name: Dart CI
1+
name: CI
22

33
on:
4-
push:
5-
branches:
6-
- 'master'
7-
- 'test_consume_*'
84
pull_request:
5+
push:
96
branches:
7+
- master
8+
tags:
109
- '**'
1110

1211
jobs:
13-
test:
14-
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
sdk: [ 2.19.6, stable, beta ]
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: dart-lang/setup-dart@v1
21-
with:
22-
sdk: ${{ matrix.sdk }}
23-
- name: Install dependencies
24-
run: dart pub get
25-
- name: Validate dependencies
26-
run: dart run dependency_validator
27-
- name: Check formatting
28-
run: dart format --output=none --set-exit-if-changed .
29-
if: ${{ matrix.sdk == 'stable' }}
30-
- name: Analyze project source
31-
run: dart analyze
32-
- name: Run tests
33-
run: dart test
34-
- uses: anchore/sbom-action@v0
35-
with:
36-
path: ./
37-
format: cyclonedx-json
12+
# Runs analysis, formatting, and dependency validation against the dart source.
13+
checks:
14+
uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.14
15+
16+
# Generates an SBOM and uploads it via anchore/sbom-action.
17+
build:
18+
uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.14
3819

39-
# If new major versions of analyzer are released in the future and we want to
40-
# be compatible with multiple majors, use this workflow to validate.
41-
# NOTE: we're currently compatible with analyzer v5 and v6, but v5 is only
42-
# compatible with Dart 2 and v6 is only compatible with Dart 3, so we are
43-
# already testing both major versions above. Use this workflow below if we
44-
# need to test compatibility across multiple analyzer majors all on Dart 3.
45-
# validate_analyzer:
46-
# runs-on: ubuntu-latest
47-
# strategy:
48-
# fail-fast: false
49-
# matrix:
50-
# sdk: [ stable ]
51-
# analyzer:
52-
# - ^6.0.0
53-
# - ^7.0.0
54-
# steps:
55-
# - uses: actions/checkout@v4
56-
# - uses: dart-lang/setup-dart@v1
57-
# with:
58-
# sdk: ${{ matrix.sdk }}
59-
# - name: Update analyzer constraint to ${{ matrix.analyzer }}
60-
# run: dart pub remove analyzer && dart pub add analyzer:${{ matrix.analyzer }} && git diff pubspec.yaml
61-
# - name: Analyze project source
62-
# run: dart analyze
63-
# - name: Run tests
64-
# run: dart test
20+
# Runs unit tests in dev mode.
21+
unit-tests:
22+
uses: Workiva/gha-dart-oss/.github/workflows/test-unit.yaml@v0.1.14
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
pull-requests: write
12+
13+
jobs:
14+
# Generates and uploads an SBOM, then publishes to pub.dev.
15+
publish:
16+
uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.14

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.3.0](https://github.com/Workiva/dart_codemod/compare/1.2.0...1.3.0)
2+
3+
- Allow up to analyzer 10
4+
15
## [1.2.0](https://github.com/Workiva/dart_codemod/compare/1.1.0...1.2.0)
26

37
- Add `PackageContextForTest` to `package:codemod/test.dart` to help test

lib/src/file_context.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class FileContext {
7979
var buffer = StringBuffer();
8080
for (var error in result.errors) {
8181
var location = result.lineInfo.getLocation(error.offset);
82+
// ignore: deprecated_member_use
8283
buffer.writeln(' ${error.errorCode.name}: ${error.message} - '
8384
'${location.lineNumber}:${location.columnNumber}');
8485
}

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
sdk: '>=2.19.0 <4.0.0'
1111

1212
dependencies:
13-
analyzer: '>=5.13.0 <7.0.0'
13+
analyzer: '>=5.13.0 <11.0.0'
1414
args: ^2.0.0
1515
glob: ^2.0.1
1616
io: ^1.0.0
@@ -24,8 +24,8 @@ dependencies:
2424

2525
dev_dependencies:
2626
build_runner: ^2.0.1
27-
dart_style: ^2.0.0
28-
dependency_validator: ^3.0.0
27+
dart_style: '>=2.0.0 <4.0.0'
28+
dependency_validator: '>=3.0.0 <6.0.0'
2929
meta: ^1.6.0
3030
mocktail: ^1.0.1
3131
pedantic: ^1.11.0

test_fixtures/functional/before/codemod.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Future<void> run(List<String> args,
2020
);
2121
}
2222

23-
@override
2423
Stream<Patch> testSuggestor(FileContext context) async* {
2524
if (context.sourceText.startsWith('skip')) return;
2625

0 commit comments

Comments
 (0)