Skip to content

Commit 7190cb0

Browse files
srawlinsCommit Queue
authored andcommitted
analyzer: Use package language version to format generated files.
This fixes an issue of our code-generation scripts fighting the Dart Format presubmit check. Change-Id: Ib0dc77a4cd580c4f4fd077b48849984eefebc7e3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400223 Reviewed-by: Bob Nystrom <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent be5e078 commit 7190cb0

File tree

18 files changed

+5220
-7200
lines changed

18 files changed

+5220
-7200
lines changed

pkg/analysis_server_client/lib/src/protocol/protocol_common.dart

Lines changed: 460 additions & 813 deletions
Large diffs are not rendered by default.

pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class AnalysisOptionsErrorCode extends ErrorCode {
3131
/// 3: the error message
3232
static const AnalysisOptionsErrorCode INCLUDED_FILE_PARSE_ERROR =
3333
AnalysisOptionsErrorCode(
34-
'INCLUDED_FILE_PARSE_ERROR',
35-
"{3} in {0}({1}..{2})",
36-
);
34+
'INCLUDED_FILE_PARSE_ERROR',
35+
"{3} in {0}({1}..{2})",
36+
);
3737

3838
/// An error code indicating that there is a syntactic error in the file.
3939
///
@@ -53,10 +53,10 @@ class AnalysisOptionsErrorCode extends ErrorCode {
5353
super.isUnresolvedIdentifier = false,
5454
String? uniqueName,
5555
}) : super(
56-
name: name,
57-
problemMessage: problemMessage,
58-
uniqueName: 'AnalysisOptionsErrorCode.${uniqueName ?? name}',
59-
);
56+
name: name,
57+
problemMessage: problemMessage,
58+
uniqueName: 'AnalysisOptionsErrorCode.${uniqueName ?? name}',
59+
);
6060

6161
@override
6262
ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
@@ -72,10 +72,10 @@ class AnalysisOptionsHintCode extends ErrorCode {
7272
/// 0: the rule name
7373
static const AnalysisOptionsHintCode DEPRECATED_LINT =
7474
AnalysisOptionsHintCode(
75-
'DEPRECATED_LINT',
76-
"'{0}' is a deprecated lint rule and should not be used.",
77-
correctionMessage: "Try removing '{0}'.",
78-
);
75+
'DEPRECATED_LINT',
76+
"'{0}' is a deprecated lint rule and should not be used.",
77+
correctionMessage: "Try removing '{0}'.",
78+
);
7979

8080
/// A hint code indicating reference to a deprecated lint.
8181
///
@@ -84,10 +84,10 @@ class AnalysisOptionsHintCode extends ErrorCode {
8484
/// 1: the replacing rule name
8585
static const AnalysisOptionsHintCode DEPRECATED_LINT_WITH_REPLACEMENT =
8686
AnalysisOptionsHintCode(
87-
'DEPRECATED_LINT_WITH_REPLACEMENT',
88-
"'{0}' is deprecated and should be replaced by '{1}'.",
89-
correctionMessage: "Try replacing '{0}' with '{1}'.",
90-
);
87+
'DEPRECATED_LINT_WITH_REPLACEMENT',
88+
"'{0}' is deprecated and should be replaced by '{1}'.",
89+
correctionMessage: "Try replacing '{0}' with '{1}'.",
90+
);
9191

9292
/// Duplicate rules.
9393
///
@@ -108,10 +108,10 @@ class AnalysisOptionsHintCode extends ErrorCode {
108108
super.isUnresolvedIdentifier = false,
109109
String? uniqueName,
110110
}) : super(
111-
name: name,
112-
problemMessage: problemMessage,
113-
uniqueName: 'AnalysisOptionsHintCode.${uniqueName ?? name}',
114-
);
111+
name: name,
112+
problemMessage: problemMessage,
113+
uniqueName: 'AnalysisOptionsHintCode.${uniqueName ?? name}',
114+
);
115115

116116
@override
117117
ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
@@ -128,17 +128,17 @@ class AnalysisOptionsWarningCode extends ErrorCode {
128128
///
129129
static const AnalysisOptionsWarningCode ANALYSIS_OPTION_DEPRECATED =
130130
AnalysisOptionsWarningCode(
131-
'ANALYSIS_OPTION_DEPRECATED',
132-
"The option '{0}' is no longer supported.",
133-
);
131+
'ANALYSIS_OPTION_DEPRECATED',
132+
"The option '{0}' is no longer supported.",
133+
);
134134

