Skip to content

Commit ac2820c

Browse files
committed
chore: Clean up code formatting and remove unnecessary whitespace in multiple files
1 parent a0a2594 commit ac2820c

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,11 @@ String _formatMap(Map<String, String> map) {
244244
buffer.write('}');
245245
return buffer.toString();
246246
}
247-
class OpenApiTest{
247+
248+
class OpenApiTest {
248249
const OpenApiTest();
249250
}
251+
250252
/// Provides the input spec file to be used.
251253
///
252254
/// Provides the location of the input spec file to be used by the generator.

openapi-generator/lib/src/extensions/type_methods.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension TypeMethods on ConstantReader {
5959
throw Exception(
6060
'Could not read constant via enumValue<$T>(). $T is not a Dart enum.');
6161
}
62-
62+
6363
if (!instanceOf(TypeChecker.typeNamed(T))) {
6464
throw Exception('Not an instance of $T.');
6565
}

openapi-generator/lib/src/openapi_generator_runner.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class OpenapiGenerator extends GeneratorForAnnotation<annots.Openapi> {
2626
@override
2727
FutureOr<String> generateForAnnotatedElement(
2828
Element element, ConstantReader annotations, BuildStep buildStep) async {
29-
3029
logOutputMessage(
3130
log: log,
3231
communication: OutputMessage(

openapi-generator/test/generator_arguments_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void main() {
306306
'Processes annotation with inputSpecFile that contains url correctly',
307307
() async {
308308
final config = File(join(Directory.current.path, 'test', 'specs',
309-
'input_remote_properties_test_config.dart'));
309+
'input_remote_properties_test_config.dart'));
310310
final annotations = await getConstantReaderForPath(
311311
file: config,
312312
libraryName: 'test_lib',

openapi-generator/test/github_issues_test.dart

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,26 @@ void main() {
4545
() async {
4646
var inputSpecFile =
4747
File('$parentFolder/github_issue_#$issueNumber.json');
48-
var outputDir = Directory('./test/specs/issue/$issueNumber/output');
48+
var outputDir = Directory('./test/specs/issue/$issueNumber/output');
4949
var generatedOutput = await generateFromAnnotation(
5050
Openapi(
51-
additionalProperties: AdditionalProperties(
52-
pubName: 'tictactoe_api',
53-
pubAuthor: 'Jon Doe',
54-
pubAuthorEmail: '[email protected]'),
55-
inputSpec: InputSpec(path: inputSpecFile.path),
56-
generatorName: Generator.dart,
57-
cleanSubOutputDirectory: [
58-
'./test/specs/issue/$issueNumber/output'
59-
],
60-
cachePath: './test/specs/issue/$issueNumber/output/cache.json',
61-
outputDirectory: outputDir.path,),
51+
additionalProperties: AdditionalProperties(
52+
pubName: 'tictactoe_api',
53+
pubAuthor: 'Jon Doe',
54+
pubAuthorEmail: '[email protected]'),
55+
inputSpec: InputSpec(path: inputSpecFile.path),
56+
generatorName: Generator.dart,
57+
cleanSubOutputDirectory: ['./test/specs/issue/$issueNumber/output'],
58+
cachePath: './test/specs/issue/$issueNumber/output/cache.json',
59+
outputDirectory: outputDir.path,
60+
),
6261
process: processRunner,
6362
);
6463

6564
expectSourceGenSkipped(outputDir);
66-
65+
6766
expectCodeFormattedSuccessfully(outputDir);
68-
67+
6968
var analyzeResult = await Process.run(
7069
'dart',
7170
['analyze'],
@@ -75,7 +74,7 @@ void main() {
7574
'Analysis result: ${analyzeResult.stdout}\n\n${analyzeResult.stderr}');
7675
expect(analyzeResult.exitCode, 0,
7776
reason: '${analyzeResult.stdout}\n\n${analyzeResult.stderr}');
78-
77+
7978
cleanup(workingDirectory);
8079
});
8180
});

openapi-generator/test/test_annotations/test_configs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ void main() {
7171
nullableFields: true,
7272
),
7373
)
74-
class TestClassHasDioProperties {}
74+
class TestClassHasDioProperties {}

openapi-generator/test/utils.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,13 @@ void expectSourceGenSkipped(Directory outputDir) {
250250

251251
void expectCodeFormattedSuccessfully(Directory outputDir) {
252252
// run dart format --set-exit-if-changed . on the output directory
253-
final result = Process.runSync('dart', ['format', '--set-exit-if-changed', '.'],
253+
final result = Process.runSync(
254+
'dart', ['format', '--set-exit-if-changed', '.'],
254255
workingDirectory: outputDir.path);
255256
expect(result.exitCode, 0,
256257
reason:
257258
'Code formatting failed. Please run "dart format ." on the output directory.\n${result.stdout}\n${result.stderr}');
258-
}
259+
}
259260

260261
void expectSourceGenRun(Directory outputDir) {
261262
expect(

0 commit comments

Comments
 (0)