Skip to content

Commit

Permalink
Add missing_code_block_language_in_doc_comment lint to flutter/engi…
Browse files Browse the repository at this point in the history
…ne. (#51944)

Adds this Dartdoc-related lint to the flutter repository, in replacement
of the Dartdoc warning (`missingCodeBlockLanguage`) because it will be
deprecated and removed soon.

flutter/flutter already has this lint as well.

Lint Proposal: dart-lang/linter#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] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [X] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I signed the [CLA].
- [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
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[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
  • Loading branch information
kallentu authored Apr 8, 2024
1 parent 1847954 commit ceb5fa2
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ linter:
# - lines_longer_than_80_chars # not required by flutter style
- literal_only_boolean_expressions
# - matching_super_parameters # blocked on https://github.com/dart-lang/language/issues/2509
- missing_code_block_language_in_doc_comment
# - missing_whitespace_between_adjacent_strings # DIFFERENT FROM FLUTTER/FLUTTER (too many false positives)
- no_adjacent_strings_in_list
- no_default_cases
Expand Down
8 changes: 4 additions & 4 deletions lib/web_ui/lib/src/engine/color_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EngineColorFilter implements SceneImageFilter, ui.ColorFilter {
/// The matrix is in row-major order and the translation column is specified
/// in unnormalized, 0...255, space. For example, the identity matrix is:
///
/// ```
/// ```dart
/// const ColorMatrix identity = ColorFilter.matrix(<double>[
/// 1, 0, 0, 0, 0,
/// 0, 1, 0, 0, 0,
Expand All @@ -62,7 +62,7 @@ class EngineColorFilter implements SceneImageFilter, ui.ColorFilter {
///
/// An inversion color matrix:
///
/// ```
/// ```dart
/// const ColorFilter invert = ColorFilter.matrix(<double>[
/// -1, 0, 0, 0, 255,
/// 0, -1, 0, 0, 255,
Expand All @@ -73,7 +73,7 @@ class EngineColorFilter implements SceneImageFilter, ui.ColorFilter {
///
/// A sepia-toned color matrix (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#sepiaEquivalent)):
///
/// ```
/// ```dart
/// const ColorFilter sepia = ColorFilter.matrix(<double>[
/// 0.393, 0.769, 0.189, 0, 0,
/// 0.349, 0.686, 0.168, 0, 0,
Expand All @@ -84,7 +84,7 @@ class EngineColorFilter implements SceneImageFilter, ui.ColorFilter {
///
/// A greyscale color filter (values based on the [Filter Effects Spec](https://www.w3.org/TR/filter-effects-1/#grayscaleEquivalent)):
///
/// ```
/// ```dart
/// const ColorFilter greyscale = ColorFilter.matrix(<double>[
/// 0.2126, 0.7152, 0.0722, 0, 0,
/// 0.2126, 0.7152, 0.0722, 0, 0,
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class FlutterConfiguration {
///
/// Example:
///
/// ```
/// ```bash
/// flutter run \
/// -d chrome \
/// --web-renderer=canvaskit \
Expand Down Expand Up @@ -279,7 +279,7 @@ class FlutterConfiguration {
///
/// Example:
///
/// ```
/// ```bash
/// flutter run -d chrome --profile --dart-define=FLUTTER_WEB_DEBUG_SHOW_SEMANTICS=true
/// ```
bool get debugShowSemanticsNodes =>
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/profiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ typedef Action<R> = R Function();
///
/// Example:
///
/// ```
/// ```dart
/// final result = timeAction('expensive_operation', () {
/// ... expensive work ...
/// // ... expensive work ...
/// return someValue;
/// });
/// ```
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text/line_breaker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool _isSurrogatePair(int? codePoint) {
/// way from 0 to the string length. For example, here are the indices for the
/// string "foo bar":
///
/// ```
/// ```none
/// f o o b a r
/// ^ ^ ^ ^ ^ ^ ^ ^
/// 0 1 2 3 4 5 6 7
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ base class EngineFlutterView implements ui.FlutterView {
/// so it can push/shrink inside its `hostElement`. That way, a Flutter app
/// can change the layout of the container page.
///
/// ```
/// ```none
/// <p>Some HTML content...</p>
/// +--- (div) hostElement ------------------------------------+
/// | +--- rootElement ---------------------+ |
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/test/canvaskit/fragment_program_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ const String kJsonIPLR = r'''
}
''';

/// Geenrated by impellerc from
/// ```
/// Generated by impellerc from
/// ```cpp
/// #include <flutter/runtime_effect.glsl>
/// uniform vec2 uSize;
/// uniform float[10] uFloats;
Expand Down
4 changes: 2 additions & 2 deletions testing/scenario_app/bin/utils/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extension type const Options._(ArgResults _args) {
/// This is a shortcut that can be used to determine if the usage information
/// before parsing the remaining command line arguments. For example:
///
/// ```
/// ```dart
/// void main(List<String> args) {
/// if (Options.showUsage(args)) {
/// stdout.writeln(Options.usage);
Expand All @@ -88,7 +88,7 @@ extension type const Options._(ArgResults _args) {
/// be enabled before parsing the remaining command line arguments. For
/// example:
///
/// ```
/// ```dart
/// void main(List<String> args) {
/// final bool verbose = Options.showVerbose(args);
/// // ...
Expand Down
2 changes: 1 addition & 1 deletion testing/skia_gold_client/lib/skia_gold_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ interface class SkiaGoldClient {
/// [pixelColorDelta] defines maximum acceptable difference in RGB channels of
/// each pixel, such that:
///
/// ```
/// ```dart
/// bool isSame(Color image, Color golden, int pixelDeltaThreshold) {
/// return abs(image.r - golden.r)
/// + abs(image.g - golden.g)
Expand Down
4 changes: 2 additions & 2 deletions third_party/web_unicode/tool/unicode_sync_script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ Iterable<UnicodeRange> processRanges(

/// Example:
///
/// ```
/// ```none
/// 0x01C4..0x0293; ALetter
/// 0x0294..0x0294; ALetter
/// 0x0295..0x02AF; ALetter
/// ```
///
/// will get combined into:
///
/// ```
/// ```none
/// 0x01C4..0x02AF; ALetter
/// ```
List<UnicodeRange> combineAdjacentRanges(
Expand Down

0 comments on commit ceb5fa2

Please sign in to comment.