Skip to content

Commit 40320fe

Browse files
committed
update
1 parent aaff1ab commit 40320fe

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

.github/scripts/update_changelog.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ void main(List<String> args) {
2828
final sections = extractSections(contents);
2929
final versionExist = sections.where((e) => e.version == version).isNotEmpty;
3030
if (versionExist) {
31-
sections.where((e) => e.version == version).forEach((e) {
32-
e.addUpdate(comitMesssage);
33-
});
31+
for (final versionSection in sections.where((e) => e.version == version)) {
32+
if (comitMesssage.isNotEmpty) {
33+
versionSection.addUpdate(comitMesssage);
34+
}
35+
}
3436
} else {
3537
sections.add(
3638
_VersionSection(
@@ -76,11 +78,13 @@ Set<_VersionSection> extractSections(String contents) {
7678
updates.add(line);
7779
}
7880
}
79-
results.add(_VersionSection(
80-
version: version,
81-
releasedAt: releasedAt,
82-
updates: updates,
83-
));
81+
results.add(
82+
_VersionSection(
83+
version: version,
84+
releasedAt: releasedAt,
85+
updates: updates,
86+
),
87+
);
8488
}
8589

8690
return results;
@@ -105,7 +109,7 @@ class _VersionSection {
105109
required this.version,
106110
required this.releasedAt,
107111
Set<String>? updates,
108-
}) : this.updates = updates ?? {};
112+
}) : updates = updates ?? {};
109113

110114
//
111115
//

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ If you're enjoying this package and find it valuable, consider showing your appr
4949
## 🧑‍⚖️ License
5050

5151
This project is released under the [MIT License](https://raw.githubusercontent.com/dev-cetera/df_gen_core/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_gen_core/main/LICENSE) for more information.
52+

lib/src/language_support/dart_annotated_class_analyzer.dart

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111
//.title~
1212

13+
// ignore_for_file: deprecated_member_use
14+
1315
import 'package:analyzer/dart/analysis/analysis_context_collection.dart';
1416
import 'package:analyzer/dart/analysis/results.dart';
1517
import 'package:analyzer/dart/constant/value.dart';
@@ -82,8 +84,7 @@ final class DartAnnotatedClassAnalyzer {
8284
fullFileUri.toString(),
8385
);
8486
if (library is LibraryElementResult) {
85-
final classElements = library.element.topLevelElements
86-
.whereType<ClassElement>();
87+
final classElements = library.element.topLevelElements.whereType<ClassElement>();
8788
for (final classElement in classElements) {
8889
final className = classElement.displayName;
8990
if (classNameFilter == null || classNameFilter.hasMatch(className)) {
@@ -138,8 +139,7 @@ final class DartAnnotatedClassAnalyzer {
138139
Set<String>? inclMemberAnnotations,
139140
) async {
140141
for (final fieldElement in classElement.fields) {
141-
if (memberNameFilter == null ||
142-
memberNameFilter.hasMatch(fieldElement.displayName)) {
142+
if (memberNameFilter == null || memberNameFilter.hasMatch(fieldElement.displayName)) {
143143
for (final fieldMetadata in fieldElement.metadata) {
144144
final memberAnnotationName = fieldMetadata.element?.displayName;
145145
if (memberAnnotationName != null &&
@@ -199,8 +199,7 @@ final class DartAnnotatedClassAnalyzer {
199199
Set<String>? inclMethodAnnotations,
200200
) async {
201201
for (final method in classElement.methods) {
202-
if (methodNameFilter == null ||
203-
methodNameFilter.hasMatch(method.displayName)) {
202+
if (methodNameFilter == null || methodNameFilter.hasMatch(method.displayName)) {
204203
for (final methodMetadata in method.metadata) {
205204
final methodAnnotationName = methodMetadata.element?.displayName;
206205
if (methodAnnotationName != null &&
@@ -217,9 +216,7 @@ final class DartAnnotatedClassAnalyzer {
217216
final fieldNames = element?.children.map((e) => e.displayName);
218217
if (fieldNames != null) {
219218
for (final fieldName in fieldNames) {
220-
final fieldValue = methodMetadata
221-
.computeConstantValue()
222-
?.getField(fieldName);
219+
final fieldValue = methodMetadata.computeConstantValue()?.getField(fieldName);
223220
if (fieldValue != null) {
224221
await onMethodAnnotationField(
225222
OnMethodAnnotationFieldParams(
@@ -267,8 +264,8 @@ final class DartAnnotatedClassAnalyzer {
267264
if (fieldNames != null) {
268265
for (final fieldName in fieldNames) {
269266
final fieldValue = metadata.computeConstantValue()?.getField(
270-
fieldName,
271-
);
267+
fieldName,
268+
);
272269
if (fieldValue != null) {
273270
await onClassAnnotationField(
274271
OnClassAnnotationFieldParams(
@@ -303,8 +300,7 @@ final class OnAnnotatedClassParams {
303300
});
304301
}
305302

306-
typedef TOnAnnotatedClassCallback =
307-
Future<dynamic> Function(OnAnnotatedClassParams parent);
303+
typedef TOnAnnotatedClassCallback = Future<dynamic> Function(OnAnnotatedClassParams parent);
308304

309305
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
310306

@@ -325,8 +321,9 @@ final class OnClassAnnotationFieldParams {
325321
});
326322
}
327323

328-
typedef TOnClassAnnotationFieldCallback =
329-
Future<dynamic> Function(OnClassAnnotationFieldParams parent);
324+
typedef TOnClassAnnotationFieldCallback = Future<dynamic> Function(
325+
OnClassAnnotationFieldParams parent,
326+
);
330327

331328
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
332329

@@ -345,8 +342,7 @@ final class OnAnnotatedMethodParams {
345342
});
346343
}
347344

348-
typedef TOnAnnotatedMethodCallback =
349-
Future<dynamic> Function(OnAnnotatedMethodParams parent);
345+
typedef TOnAnnotatedMethodCallback = Future<dynamic> Function(OnAnnotatedMethodParams parent);
350346

351347
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
352348

@@ -367,8 +363,9 @@ final class OnMethodAnnotationFieldParams {
367363
});
368364
}
369365

370-
typedef TOnMethodAnnotationFieldCallback =
371-
Future<dynamic> Function(OnMethodAnnotationFieldParams parent);
366+
typedef TOnMethodAnnotationFieldCallback = Future<dynamic> Function(
367+
OnMethodAnnotationFieldParams parent,
368+
);
372369

373370
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
374371

@@ -389,8 +386,7 @@ final class OnAnnotatedMemberParams {
389386
});
390387
}
391388

392-
typedef TOnAnnotatedMemberCallback =
393-
Future<dynamic> Function(OnAnnotatedMemberParams parent);
389+
typedef TOnAnnotatedMemberCallback = Future<dynamic> Function(OnAnnotatedMemberParams parent);
394390

395391
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
396392

@@ -411,8 +407,9 @@ final class OnMemberAnnotationFieldParams {
411407
});
412408
}
413409

414-
typedef TOnMemberAnnotationFieldsCallback =
415-
Future<dynamic> Function(OnMemberAnnotationFieldParams parent);
410+
typedef TOnMemberAnnotationFieldsCallback = Future<dynamic> Function(
411+
OnMemberAnnotationFieldParams parent,
412+
);
416413

417414
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
418415

0 commit comments

Comments
 (0)