-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[flutter_plugin_tools] Validate code blocks in readme-check #5436
[flutter_plugin_tools] Validate code blocks in readme-check #5436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kinda excited about this. Not thrilled about the submodule, I wish the code-excerpter thing was a more proper "dependency".
<?code-excerpt "main.dart (SomeSection)"?> | ||
```dart | ||
A B C | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what the output of the file will look like after running code-excerpt? Adding the code block below the code-excerpt tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you put it above a code block (which can be empty to start) and the script will fill it with the extracted code. You can take a look at the camera README for a real example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've seen it in the Flutter docs site, and it was not super evident how to update the .md
snippets (or that the snippets were linked to actual code somewhere else).
I think I ended up doing a find and replace first, then learning about a script being available somewhere, and eventually managing to run it a while later; here are David's Misadventures With Code-Excerpt As A Complete Noob:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully it's reasonably clear; feedback welcome!
I hear you; my last experience with submodules (which granted was a while ago) was decidedly not great. But since this is firewalled off to just this script, I'm hoping it'll be pretty painless. |
* c09ef582e [flutter_plugin_tools] Remove UWP (flutter/plugins#5432) * 3876f54bf [ci.yaml] Remove explicit caches (flutter/plugins#5434) * 0605d876d [webview_flutter_android] Updates `pigeon` version to support null safety (flutter/plugins#5395) * 4b687c9fa [video_player] Fix XCUITest based on the new tooltip accessibility label (flutter/plugins#5426) * e777e515b Roll Flutter from 1b58a59 to 4cea9af (147 revisions) (flutter/plugins#5437) * 656e8c443 Roll Flutter from 4cea9af to 5b71314 (4 revisions) (flutter/plugins#5441) * f689280bf [flutter_plugin_tools] Validate code blocks in readme-check (flutter/plugins#5436) * 9c41c6895 Roll Flutter from 5b71314 to 7a74222 (1 revision) (flutter/plugins#5442) * 160c714e7 Roll Flutter from 7a74222 to 2eed8cb (1 revision) (flutter/plugins#5443)
…#102824) * c09ef582e [flutter_plugin_tools] Remove UWP (flutter/plugins#5432) * 3876f54bf [ci.yaml] Remove explicit caches (flutter/plugins#5434) * 0605d876d [webview_flutter_android] Updates `pigeon` version to support null safety (flutter/plugins#5395) * 4b687c9fa [video_player] Fix XCUITest based on the new tooltip accessibility label (flutter/plugins#5426) * e777e515b Roll Flutter from 1b58a59 to 4cea9af (147 revisions) (flutter/plugins#5437) * 656e8c443 Roll Flutter from 4cea9af to 5b71314 (4 revisions) (flutter/plugins#5441) * f689280bf [flutter_plugin_tools] Validate code blocks in readme-check (flutter/plugins#5436) * 9c41c6895 Roll Flutter from 5b71314 to 7a74222 (1 revision) (flutter/plugins#5442) * 160c714e7 Roll Flutter from 7a74222 to 2eed8cb (1 revision) (flutter/plugins#5443)
Updates
readme-check
to:languages) code block use the
code-excerpt
.Adds CI to validate that all packages are using
code-excerpt
, with atemporary opt-out list for all of the packages with existing code blocks,
so that we can adopt it incrementally but prevent any new violations.
In order to land the language tag requirement, fixes a couple of blocks
that were missing the annotation.
No version change: The addition of a language block tag is too minor to be worth releasing.
No CHANGELOG change: The addition of a language block tag is too minor to be worth noting.
Part of flutter/flutter#102679
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.