From 972725332f4d76711b3c576d8a6b5261edc2df46 Mon Sep 17 00:00:00 2001 From: Kallen Tu Date: Tue, 2 Apr 2024 16:42:25 -0700 Subject: [PATCH] Add `none` language strings to code blocks. (#146154) Part 2 from https://github.com/flutter/flutter/pull/146085 In preparation to add the lint `missing_code_block_language_in_doc_comment`, added `none` info strings to a bunch of fenced code blocks that have miscellaneous text or output text. Related to issue: https://github.com/dart-lang/linter/issues/4904 ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes --- .../known_broken_documentation.dart | 2 +- dev/bots/test/analyze_snippet_code_test.dart | 2 +- dev/conductor/core/lib/src/git.dart | 2 +- dev/tools/gen_keycodes/lib/physical_key_data.dart | 2 +- dev/tools/localization/localizations_utils.dart | 4 ++-- packages/flutter_tools/lib/src/android/android_device.dart | 2 +- packages/flutter_tools/lib/src/asset.dart | 2 +- packages/flutter_tools/lib/src/base/utils.dart | 2 +- .../flutter_tools/lib/src/commands/update_packages.dart | 6 +++--- .../lib/src/localizations/localizations_utils.dart | 4 ++-- packages/flutter_tools/lib/src/macos/build_macos.dart | 2 +- packages/flutter_tools/test/src/common.dart | 2 +- .../lib/src/fuchsia_remote_connection.dart | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart b/dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart index 2704029efcb..d369b1a0788 100644 --- a/dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart +++ b/dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart @@ -162,7 +162,7 @@ /// } /// ``` /// -/// ``` +/// ```none /// error (something about backticks) /// this must be the last error, since it aborts parsing of this file /// ``` diff --git a/dev/bots/test/analyze_snippet_code_test.dart b/dev/bots/test/analyze_snippet_code_test.dart index 5cd85fa5216..900456c4421 100644 --- a/dev/bots/test/analyze_snippet_code_test.dart +++ b/dev/bots/test/analyze_snippet_code_test.dart @@ -25,7 +25,7 @@ const List expectedMainErrors = [ 'dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart:153:10: (stateful widget) (annotate_overrides)', 'dev/bots/test/analyze-snippet-code-test-input/known_broken_documentation.dart:153:10: (stateful widget) (must_call_super)', '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/known_broken_documentation.dart:165: Found "```" in code but it did not match RegExp: pattern=^ */// *```dart\$ flags= so something is wrong. Line was: "/// ```none"', '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:18:4: Empty ```dart block in snippet code.', ]; diff --git a/dev/conductor/core/lib/src/git.dart b/dev/conductor/core/lib/src/git.dart index 3a353a59ff9..baa78860ae4 100644 --- a/dev/conductor/core/lib/src/git.dart +++ b/dev/conductor/core/lib/src/git.dart @@ -93,7 +93,7 @@ enum GitExceptionType { /// /// Example output: /// - /// ``` + /// ```none /// To github.com:user/engine.git /// /// ! [rejected] HEAD -> cherrypicks-flutter-2.8-candidate.3 (non-fast-forward) diff --git a/dev/tools/gen_keycodes/lib/physical_key_data.dart b/dev/tools/gen_keycodes/lib/physical_key_data.dart index b71a7cba151..6f1a6cabf0c 100644 --- a/dev/tools/gen_keycodes/lib/physical_key_data.dart +++ b/dev/tools/gen_keycodes/lib/physical_key_data.dart @@ -80,7 +80,7 @@ class PhysicalKeyData { /// /// Lines in this file look like this (without the ///): /// - /// ``` + /// ```none /// key 100 ALT_RIGHT /// # key 101 "KEY_LINEFEED" /// key 477 F12 FUNCTION diff --git a/dev/tools/localization/localizations_utils.dart b/dev/tools/localization/localizations_utils.dart index bfe3cc9d380..6c3d2e19329 100644 --- a/dev/tools/localization/localizations_utils.dart +++ b/dev/tools/localization/localizations_utils.dart @@ -395,7 +395,7 @@ class $classNamePrefix$camelCaseName extends $superClass {'''; /// Return the input string as a Dart-parseable string. /// -/// ``` +/// ```none /// foo => 'foo' /// foo "bar" => 'foo "bar"' /// foo 'bar' => "foo 'bar'" @@ -407,7 +407,7 @@ class $classNamePrefix$camelCaseName extends $superClass {'''; /// in JSON files are escaped. For example, the backspace character (\b) /// has to be properly escaped by this function so that the generated /// Dart code correctly represents this character: -/// ``` +/// ```none /// foo\bar => 'foo\\bar' /// foo\nbar => 'foo\\nbar' /// foo\\nbar => 'foo\\\\nbar' diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 86fdaace702..68f98a66c5e 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -877,7 +877,7 @@ Map parseAdbDeviceProperties(String str) { /// /// Example output: /// -/// ``` +/// ```none /// Applications Memory Usage (in Kilobytes): /// Uptime: 441088659 Realtime: 521464097 /// diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index 5fa7e7d0e01..a6cbfff2120 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -853,7 +853,7 @@ class ManifestAssetBundle implements AssetBundle { /// - assets/bar /// /// This will return: - /// ``` + /// ```none /// { /// asset: packages/test_package/assets/foo: [ /// asset: packages/test_package/assets/foo, diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index c942b6813b2..5e69bb9a16e 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart @@ -210,7 +210,7 @@ const int kMinColumnWidth = 10; /// ``` /// /// yields: -/// ``` +/// ```none /// Usage: app main_command /// [arguments] /// ``` diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index b2a948f14ae..69767bb05ef 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -1195,7 +1195,7 @@ class PubspecHeader extends PubspecLine { /// /// The value of this field extracted from the following line is "version". /// - /// ``` + /// ```none /// version: 0.16.5 /// ``` final String? name; @@ -1207,7 +1207,7 @@ class PubspecHeader extends PubspecLine { /// /// The value of this field extracted from the following line is "0.16.5". /// - /// ``` + /// ```none /// version: 0.16.5 /// ``` final String? value; @@ -1565,7 +1565,7 @@ class PubDependencyTree { /// /// That output is of this form: /// - /// ``` + /// ```none /// package_name 0.0.0 /// /// dependencies: diff --git a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart index cfa09042359..0715cdd2f13 100644 --- a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart +++ b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart @@ -228,7 +228,7 @@ String describeLocale(String tag) { /// Return the input string as a Dart-parsable string. /// -/// ``` +/// ```none /// foo => 'foo' /// foo "bar" => 'foo "bar"' /// foo 'bar' => "foo 'bar'" @@ -240,7 +240,7 @@ String describeLocale(String tag) { /// in JSON files are escaped. For example, the backspace character (\b) /// has to be properly escaped by this function so that the generated /// Dart code correctly represents this character: -/// ``` +/// ```none /// foo\bar => 'foo\\bar' /// foo\nbar => 'foo\\nbar' /// foo\\nbar => 'foo\\\\nbar' diff --git a/packages/flutter_tools/lib/src/macos/build_macos.dart b/packages/flutter_tools/lib/src/macos/build_macos.dart index 88cfd375bff..c20607833a6 100644 --- a/packages/flutter_tools/lib/src/macos/build_macos.dart +++ b/packages/flutter_tools/lib/src/macos/build_macos.dart @@ -30,7 +30,7 @@ import 'migrations/remove_macos_framework_link_and_embedding_migration.dart'; /// Passing this regexp to trace moves the stdout output to stderr. /// /// Filter out xcodebuild logging unrelated to macOS builds: -/// ``` +/// ```none /// xcodebuild[2096:1927385] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore /// /// note: Using new build system diff --git a/packages/flutter_tools/test/src/common.dart b/packages/flutter_tools/test/src/common.dart index 949b6673ad1..22662908622 100644 --- a/packages/flutter_tools/test/src/common.dart +++ b/packages/flutter_tools/test/src/common.dart @@ -264,7 +264,7 @@ class _NoContext implements AppContext { /// /// Example use: /// -/// ``` +/// ```dart /// void main() { /// var handler = FileExceptionHandler(); /// var fs = MemoryFileSystem(opHandle: handler.opHandle); diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart index d71af214681..b3812fc726b 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart @@ -182,7 +182,7 @@ class FuchsiaRemoteConnection { /// is expected to contain the interface as well (in the event that it is /// link-local), like the following: /// - /// ``` + /// ```none /// fe80::1%eth0 /// ``` ///