Skip to content

Commit

Permalink
refactor: Analyzer changes and publishing (#127)
Browse files Browse the repository at this point in the history
* refactor: Analyzer changes and publishing

* casting
  • Loading branch information
j4qfrost committed Oct 29, 2022
1 parent e483c57 commit 034ceb5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Uptick versions
run: melos version --yes
- name: Changelog
run: git diff $GITHUB_SHA packages/conduit/CHANGELOG.md > CHANGES.txt
run: git diff --unified=0 $GITHUB_SHA packages/conduit/CHANGELOG.md > CHANGES.txt
- name: Cache Source
run: melos cache-source
- name: Push tags
Expand All @@ -56,4 +56,4 @@ jobs:
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.release_tag }}
files: CHANGES.txt
body_path: CHANGES.txt
6 changes: 3 additions & 3 deletions packages/common/lib/src/openapi/documentable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ class APIDocumentContext {
/// Reusable [APICallback] components.
final APIComponentCollection<APICallback> callbacks;

List<Function> _deferredOperations = [];
List<Future> _deferredOperations = [];

/// Allows asynchronous code during documentation.
///
/// Documentation methods are synchronous. Asynchronous methods may be called and awaited on
/// in [document]. All [document] closures will be executes and awaited on before finishing [document].
/// These closures are called in the order they were added.
void defer(FutureOr Function() document) {
_deferredOperations.add(document);
_deferredOperations.add(Future(document));
}

/// Finalizes [document] and returns it as a serializable [Map].
Expand All @@ -176,7 +176,7 @@ class APIDocumentContext {
Future<Map<String, dynamic>> finalize() async {
final dops = _deferredOperations;
_deferredOperations = [];
await Future.forEach(dops, (Function dop) => dop());
await Future.wait(dops);

document.paths!.values
.expand((p) => p!.operations.values)
Expand Down
4 changes: 2 additions & 2 deletions packages/config/lib/src/runtime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ConfigurationRuntimeImpl extends ConfigurationRuntime
);
buf.writeln(" }");
buf.writeln(
" (configuration as ${type.reflectedType.toString()}).$k = decodedValue as ${v.codec.expectedType};",
" (configuration as ${type.reflectedType}).$k = decodedValue as ${v.codec.expectedType};",
);
buf.writeln("}");
buf.writeln("}");
Expand Down Expand Up @@ -144,7 +144,7 @@ class ConfigurationRuntimeImpl extends ConfigurationRuntime
properties.forEach((name, property) {
final propCheck = """
try {
final $name = (configuration as ${type.reflectedType.toString()}).$name;
final $name = (configuration as ${type.reflectedType}).$name;
if (${property.isRequired} && $name == null) {
missingKeys.add('$name');
}
Expand Down
1 change: 1 addition & 0 deletions packages/open_api/test/v2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void main() {

test("Has paths", () {
expect(doc!.paths!.length, greaterThan(0));
// ignore: avoid_dynamic_calls
expect(doc!.paths!.length, original!["paths"].length);

final Map<String, dynamic> originalPaths =
Expand Down
2 changes: 2 additions & 0 deletions packages/open_api/test/v3_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_dynamic_calls

import 'dart:convert';
import 'dart:io';

Expand Down
1 change: 0 additions & 1 deletion packages/test_harness/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ linter:
- file_names
- hash_and_equals
- implementation_imports
- invariant_booleans
- iterable_contains_unrelated_type
- join_return_with_assignment
- library_names
Expand Down

0 comments on commit 034ceb5

Please sign in to comment.