Skip to content

Commit

Permalink
Added missing code block language in docs (#147481)
Browse files Browse the repository at this point in the history
- added language for all code blocks
- replaced `bash` or `shell` with `sh` for consistency.
- added `sh` and `console` in the GitHub template link generator.
- updated test for GitHub template.
  • Loading branch information
kishan-dhankecha committed May 1, 2024
1 parent cb2197e commit 2867ac7
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions dev/benchmarks/complex_layout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To run the scrolling benchmark on a device:

```
```sh
flutter drive --profile test_driver/scroll_perf.dart
```

Expand All @@ -17,7 +17,7 @@ More detailed logs should be in `build/complex_layout_scroll_perf.timeline.json`

To measure startup time on a device:

```
```sh
flutter run --profile --trace-startup
```

Expand Down
12 changes: 6 additions & 6 deletions dev/benchmarks/macrobenchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Performance benchmarks use either flutter drive or the web benchmark harness.

To run the cull opacity benchmark on a device:

```
```sh
flutter drive --profile -t test_driver/run_app.dart --driver test_driver/cull_opacity_perf_test.dart
```

Expand All @@ -20,7 +20,7 @@ More detailed logs should be in `build/cull_opacity_perf.timeline.json`.

To run the cubic-bezier benchmark on a device:

```
```sh
flutter drive --profile -t test_driver/run_app.dart --driver test_driver/cubic_bezier_perf_test.dart
```

Expand All @@ -33,7 +33,7 @@ More detailed logs should be in `build/cubic_bezier_perf.timeline.json`.
To run the backdrop filter benchmark on a device:
To run a mobile benchmark on a device:

```bash
```sh
flutter drive --profile -t test_driver/run_app.dart --driver test_driver/[test_name]_test.dart
```

Expand Down Expand Up @@ -69,7 +69,7 @@ host machine. The following tests are E2E:

These tests should be run by:

```bash
```sh
flutter drive --profile -t test/[test_name]_e2e.dart --driver test_driver/e2e_test.dart
```

Expand Down Expand Up @@ -118,7 +118,7 @@ and the profile contains unobfuscated names.

Example:

```
```sh
cd dev/benchmarks/macrobenchmarks

# Runs in profile mode using the HTML renderer
Expand All @@ -130,7 +130,7 @@ flutter run --web-renderer=canvaskit --profile -d web-server lib/web_benchmarks.

You can also run all benchmarks exactly as the devicelab runs them:

```
```sh
cd dev/devicelab

# Runs using the HTML renderer
Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/microbenchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To run these benchmarks on a device, first run `flutter logs' in one
window to see the device logs, then, in a different window, run any of
these:

```
```sh
flutter run --release lib/gestures/velocity_tracker_bench.dart
flutter run --release lib/gestures/gesture_detector_bench.dart
flutter run --release lib/stocks/animation_bench.dart
Expand Down
4 changes: 2 additions & 2 deletions dev/benchmarks/platform_views_layout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To run the scrolling benchmark on a device:

```
```sh
flutter drive --profile test_driver/scroll_perf.dart
```

Expand All @@ -17,7 +17,7 @@ More detailed logs should be in `build/platform_views_scroll_perf.timeline.json`

To measure startup time on a device:

```
```sh
flutter run --profile --trace-startup
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To run the scrolling benchmark on a device:

```
```sh
flutter drive --profile test_driver/scroll_perf.dart
```

Expand All @@ -17,7 +17,7 @@ More detailed logs should be in `build/platform_views_scroll_perf_hybrid_composi

To measure startup time on a device:

```
```sh
flutter run --profile --trace-startup
```

Expand Down
8 changes: 4 additions & 4 deletions dev/bots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ For example To remove a published package corresponding to the git hash
`d444a455de87a2e40b7f576dc12ffd9ab82fd491`, first do a dry run of the script to
see what it will do:

```
$ dart ./unpublish_package.dart --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
```sh
dart ./unpublish_package.dart --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
```

And once you've verified the output of the dry run to be sure it is what you
want to do, run:

```
$ dart ./unpublish_package.dart --confirm --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
```sh
dart ./unpublish_package.dart --confirm --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
```

and it will perform the actions. You will of course need to have access
Expand Down
2 changes: 1 addition & 1 deletion dev/conductor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ All available commands can be seen via:

Releases are initialized with the `start` sub-command, like:

```
```sh
conductor start \
--candidate-branch=flutter-2.2-candidate.10 \
--release-channel=beta \
Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Intended for use with devicelab tests.
If you want to run a driver test locally, to debug a problem with a test, you
can use this command from the appropriate subdirectory:

```shell
```sh
flutter drive -t <test> --driver <driver>
```

Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/android_custom_host_app/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Android custom host app

Android host app for a Flutter module created using
```
```sh
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Android host app

Android host app for a Flutter module created using
```
```sh
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/external_textures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ subtle translation issues.

To run the test cases locally, use `flutter drive`[^2]:

```shell
```sh
flutter drive lib/frame_rate_main.dart --driver test_driver/frame_rate_test.dart
```

Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/ios_host_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Used by the `module_test_ios.dart` device lab test.

iOS host app for a Flutter module created using
```
```sh
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Android host app

Android host app for a Flutter module created using
```
```sh
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/web_e2e_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chrome://version.

Start `chromedriver` using the following command:

```
```sh
chromedriver --port=4444
```

Expand All @@ -18,7 +18,7 @@ mode you'd like to run the test in.

Here's an example of running an integration test:

```
```sh
flutter drive --target=test_driver/text_editing_integration.dart \
-d web-server \
--browser-name=chrome \
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/gen_defaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Script that generates component theme data defaults based on token data.

## Usage
Run this program from the root of the git repository:
```
```sh
dart dev/tools/gen_defaults/bin/gen_defaults.dart [-v]
```

Expand Down
4 changes: 2 additions & 2 deletions dev/tools/gen_keycodes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ output files can be generated without the Internet.

The tool can be run based on the existing database. To do this, run:

```bash
```sh
/PATH/TO/ROOT/bin/gen_keycodes
```

The tool can also be run by rebuilding the database by drawing online information
anew before generating the files. To do this, run:

```bash
```sh
/PATH/TO/ROOT/bin/gen_keycodes --collect
```

Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## To run the Hello World demo:
```
```sh
flutter run
```
## To run the Hello World demo showing Arabic:
```
```sh
flutter run lib/arabic.dart
```
2 changes: 1 addition & 1 deletion examples/layers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Flutter's layered architecture.
To run each example, specify the demo file on the `flutter run`
command line, for example:

```
```sh
flutter run raw/spinning_square.dart
flutter run rendering/spinning_square.dart
flutter run widgets/spinning_square.dart
Expand Down
2 changes: 1 addition & 1 deletion examples/platform_view/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ full-screen Flutter view along with passing data back and forth between the two.
On iOS, we use a CocoaPods dependency to add a Material Design button, and so
`pod install` needs to be invoked in the `ios/` folder before `flutter run`:

```
```sh
pushd ios/ ; pod install ; popd
flutter run
```
2 changes: 1 addition & 1 deletion packages/flutter/test_private/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private interface can be accessed by the test.

The tests are run like so:

```shell
```sh
dart run bin/test_private.dart
```

Expand Down
12 changes: 6 additions & 6 deletions packages/flutter_tools/doc/daemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The `flutter` command-line tool supports a daemon server mode for use by IDEs and other tools.

```
```sh
flutter daemon
```

Expand All @@ -16,13 +16,13 @@ A set of `flutter daemon` commands/events are also exposed via `flutter run --ma

The daemon speaks [JSON-RPC](http://json-rpc.org/) to clients. It uses stdin and stdout as the transport protocol. To send a command to the server, create your command as a JSON-RPC message, encode it to JSON, surround the encoded text with square brackets, and write it as one line of text to the stdin of the process:

```
```json
[{"method":"daemon.version","id":0}]
```

The response will come back as a single line from stdout:

```
```json
[{"id":0,"result":"0.1.0"}]
```

Expand All @@ -34,17 +34,17 @@ Each command should have a `method` field. This is in the form '`domain.command`

Any params for that command should be passed in through a `params` field. Here's an example request/response for the `device.getDevices` method:

```
```json
[{"method":"device.getDevices","id":2}]
```

```
```json
[{"id":2,"result":[{"id":"702ABC1F-5EA5-4F83-84AB-6380CA91D39A","name":"iPhone 6","platform":"ios_x64","available":true}]}]
```

Events that come from the server will have an `event` field containing the type of event, along with a `params` field.

```
```json
[{"event":"device.added","params":{"id":"1DD6786B-37D4-4355-AA15-B818A87A18B4","name":"iPhone XS Max","platform":"ios","emulator":true,"ephemeral":false,"platformType":"ios","category":"mobile"}}]
```

Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/debug_adapters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Some custom requests are available for clients to call. Below are the Flutter-sp

`hotReload` injects updated source code files into the running VM and then rebuilds the widget tree. An optional `reason` can be provided and should usually be `"manual"` or `"save"` to indicate what how the reload was triggered (for example by the user clicking a button, versus a hot-reload-on-save feature).

```
```json
{
"reason": "manual"
}
Expand All @@ -63,7 +63,7 @@ Some custom requests are available for clients to call. Below are the Flutter-sp

`hotRestart` updates the code on the device and performs a full restart (which does not preserve state). An optional `reason` can be provided and should usually be `"manual"` or `"save"` to indicate what how the reload was triggered (for example by the user clicking a button, versus a hot-reload-on-save feature).

```
```json
{
"reason": "manual"
}
Expand All @@ -81,7 +81,7 @@ This event is emitted when the application has started up. Unlike `dart.debugger

When the value of a Flutter service extension changes, this event is emitted and includes the new value. Values are always encoded as strings, even if numeric/boolean.

```
```json
{
"type": "event",
"event": "flutter.serviceExtensionStateChanged",
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/reporting/github_template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class GitHubTemplateCreator {
final String title = '[tool_crash] $errorString';
final String body = '''
## Command
```
```sh
$command
```
Expand All @@ -96,10 +96,10 @@ $command
## Logs
$errorString
```
```console
${LineSplitter.split(stackTrace.toString()).take(25).join('\n')}
```
```
```console
$doctorText
```
Expand Down
Loading

0 comments on commit 2867ac7

Please sign in to comment.