Skip to content

Commit fd03a27

Browse files
authored
Fix CI, fix doc comments, ignore deprecations (for now) (kevmoo#82)
1 parent 1cb4a50 commit fd03a27

12 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.2-wip
2+
3+
- Fixed some doc comment references.
4+
15
## 1.1.1
26

37
- Support the latest `package:analyzer` and `package:source_gen`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Pub package](https://img.shields.io/pub/v/source_gen_test.svg)](https://pub.dev/packages/source_gen_test)
2-
[![Build Status](https://github.com/kevmoo/source_gen_test/workflows/CI/badge.svg?branch=master)](https://github.com/kevmoo/source_gen_test/actions?query=workflow%3A%22CI%22+branch%3Amaster)
2+
[![CI](https://github.com/kevmoo/source_gen_test/actions/workflows/ci.yml/badge.svg)](https://github.com/kevmoo/source_gen_test/actions/workflows/ci.yml)
33
[![package publisher](https://img.shields.io/pub/publisher/source_gen_test.svg)](https://pub.dev/packages/source_gen_test/publisher)
44

55
Make it easy to test `Generators` derived from `package:source_gen` by

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ linter:
3333
- prefer_final_locals
3434
- require_trailing_commas
3535
- unnecessary_await_in_return
36+
- unnecessary_ignore
3637
- use_if_null_to_convert_nulls_to_bools
3738
- use_raw_strings
3839
- use_string_buffers

example/example_generator.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ExampleGenerator extends GeneratorForAnnotation<ExampleAnnotation> {
1313

1414
@override
1515
Iterable<String> generateForAnnotatedElement(
16+
// ignore: deprecated_member_use
1617
Element element,
1718
ConstantReader annotation,
1819
BuildStep buildStep,
@@ -23,6 +24,7 @@ class ExampleGenerator extends GeneratorForAnnotation<ExampleAnnotation> {
2324
log.info('This member might be not good.');
2425
}
2526

27+
// ignore: deprecated_member_use
2628
if (element is! ClassElement) {
2729
throw InvalidGenerationSourceError(
2830
'Only supports annotated classes.',

lib/src/annotations.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// ignore_for_file: comment_references
2-
// Note: Should be importing the below libs instead, but we are avoiding imports
3-
// in this file to speed up analyzer parsing!
4-
// import 'package:source_gen/source_gen.dart';
5-
// import 'test_annotated_classes.dart';
1+
/// @docImport 'package:source_gen/source_gen.dart';
2+
/// @docImport 'test_annotated_classes.dart';
3+
library;
64

75
/// Non-public, implementation base class of [ShouldGenerate] and
86
/// [ShouldThrow].
@@ -102,16 +100,16 @@ class ShouldThrow extends TestExpectation {
102100
final String errorMessage;
103101
final String? todo;
104102

105-
/// If `null`, expects [InvalidGenerationSourceError.element] to match the
103+
/// If `null`, expects [InvalidGenerationSource.element] to match the
106104
/// element annotated with [ShouldThrow].
107105
///
108-
/// If a [String], expects [InvalidGenerationSourceError.element] to match an
106+
/// If a [String], expects [InvalidGenerationSource.element] to match an
109107
/// element with the corresponding name.
110108
///
111-
/// If `true`, [InvalidGenerationSourceError.element] is expected to be
109+
/// If `true`, [InvalidGenerationSource.element] is expected to be
112110
/// non-null.
113111
///
114-
/// If `false`, [InvalidGenerationSourceError.element] is not checked.
112+
/// If `false`, [InvalidGenerationSource.element] is not checked.
115113
final dynamic element;
116114

117115
const ShouldThrow(

lib/src/build_log_tracking.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ void initializeBuildLogTracking() {
2323
'`initializeBuildLogTracking` should only be called once.',
2424
);
2525
}
26-
// ignore: cancel_subscriptions
2726
StreamSubscription<void>? logSubscription;
2827

2928
setUp(() {

lib/src/expectation_element.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const _mappers = {
7171
TypeChecker.fromRuntime(ShouldThrow): _shouldThrow,
7272
};
7373

74+
// ignore: deprecated_member_use
7475
Iterable<TestExpectation> _expectationElements(Element element) sync* {
7576
for (var entry in _mappers.entries) {
7677
for (var annotation in entry.key.annotationsOf(element)) {

lib/src/generate_for_element.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ignore_for_file: implementation_imports
1+
// ignore_for_file: implementation_imports, deprecated_member_use
22

33
import 'dart:async';
44

lib/src/init_library_reader.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class PathAwareLibraryReader extends LibraryReader {
8787
PathAwareLibraryReader({
8888
required this.directory,
8989
required this.fileName,
90+
// ignore: deprecated_member_use
9091
required LibraryElement element,
9192
}) : super(element);
9293

lib/src/test_annotated_classes.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ class AnnotatedTest<T> {
354354
assert(exp.element is String);
355355
expectedElementName = exp.element as String;
356356
}
357+
// ignore: deprecated_member_use
357358
elementMatcher = const TypeMatcher<Element>()
358359
.having((e) => e.name, 'name', expectedElementName);
359360
} else if (exp.element == true) {

0 commit comments

Comments
 (0)