Skip to content

Commit 6d9f21b

Browse files
committed
ref: use leading_newlines_in_multiline_strings
1 parent e3ef616 commit 6d9f21b

File tree

8 files changed

+34
-15
lines changed

8 files changed

+34
-15
lines changed

slang/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ linter:
55
sort_pub_dependencies: true
66
always_use_package_imports: true
77
directives_ordering: true
8+
leading_newlines_in_multiline_strings: true

slang/test/unit/runner/wip_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ t.$wip.testMethod(
152152
'testMethod': 'Value with spaces and {param} inside',
153153
});
154154
expect(result.list.length, 1);
155-
expect(result.list[0].original, r"""t.$wip.testMethod(
155+
expect(result.list[0].original, r"""
156+
t.$wip.testMethod(
156157
'Value with spaces and $param inside',
157158
)""");
158159
expect(result.list[0].path, 'testMethod');
@@ -172,7 +173,8 @@ t.$wip.complexMethod(
172173
'complexMethod': '{someFunction}',
173174
});
174175
expect(result.list.length, 1);
175-
expect(result.list[0].original, r"""t.$wip.complexMethod(
176+
expect(result.list[0].original, r"""
177+
t.$wip.complexMethod(
176178
someFunction('test', param: $value),
177179
)""");
178180
expect(result.list[0].path, 'complexMethod');
@@ -192,7 +194,8 @@ t.$wip.variableMethod(
192194
'variableMethod': '{myVariable}',
193195
});
194196
expect(result.list.length, 1);
195-
expect(result.list[0].original, r'''t.$wip.variableMethod(
197+
expect(result.list[0].original, r'''
198+
t.$wip.variableMethod(
196199
myVariable,
197200
)''');
198201
expect(result.list[0].path, 'variableMethod');

slang/test/unit/utils/yaml_writer_test.dart

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ void main() {
1515
'height': 1.85,
1616
'nullable': null
1717
};
18-
final expected = '''name: John
18+
final expected = '''
19+
name: John
1920
age: 30
2021
isActive: true
2122
height: 1.85
@@ -31,7 +32,8 @@ nullable: null
3132
'details': {'age': 28, 'job': 'Engineer'}
3233
}
3334
};
34-
final expected = '''person:
35+
final expected = '''
36+
person:
3537
name: Alice
3638
details:
3739
age: 28
@@ -56,7 +58,8 @@ nullable: null
5658
'normal': 'normal'
5759
}
5860
};
59-
final expected = r'''special:
61+
final expected = r'''
62+
special:
6063
empty: ""
6164
with_question: "? a"
6265
"with:colon": inner spaces
@@ -81,7 +84,8 @@ nullable: null
8184
'without_nl': 'This is a\nmultiline string\n with several lines'
8285
}
8386
};
84-
final expected = '''without_nl: |-
87+
final expected = '''
88+
without_nl: |-
8589
This is a
8690
multiline string
8791
with several lines
@@ -106,7 +110,8 @@ indented:
106110
final input = {
107111
'fruits': ['apple', 'banana', 'cherry'],
108112
};
109-
final expected = '''fruits:
113+
final expected = '''
114+
fruits:
110115
- apple
111116
- banana
112117
- cherry
@@ -121,7 +126,8 @@ indented:
121126
{'type': 'phone', 'value': '555-1234'}
122127
]
123128
};
124-
final expected = '''contacts:
129+
final expected = '''
130+
contacts:
125131
- type: email
126132
value: john@example.com
127133
- type: phone
@@ -151,7 +157,8 @@ indented:
151157
]
152158
}
153159
};
154-
final expected = '''company:
160+
final expected = '''
161+
company:
155162
name: Acme Inc
156163
departments:
157164
- name: Engineering
@@ -175,7 +182,8 @@ indented:
175182
[4, 5, 6]
176183
]
177184
};
178-
final expected = '''matrix:
185+
final expected = '''
186+
matrix:
179187
-
180188
- 1
181189
- 2

slang_build_runner/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ linter:
55
sort_pub_dependencies: true
66
always_use_package_imports: true
77
directives_ordering: true
8+
leading_newlines_in_multiline_strings: true

slang_gpt/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ linter:
55
sort_pub_dependencies: true
66
always_use_package_imports: true
77
directives_ordering: true
8+
leading_newlines_in_multiline_strings: true

slang_gpt/test/unit/prompt/prompt_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import 'package:slang_gpt/prompt/prompt.dart';
88
import 'package:test/test.dart';
99

1010
const _expectedSystemPrompt =
11-
r'''The user wants to internationalize the app. The user will provide you with a JSON file containing the English strings.
11+
r'''
12+
The user wants to internationalize the app. The user will provide you with a JSON file containing the English strings.
1213
You will translate it to German.
1314
Parameters are interpolated with ${parameter} or $parameter.
1415
Linked translations are denoted with the "@:path0.path1" syntax.
@@ -108,7 +109,8 @@ void main() {
108109
expect(prompts.length, 1);
109110
expect(
110111
prompts.first.system,
111-
r'''The user wants to internationalize the "settings" part of the app. The user will provide you with a JSON file containing the English strings.
112+
r'''
113+
The user wants to internationalize the "settings" part of the app. The user will provide you with a JSON file containing the English strings.
112114
You will translate it to German.
113115
Parameters are interpolated with ${parameter} or $parameter.
114116
Linked translations are denoted with the "@:path0.path1" syntax.

slang_mcp/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ linter:
55
sort_pub_dependencies: true
66
always_use_package_imports: true
77
directives_ordering: true
8+
leading_newlines_in_multiline_strings: true

slang_mcp/lib/src/main.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ void main(List<String> arguments) async {
7272
'Gets the translations that existing in base locale but not in secondary locales.',
7373
outputSchema: JsonSchema.object(
7474
description:
75-
'''A map where each key is a locale identifier (e.g., "de", "fr-CA")
75+
'''
76+
A map where each key is a locale identifier (e.g., "de", "fr-CA")
7677
and the value is a nested map containing the missing translation keys and their corresponding base locale strings.''',
7778
),
7879
callback: (args, extra) async {
@@ -133,7 +134,8 @@ and the value is a nested map containing the missing translation keys and their
133134
server.registerTool(
134135
'apply-wip-translations',
135136
description:
136-
'''Adds the found translations from source code to the actual translation files.
137+
'''
138+
Adds the found translations from source code to the actual translation files.
137139
Note: Running apply-translations with **base locale** is not needed afterwards.''',
138140
callback: (args, extra) async {
139141
await runWip(

0 commit comments

Comments
 (0)