135135
/// An error code indicating that the given option is deprecated.
136136
///
137137
/// Parameters:
138138
/// 0: the option name
139139
/// 1: the replacement option name
140140
static const AnalysisOptionsWarningCode
141-
ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT = AnalysisOptionsWarningCode(
141+
ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT = AnalysisOptionsWarningCode(
142142
'ANALYSIS_OPTION_DEPRECATED',
143143
"The option '{0}' is no longer supported.",
144144
correctionMessage: "Try using the new '{1}' option.",
@@ -154,9 +154,9 @@ class AnalysisOptionsWarningCode extends ErrorCode {
154154
/// 3: the warning message
155155
static const AnalysisOptionsWarningCode INCLUDED_FILE_WARNING =
156156
AnalysisOptionsWarningCode(
157-
'INCLUDED_FILE_WARNING',
158-
"Warning in the included options file {0}({1}..{2}): {3}",
159-
);
157+
'INCLUDED_FILE_WARNING',
158+
"Warning in the included options file {0}({1}..{2}): {3}",
159+
);
160160

161161
/// An error code indicating a specified include file could not be found.
162162
///
@@ -166,9 +166,9 @@ class AnalysisOptionsWarningCode extends ErrorCode {
166166
/// 2: the path of the context being analyzed
167167
static const AnalysisOptionsWarningCode INCLUDE_FILE_NOT_FOUND =
168168
AnalysisOptionsWarningCode(
169-
'INCLUDE_FILE_NOT_FOUND',
170-
"The include file '{0}' in '{1}' can't be found when analyzing '{2}'.",
171-
);
169+
'INCLUDE_FILE_NOT_FOUND',
170+
"The include file '{0}' in '{1}' can't be found when analyzing '{2}'.",
171+
);
172172

173173
/// An error code indicating an incompatible rule.
174174
///
@@ -177,10 +177,10 @@ class AnalysisOptionsWarningCode extends ErrorCode {
177177
/// 1: the incompatible rule
178178
static const AnalysisOptionsWarningCode INCOMPATIBLE_LINT =
179179
AnalysisOptionsWarningCode(
180-
'INCOMPATIBLE_LINT',
181-
"The rule '{0}' is incompatible with the rule '{1}'.",
182-
correctionMessage: "Try removing one of the incompatible rules.",
183-
);
180+
'INCOMPATIBLE_LINT',
181+
"The rule '{0}' is incompatible with the rule '{1}'.",
182+
correctionMessage: "Try removing one of the incompatible rules.",
183+
);
184184

185185
/// An error code indicating that a plugin is being configured with an invalid
186186
/// value for an option and a detail message is provided.
@@ -190,30 +190,30 @@ class AnalysisOptionsWarningCode extends ErrorCode {
190190
/// 1: the detail message
191191
static const AnalysisOptionsWarningCode INVALID_OPTION =
192192
AnalysisOptionsWarningCode(
193-
'INVALID_OPTION',
194-
"Invalid option specified for '{0}': {1}",
195-
);
193+
'INVALID_OPTION',
194+
"Invalid option specified for '{0}': {1}",
195+
);
196196

197197
/// An error code indicating an invalid format for an options file section.
198198
///
199199
/// Parameters:
200200
/// 0: the section name
201201
static const AnalysisOptionsWarningCode INVALID_SECTION_FORMAT =
202202
AnalysisOptionsWarningCode(
203-
'INVALID_SECTION_FORMAT',
204-
"Invalid format for the '{0}' section.",
205-
);
203+
'INVALID_SECTION_FORMAT',
204+
"Invalid format for the '{0}' section.",
205+
);
206206

207207
/// An error code indicating multiple plugins have been specified as enabled.
208208
///
209209
/// Parameters:
210210
/// 0: the name of the first plugin
211211
static const AnalysisOptionsWarningCode MULTIPLE_PLUGINS =
212212
AnalysisOptionsWarningCode(
213-
'MULTIPLE_PLUGINS',
214-
"Multiple plugins can't be enabled.",
215-
correctionMessage: "Remove all plugins following the first, '{0}'.",
216-
);
213+
'MULTIPLE_PLUGINS',
214+
"Multiple plugins can't be enabled.",
215+
correctionMessage: "Remove all plugins following the first, '{0}'.",
216+
);
217217

218218
/// An error code indicating a specified include file includes itself recursively.
219219
///
@@ -222,11 +222,11 @@ class AnalysisOptionsWarningCode extends ErrorCode {
222222
/// 1: the path of the file containing the include directive
223223
static const AnalysisOptionsWarningCode RECURSIVE_INCLUDE_FILE =
224224
AnalysisOptionsWarningCode(
225-
'RECURSIVE_INCLUDE_FILE',
226-
"The include file '{0}' in '{1}' includes itself recursively.",
227-
correctionMessage:
228-
"Try changing the chain of 'include's to not re-include this file.",
229-
);
225+
'RECURSIVE_INCLUDE_FILE',
226+
"The include file '{0}' in '{1}' includes itself recursively.",
227+
correctionMessage:
228+
"Try changing the chain of 'include's to not re-include this file.",
229+
);
230230

