Skip to content

Commit 0520f26

Browse files
stereotype441Commit Queue
authored andcommitted
[linter] Rename lint codes to camelCase.
This change was generated by the following process: - The script `pkg/analyzer/tool/messages/rename_error_constants.dart` was run. This generated the vast majority of the diffs. - Then all modified files were reformatted using `tools/sdk/dart-sdk/bin/dart/format`. - Finally, the script `pkg/linter/tool/generate_lints.dart` was run, to rebuild generated code. Change-Id: I6a6a69646df0819b34aa8a2fda66ec2bcdfe67c0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445112 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 6445304 commit 0520f26

File tree

258 files changed

+966
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+966
-1048
lines changed

pkg/analysis_server/lib/src/services/correction/dart/add_const.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class AddConst extends ResolvedCorrectionProducer {
184184
var diagnostics = [
185185
...unitResult.diagnostics.where(
186186
(error) =>
187-
error.diagnosticCode == LinterLintCode.prefer_const_constructors,
187+
error.diagnosticCode == LinterLintCode.preferConstConstructors,
188188
),
189189
];
190190
var ranges = diagnostics.map(range.diagnostic);

pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ class AddDiagnosticPropertyReference extends ResolvedCorrectionProducer {
323323
}
324324

325325
/// Returns a list of all the [Diagnostic]s of type
326-
/// [LinterLintCode.diagnostic_describe_all_properties] for the given
326+
/// [LinterLintCode.diagnosticDescribeAllProperties] for the given
327327
/// [declaration].
328328
List<Diagnostic> _getAllDiagnosticsInClass(ClassDeclaration declaration) {
329329
var propertyDiagnostics = <Diagnostic>[];
@@ -332,7 +332,7 @@ class AddDiagnosticPropertyReference extends ResolvedCorrectionProducer {
332332
for (var diagnostic in unitResult.diagnostics) {
333333
var diagnosticCode = diagnostic.diagnosticCode;
334334
if (diagnosticCode.type == DiagnosticType.LINT &&
335-
diagnosticCode == LinterLintCode.diagnostic_describe_all_properties &&
335+
diagnosticCode == LinterLintCode.diagnosticDescribeAllProperties &&
336336
diagnostic.offset > startOffset &&
337337
diagnostic.offset < endOffset) {
338338
propertyDiagnostics.add(diagnostic);

pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class RemoveComparison extends ResolvedCorrectionProducer {
5252
errorCode == WarningCode.unnecessaryNullComparisonAlwaysNullTrue ||
5353
errorCode == WarningCode.unnecessaryNullComparisonNeverNullTrue ||
5454
errorCode == WarningCode.unnecessaryTypeCheckTrue ||
55-
errorCode == LinterLintCode.avoid_null_checks_in_equality_operators;
55+
errorCode == LinterLintCode.avoidNullChecksInEqualityOperators;
5656
}
5757

5858
@override

pkg/analysis_server/lib/src/services/correction/dart/replace_with_decorated_box.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ReplaceWithDecoratedBox extends ResolvedCorrectionProducer {
119119
return unitResult.diagnostics.any((d) {
120120
var diagnosticCode = d.diagnosticCode;
121121
return diagnosticCode.type == DiagnosticType.LINT &&
122-
diagnosticCode == LinterLintCode.use_decorated_box &&
122+
diagnosticCode == LinterLintCode.useDecoratedBox &&
123123
d.offset == constructorName.offset &&
124124
d.length == constructorName.length;
125125
});

pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Lines changed: 180 additions & 198 deletions
Large diffs are not rendered by default.

pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ main() {
940940
a;
941941
}
942942
''',
943-
[error(LinterLintCode.omit_local_variable_types, 11, 3)],
943+
[error(LinterLintCode.omitLocalVariableTypes, 11, 3)],
944944
);
945945
}
946946

pkg/analyzer/test/src/ignore_comments/diagnostic_suppression_test.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,7 @@ int _x = 1;
172172
// ignore: type=wrong
173173
void f(arg1(int)) {} // AVOID_TYPES_AS_PARAMETER_NAMES
174174
''',
175-
[
176-
error(
177-
LinterLintCode.avoid_types_as_parameter_names_formal_parameter,
178-
34,
179-
3,
180-
),
181-
],
175+
[error(LinterLintCode.avoidTypesAsParameterNamesFormalParameter, 34, 3)],
182176
);
183177
}
184178

0 commit comments

Comments
 (0)