Skip to content

Commit 9fd9f04

Browse files
authored
Add info strings to code blocks. (#146085)
In preparation to add the lint `missing_code_block_language_in_doc_comment`, added info strings to a bunch of fenced code blocks. 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]. <!-- Links --> [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
1 parent 5850651 commit 9fd9f04

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ abstract class Recorder {
164164
///
165165
/// Example:
166166
///
167-
/// ```
167+
/// ```dart
168168
/// class BenchForLoop extends RawRecorder {
169169
/// BenchForLoop() : super(name: benchmarkName);
170170
///
@@ -219,7 +219,7 @@ abstract class RawRecorder extends Recorder {
219219
///
220220
/// Example:
221221
///
222-
/// ```
222+
/// ```dart
223223
/// class BenchDrawCircle extends SceneBuilderRecorder {
224224
/// BenchDrawCircle() : super(name: benchmarkName);
225225
///
@@ -311,7 +311,7 @@ abstract class SceneBuilderRecorder extends Recorder {
311311
///
312312
/// Example:
313313
///
314-
/// ```
314+
/// ```dart
315315
/// class BenchListView extends WidgetRecorder {
316316
/// BenchListView() : super(name: benchmarkName);
317317
///

dev/benchmarks/test_apps/stocks/lib/i18n/stock_strings.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import 'stock_strings_es.dart';
2121
/// localizationDelegates list, and the locales they support in the app's
2222
/// supportedLocales list. For example:
2323
///
24-
/// ```
24+
/// ```dart
2525
/// import 'i18n/stock_strings.dart';
2626
///
2727
/// return MaterialApp(
@@ -36,7 +36,7 @@ import 'stock_strings_es.dart';
3636
/// Please make sure to update your pubspec.yaml to include the following
3737
/// packages:
3838
///
39-
/// ```
39+
/// ```yaml
4040
/// dependencies:
4141
/// # Internationalization support.
4242
/// flutter_localizations:

dev/devicelab/lib/framework/browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ class BlinkTraceEvent {
426426
///
427427
/// Sample event encoded as JSON (the data is bogus, this just shows the format):
428428
///
429-
/// ```
429+
/// ```json
430430
/// {
431431
/// "name": "myName",
432432
/// "cat": "category,list",

dev/tools/dartdoc_checker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const List<String> dartdocDirectiveCanaryFiles = <String>[
4141
/// sample code where the sequence is perfectly legal, e.g. for required named
4242
/// parameters of a method:
4343
///
44-
/// ```
44+
/// ```dart
4545
/// void foo({@required int bar});
4646
/// ```
4747
void checkForUnresolvedDirectives(Directory dartDocDir) {

dev/tools/localization/bin/gen_date_localizations.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ String? currentLocale;
3131
///
3232
/// The following outputs the generated Dart code to the console as a dry run:
3333
///
34-
/// ```
34+
/// ```bash
3535
/// dart dev/tools/localization/bin/gen_date_localizations.dart
3636
/// ```
3737
///
3838
/// If the data looks good, use the `--overwrite` option to overwrite the
3939
/// lib/src/l10n/date_localizations.dart file:
4040
///
41-
/// ```
41+
/// ```bash
4242
/// dart dev/tools/localization/bin/gen_date_localizations.dart --overwrite
4343
/// ```
4444
Future<void> main(List<String> rawArgs) async {

packages/flutter_tools/lib/src/base/async_guard.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import 'dart:async';
3131
/// Rationale:
3232
///
3333
/// Consider the following snippet:
34-
/// ```
34+
/// ```dart
3535
/// try {
3636
/// await foo();
3737
/// ...
@@ -55,7 +55,7 @@ import 'dart:async';
5555
/// [asyncGuard] is intended to wrap awaited expressions occurring in a `try`
5656
/// block. The behavior described above gives the behavior that users
5757
/// intuitively expect from `await`. Consider the snippet:
58-
/// ```
58+
/// ```dart
5959
/// try {
6060
/// await asyncGuard(() async {
6161
/// var c = Completer();

packages/flutter_tools/lib/src/commands/attach.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ import '../vmservice.dart';
4040
///
4141
/// With an application already running, a HotRunner can be attached to it
4242
/// with:
43-
/// ```
43+
/// ```bash
4444
/// $ flutter attach --debug-url http://127.0.0.1:12345/QqL7EFEDNG0=/
4545
/// ```
4646
///
4747
/// If `--disable-service-auth-codes` was provided to the application at startup
4848
/// time, a HotRunner can be attached with just a port:
49-
/// ```
49+
/// ```bash
5050
/// $ flutter attach --debug-port 12345
5151
/// ```
5252
///
5353
/// Alternatively, the attach command can start listening and scan for new
5454
/// programs that become active:
55-
/// ```
55+
/// ```bash
5656
/// $ flutter attach
5757
/// ```
5858
/// As soon as a new VM Service is detected the command attaches to it and

packages/flutter_tools/lib/src/localizations/gen_l10n.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ class LocalizationsGenerator {
692692
/// Whether to generate the Dart localization methods with named parameters.
693693
///
694694
/// If this sets to true, the generated Dart localization methods will be:
695-
/// ```
695+
/// ```dart
696696
/// String helloWorld({required String name});
697697
/// ```
698698
final bool useNamedParameters;

0 commit comments

Comments
 (0)