Enable dangling_library_doc_comments and library_annotations lints (#117365)

This commit is contained in:
Michael Goderbauer
2022-12-20 16:03:21 -08:00
committed by GitHub
parent de357647be
commit b308555ed1
516 changed files with 554 additions and 435 deletions

View File

@@ -166,3 +166,4 @@
/// error (something about backticks)
/// this must be the last error, since it aborts parsing of this file
/// ```
String? foo;

View File

@@ -11,7 +11,9 @@
/// ```dart
/// print(x);
/// ```
String? bar;
/// error: empty dart block
/// ```dart
/// ```
String? foo;

View File

@@ -35,7 +35,7 @@
/// ```
/// {@end-tool}
///
String? foo;
// Other comments
// matchesGoldenFile('comment.png');

View File

@@ -6,6 +6,7 @@
// flutter_ignore_for_file: golden_tag (see analyze.dart)
@Tags(<String>['some-other-tag'])
library;
import 'package:test/test.dart';

View File

@@ -4,6 +4,7 @@
// The reduced test set tag is missing. This should fail analysis.
@Tags(<String>['some-other-tag'])
library;
import 'package:test/test.dart';

View File

@@ -29,7 +29,7 @@ const List<String> expectedMainErrors = <String>[
'dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart:161:7: (top-level declaration) (undefined_identifier)',
'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: "/// ```"',
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:9:12: (statement) (invalid_assignment)',
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:17:4: Empty ```dart block in snippet code.',
'dev/bots/test/analyze-snippet-code-test-input/short_but_still_broken.dart:18:4: Empty ```dart block in snippet code.',
];
const List<String> expectedUiErrors = <String>[

View File

@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// This script removes published archives from the cloud storage and the
/// corresponding JSON metadata file that the website uses to determine what
/// releases are available.
@@ -10,6 +9,7 @@
/// If asked to remove a release that is currently the release on that channel,
/// it will replace that release with the next most recent release on that
/// channel.
library;
import 'dart:async';
import 'dart:convert';

View File

@@ -5,6 +5,7 @@
// This test clones the framework and downloads pre-built binaries; it sometimes
// times out with the default 5 minutes: https://github.com/flutter/flutter/issues/100937
@Timeout(Duration(minutes: 10))
library;
import 'package:args/command_runner.dart';
import 'package:conductor_core/src/codesign.dart' show CodesignCommand;

View File

@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Measure application memory usage after pausing and resuming the app
/// with the Android back button.
import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart';
@@ -13,6 +10,8 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
const String packageName = 'io.flutter.demo.gallery';
const String activityName = 'io.flutter.demo.gallery.MainActivity';
/// Measure application memory usage after pausing and resuming the app
/// with the Android back button.
class BackButtonMemoryTest extends MemoryTest {
BackButtonMemoryTest() : super('${flutterDirectory.path}/dev/integration_tests/flutter_gallery', 'test_memory/back_button.dart', packageName);

View File

@@ -2,6 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
import '../localizations_utils.dart';
const String _kCommandName = 'gen_date_localizations.dart';
// Used to let _jsonToMap know what locale it's date symbols converting for.
// Date symbols for the Kannada locale ('kn') are handled specially because
// some of the strings contain characters that can crash Emacs on Linux.
// See packages/flutter_localizations/lib/src/l10n/README for more information.
String? currentLocale;
/// This program extracts localized date symbols and patterns from the intl
/// package for the subset of locales supported by the flutter_localizations
/// package.
@@ -25,23 +41,6 @@
/// ```
/// dart dev/tools/localization/bin/gen_date_localizations.dart --overwrite
/// ```
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
import '../localizations_utils.dart';
const String _kCommandName = 'gen_date_localizations.dart';
// Used to let _jsonToMap know what locale it's date symbols converting for.
// Date symbols for the Kannada locale ('kn') are handled specially because
// some of the strings contain characters that can crash Emacs on Linux.
// See packages/flutter_localizations/lib/src/l10n/README for more information.
String? currentLocale;
Future<void> main(List<String> rawArgs) async {
checkCwdIsRepoRoot(_kCommandName);

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Make `n` copies of flutter_gallery.
import 'dart:io';
import 'package:args/args.dart';
@@ -12,6 +10,7 @@ import 'package:path/path.dart' as path;
/// If no `copies` param is passed in, we scale the generated app up to 60k lines.
const int kTargetLineCount = 60 * 1024;
/// Make `n` copies of flutter_gallery.
void main(List<String> args) {
// If we're run from the `tools` dir, set the cwd to the repo root.
if (path.basename(Directory.current.path) == 'tools') {