231231
/// An error code indicating a removed lint rule.
232232
///
@@ -235,10 +235,10 @@ class AnalysisOptionsWarningCode extends ErrorCode {
235235
/// 1: the SDK version in which the lint was removed
236236
static const AnalysisOptionsWarningCode REMOVED_LINT =
237237
AnalysisOptionsWarningCode(
238-
'REMOVED_LINT',
239-
"'{0}' was removed in Dart '{1}'",
240-
correctionMessage: "Remove the reference to '{0}'.",
241-
);
238+
'REMOVED_LINT',
239+
"'{0}' was removed in Dart '{1}'",
240+
correctionMessage: "Remove the reference to '{0}'.",
241+
);
242242

243243
/// An error code indicating a removed lint rule.
244244
///
@@ -248,21 +248,21 @@ class AnalysisOptionsWarningCode extends ErrorCode {
248248
/// 2: the name of a replacing lint
249249
static const AnalysisOptionsWarningCode REPLACED_LINT =
250250
AnalysisOptionsWarningCode(
251-
'REPLACED_LINT',
252-
"'{0}' was replaced by '{2}' in Dart '{1}'.",
253-
correctionMessage: "Replace '{0}' with '{1}'.",
254-
);
251+
'REPLACED_LINT',
252+
"'{0}' was replaced by '{2}' in Dart '{1}'.",
253+
correctionMessage: "Replace '{0}' with '{1}'.",
254+
);
255255

256256
/// An error code indicating an undefined lint rule.
257257
///
258258
/// Parameters:
259259
/// 0: the rule name
260260
static const AnalysisOptionsWarningCode UNDEFINED_LINT =
261261
AnalysisOptionsWarningCode(
262-
'UNDEFINED_LINT',
263-
"'{0}' is not a recognized lint rule.",
264-
correctionMessage: "Try using the name of a recognized lint rule.",
265-
);
262+
'UNDEFINED_LINT',
263+
"'{0}' is not a recognized lint rule.",
264+
correctionMessage: "Try using the name of a recognized lint rule.",
265+
);
266266

267267
/// An error code indicating that an unrecognized error code is being used to
268268
/// specify an error filter.
@@ -271,9 +271,9 @@ class AnalysisOptionsWarningCode extends ErrorCode {
271271
/// 0: the unrecognized error code
272272
static const AnalysisOptionsWarningCode UNRECOGNIZED_ERROR_CODE =
273273
AnalysisOptionsWarningCode(
274-
'UNRECOGNIZED_ERROR_CODE',
275-
"'{0}' isn't a recognized error code.",
276-
);
274+
'UNRECOGNIZED_ERROR_CODE',
275+
"'{0}' isn't a recognized error code.",
276+
);
277277

278278
/// An error code indicating that a plugin is being configured with an
279279
/// unsupported option and legal options are provided.
@@ -283,9 +283,9 @@ class AnalysisOptionsWarningCode extends ErrorCode {
283283
/// 1: the unsupported option key
284284
static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITHOUT_VALUES =
285285
AnalysisOptionsWarningCode(
286-
'UNSUPPORTED_OPTION_WITHOUT_VALUES',
287-
"The option '{1}' isn't supported by '{0}'.",
288-
);
286+
'UNSUPPORTED_OPTION_WITHOUT_VALUES',
287+
"The option '{1}' isn't supported by '{0}'.",
288+
);
289289

