Skip to content

Commit b308555

Browse files
authored
Enable dangling_library_doc_comments and library_annotations lints (#117365)
1 parent de35764 commit b308555

File tree

516 files changed

+554
-435
lines changed

Some content is hidden

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

516 files changed

+554
-435
lines changed

analysis_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ linter:
9595
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
9696
- control_flow_in_finally
9797
- curly_braces_in_flow_control_structures
98-
# - dangling_library_doc_comments # not yet tested
98+
- dangling_library_doc_comments
9999
- depend_on_referenced_packages
100100
- deprecated_consistency
101101
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
@@ -116,7 +116,7 @@ linter:
116116
- iterable_contains_unrelated_type
117117
# - join_return_with_assignment # not required by flutter style
118118
- leading_newlines_in_multiline_strings
119-
# - library_annotations # not yet tested
119+
- library_annotations
120120
- library_names
121121
- library_prefixes
122122
- library_private_types_in_public_api

dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,4 @@
166166
/// error (something about backticks)
167167
/// this must be the last error, since it aborts parsing of this file
168168
/// ```
169+
String? foo;

dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
/// ```dart
1212
/// print(x);
1313
/// ```
14+
String? bar;
1415

1516
/// error: empty dart block
1617
/// ```dart
1718
/// ```
19+
String? foo;

dev/bots/test/analyze-test-input/root/packages/foo/golden_doc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/// ```
3636
/// {@end-tool}
3737
///
38-
38+
String? foo;
3939
// Other comments
4040
// matchesGoldenFile('comment.png');
4141

dev/bots/test/analyze-test-input/root/packages/foo/golden_ignore.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// flutter_ignore_for_file: golden_tag (see analyze.dart)
77

88
@Tags(<String>['some-other-tag'])
9+
library;
910

1011
import 'package:test/test.dart';
1112

dev/bots/test/analyze-test-input/root/packages/foo/golden_missing_tag.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// The reduced test set tag is missing. This should fail analysis.
66
@Tags(<String>['some-other-tag'])
7+
library;
78

89
import 'package:test/test.dart';
910

dev/bots/test/analyze_snippet_code_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const List<String> expectedMainErrors = <String>[
2929
'dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart:161:7: (top-level declaration) (undefined_identifier)',
3030
'dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart:165: Found "```" in code but it did not match RegExp: pattern=^ */// *```dart\$ flags= so something is wrong. Line was: "/// ```"',
3131
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:9:12: (statement) (invalid_assignment)',
32-
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:17:4: Empty ```dart block in snippet code.',
32+
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:18:4: Empty ```dart block in snippet code.',
3333
];
3434

3535
const List<String> expectedUiErrors = <String>[

dev/bots/unpublish_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
65
/// This script removes published archives from the cloud storage and the
76
/// corresponding JSON metadata file that the website uses to determine what
87
/// releases are available.
98
///
109
/// If asked to remove a release that is currently the release on that channel,
1110
/// it will replace that release with the next most recent release on that
1211
/// channel.
12+
library;
1313

1414
import 'dart:async';
1515
import 'dart:convert';

dev/conductor/core/test/codesign_integration_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// This test clones the framework and downloads pre-built binaries; it sometimes
66
// times out with the default 5 minutes: https://github.com/flutter/flutter/issues/100937
77
@Timeout(Duration(minutes: 10))
8+
library;
89

910
import 'package:args/command_runner.dart';
1011
import 'package:conductor_core/src/codesign.dart' show CodesignCommand;

dev/devicelab/bin/tasks/flutter_gallery__back_button_memory.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
/// Measure application memory usage after pausing and resuming the app
6-
/// with the Android back button.
7-
85
import 'package:flutter_devicelab/framework/devices.dart';
96
import 'package:flutter_devicelab/framework/framework.dart';
107
import 'package:flutter_devicelab/framework/utils.dart';
@@ -13,6 +10,8 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
1310
const String packageName = 'io.flutter.demo.gallery';
1411
const String activityName = 'io.flutter.demo.gallery.MainActivity';
1512

13+
/// Measure application memory usage after pausing and resuming the app
14+
/// with the Android back button.
1615
class BackButtonMemoryTest extends MemoryTest {
1716
BackButtonMemoryTest() : super('${flutterDirectory.path}/dev/integration_tests/flutter_gallery', 'test_memory/back_button.dart', packageName);
1817

0 commit comments

Comments
 (0)