Skip to content

[mustache_template] Add example app and code excerpts#11316

Closed
saudademjj wants to merge 3 commits intoflutter:mainfrom
saudademjj:saudademjj/mustache-template-example-app
Closed

[mustache_template] Add example app and code excerpts#11316
saudademjj wants to merge 3 commits intoflutter:mainfrom
saudademjj:saudademjj/mustache-template-example-app

Conversation

@saudademjj
Copy link

@saudademjj saudademjj commented Mar 21, 2026

Adds a runnable example application and migrates all inline README code blocks to the <?code-excerpt?> system for CI validation.

  • Creates example/lib/main.dart demonstrating basic template rendering, nested paths, and lambdas
  • Creates example/lib/readme_excerpts.dart with #docregion markers for all 8 README code examples
  • Modernizes code style: var -> final/const, adds trailing commas, fixes syntax errors in original examples
  • Removes duplicate LambdaRenderBar example that was repeated in the original README
  • Removes mustache_template from temp_exclude_excerpt.yaml
  • Adds test/example_test.dart to validate the example app output and all README excerpt examples

Fixes flutter/flutter#183936

Validation:

  • dart analyze
  • dart test
  • dart run example/lib/main.dart
  • dart run script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages mustache_template --fail-on-change

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

Create a runnable example app and readme_excerpts.dart with #docregion
markers for all README code examples. Migrate inline README code blocks
to the <?code-excerpt?> system for CI validation.

Fixes flutter/flutter#183936
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a runnable example application for the mustache_template package and migrates all code examples from the README to the code-excerpt system for CI validation. This migration also includes modernizing the code style and fixing several errors in the original examples. My review focuses on ensuring consistency in the newly added code. I've suggested a couple of minor improvements in the new example app to align with modern Dart conventions and maintain consistency with the other changes in this PR.

@stuartmorgan-g
Copy link
Collaborator

Thanks for the contribution!

Version-exempt: changes only affect unpublished example app (publish_to: none)

The documented exemption is for "unpublished parts of example apps"; example/lib/main.dart is published on pub.dev.

README documentation

Which of the documented exemption reasons is this referring to?


print(output);
}
// #enddocregion ExampleUsage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially identical to main.dart, so we should just extract from that file instead of having a near-exact copy of it.

import '../example/lib/main.dart' as example_app;
import '../example/lib/readme_excerpts.dart' as readme_excerpts;

Future<List<String>> _capturePrints(FutureOr<void> Function() body) async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests would be a lot more straightforward if the excerpt wrapper functions simply returned a string instead of printing, since that's not part of the excerpting anyway. Adding zones makes things much more complicated.

@stuartmorgan-g
Copy link
Collaborator

You're right — the "Version-exempt" claim was incorrect.

Sycophancy is not helpful in a code review. Having an AI generate text to tell me that I understand policies that I wrote serves no constructive purpose, it just wastes everyone's time.

The 2.0.4 bump and CHANGELOG entry were already in place, so no actual change needed beyond fixing the description.

Please explain how this comment came to be posted.

I marking this PR as a draft pending some convincing explanation that this is not, as it very much appears to be, a violation of the policy you were explicitly pointed to less than a day ago.

@stuartmorgan-g stuartmorgan-g marked this pull request as draft March 21, 2026 19:23
@stuartmorgan-g
Copy link
Collaborator

stuartmorgan-g commented Mar 22, 2026

I'm not a native English speaker [...] so I used AI to help draft some of my review replies.

We have had many successful code reviews with people posting actual information in imperfect English. We have had zero with people posting fluent-sounding hallucinations, which is why we have a clear written policy banning it.

I should not have posted text i hadnt fully reviewed and rewritten myself [...] Ive re-read the AI contribution guidelines and I get the issue. I'll keep review replies direct and limited to stuff Ive personally verified going forward.

When I closed your previous PR I said that if you opened a new PR it would need to follow our AI contribution guidelines. When you opened this PR you explicitly indicated that you had read them and would follow them:

[x] I read the AI contribution guidelines and understand my responsibilities, or I am not using AI tools.

The time to start following the policy was when you agreed to do so the first time. Given that you have already chosen not to follow the policy after saying that you would, it seems clear that you don't understand that we take this seriously.

Especially since you are still doing it. This statement:

this is my first open source PR

is very clearly not correct.

As noted in the policy, we consider a pattern of violation to be a code of conduct violation, so I have administered a seven-day ban. If you plan to continue with this PR after that, please use that time to re-read the Code of Conduct, and the section of the AI contribution guidelines that explains why the guidelines exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mustache_template] No example app

2 participants