290290
/// An error code indicating that a YAML section is being configured with an
291291
/// unsupported option where there is just one legal value.
@@ -294,8 +294,8 @@ class AnalysisOptionsWarningCode extends ErrorCode {
294294
/// 0: the section name
295295
/// 1: the unsupported option key
296296
/// 2: the legal value
297-
static const AnalysisOptionsWarningCode
298-
UNSUPPORTED_OPTION_WITH_LEGAL_VALUE = AnalysisOptionsWarningCode(
297+
static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUE =
298+
AnalysisOptionsWarningCode(
299299
'UNSUPPORTED_OPTION_WITH_LEGAL_VALUE',
300300
"The option '{1}' isn't supported by '{0}'. Try using the only supported "
301301
"option: '{2}'.",
@@ -310,10 +310,10 @@ class AnalysisOptionsWarningCode extends ErrorCode {
310310
/// 2: legal values
311311
static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES =
312312
AnalysisOptionsWarningCode(
313-
'UNSUPPORTED_OPTION_WITH_LEGAL_VALUES',
314-
"The option '{1}' isn't supported by '{0}'.",
315-
correctionMessage: "Try using one of the supported options: {2}.",
316-
);
313+
'UNSUPPORTED_OPTION_WITH_LEGAL_VALUES',
314+
"The option '{1}' isn't supported by '{0}'.",
315+
correctionMessage: "Try using one of the supported options: {2}.",
316+
);
317317

318318
/// An error code indicating that an option entry is being configured with an
319319
/// unsupported value.
@@ -324,10 +324,10 @@ class AnalysisOptionsWarningCode extends ErrorCode {
324324
/// 2: legal values
325325
static const AnalysisOptionsWarningCode UNSUPPORTED_VALUE =
326326
AnalysisOptionsWarningCode(
327-
'UNSUPPORTED_VALUE',
328-
"The value '{1}' isn't supported by '{0}'.",
329-
correctionMessage: "Try using one of the supported options: {2}.",
330-
);
327+
'UNSUPPORTED_VALUE',
328+
"The value '{1}' isn't supported by '{0}'.",
329+
correctionMessage: "Try using one of the supported options: {2}.",
330+
);
331331

332332
/// Initialize a newly created error code to have the given [name].
333333
const AnalysisOptionsWarningCode(
@@ -338,10 +338,10 @@ class AnalysisOptionsWarningCode extends ErrorCode {
338338
super.isUnresolvedIdentifier = false,
339339
String? uniqueName,
340340
}) : super(
341-
name: name,
342-
problemMessage: problemMessage,
343-
uniqueName: 'AnalysisOptionsWarningCode.${uniqueName ?? name}',
344-
);
341+
name: name,
342+
problemMessage: problemMessage,
343+
uniqueName: 'AnalysisOptionsWarningCode.${uniqueName ?? name}',
344+
);
345345

346346
@override
347347
ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;

pkg/analyzer/lib/src/dart/error/ffi_code.g.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ class FfiCode extends ErrorCode {
181181

182182
/// No parameters.
183183
static const FfiCode
184-
FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER = FfiCode(
184+
FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER =
185+
FfiCode(
185186
'FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER',
186187
"Only classes extending NativeFieldWrapperClass1 can be passed as Pointer.",
187188
correctionMessage: "Pass as Handle instead.",
@@ -202,7 +203,7 @@ class FfiCode extends ErrorCode {
202203
/// 0: the expected number of parameters
203204
/// 1: the actual number of parameters
204205
static const FfiCode
205-
FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER = FfiCode(
206+
FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER = FfiCode(
206207
'FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER',
207208
"Unexpected number of Native annotation parameters. Expected {0} but has "
208209
"{1}. Native instance method annotation must have receiver as first "
@@ -518,10 +519,10 @@ class FfiCode extends ErrorCode {
518519
super.isUnresolvedIdentifier = false,
519520
String? uniqueName,
520521
}) : super(
521-
name: name,
522-
problemMessage: problemMessage,
523-
uniqueName: 'FfiCode.${uniqueName ?? name}',
524-
);
522+
name: name,
523+
problemMessage: problemMessage,
524+
uniqueName: 'FfiCode.${uniqueName ?? name}',
525+
);
525526

526527
@override
527528
ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;

pkg/analyzer/lib/src/dart/error/hint_codes.g.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class HintCode extends ErrorCode {
6262
///
6363
/// This code is deprecated in favor of the
6464
/// 'deprecated_member_from_same_package' lint rule, and will be removed.
65-
static const HintCode
66-
DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE = HintCode(
65+
static const HintCode DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE =
66+
HintCode(
6767
'DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE',
6868
"'{0}' is deprecated and shouldn't be used. {1}",
6969
correctionMessage:
@@ -98,7 +98,10 @@ class HintCode extends ErrorCode {
9898
/// Reported when the macro uses `Builder.report()` with `Severity.info`.
9999
/// Parameters:
100100
/// 0: the message
101-
static const HintCode MACRO_INFO = HintCode('MACRO_INFO', "{0}");
101+
static const HintCode MACRO_INFO = HintCode(
102+
'MACRO_INFO',
103+
"{0}",
104+
);
102105

103106
/// Parameters:
104107
/// 0: the URI that is not necessary
@@ -120,10 +123,10 @@ class HintCode extends ErrorCode {
120123
super.isUnresolvedIdentifier = false,
121124
String? uniqueName,
122125
}) : super(
123-
name: name,
124-
problemMessage: problemMessage,
125-
uniqueName: 'HintCode.${uniqueName ?? name}',
126-
);
126+
name: name,
127+
problemMessage: problemMessage,
128+
uniqueName: 'HintCode.${uniqueName ?? name}',
129+
);
127130

128131
@override
129132
ErrorSeverity get errorSeverity => ErrorType.HINT.severity;

0 commit comments

Comments
 (0)