Sitelet https://github.com/flutter/flutter/pull/190012
Skip to content

Made linter more robust to non-utf8 files - #190012

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
gaaclarke:tidy-choke-non-utf8
Jul 28, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:masterfrom
gaaclarke:tidy-choke-non-utf8

Conversation

@gaaclarke

Copy link
Copy Markdown
Member

Fixing a problem a ran into locally.

Pre-launch Checklist

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

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

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.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 24, 2026
@gaaclarke
gaaclarke requested a review from b-luk July 24, 2026 21:38
@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Jul 24, 2026

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

Copy link
Copy Markdown
Contributor

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 updates the clang-tidy tool to use Utf8Decoder(allowMalformed: true) when reading files, preventing exceptions when encountering non-UTF-8 files, and adds a test to verify this behavior. The reviewer suggests creating a unique temporary directory in the test instead of using a static filename in the shared system temp directory to avoid potential race conditions or permission conflicts.

Comment thread engine/src/flutter/tools/clang_tidy/test/clang_tidy_test.dart
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
b-luk
b-luk previously approved these changes Jul 24, 2026
@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2026
@auto-submit

auto-submit Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/190012, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@gaaclarke

Copy link
Copy Markdown
Member Author

I'm not sure what's going on, the presubmit is failing with the following error, but there is no obvious type at, or around, that line.

Analyzing flutter...

   info - tools/clang_tidy/test/clang_tidy_test.dart:537:11 - Omit the type annotation on a local variable when the type is obvious. Try removing the type annotation. - omit_obvious_local_variable_types

1 issue found.

@b-luk

b-luk commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

I'm not sure what's going on, the presubmit is failing with the following error, but there is no obvious type at, or around, that line.

Analyzing flutter...

   info - tools/clang_tidy/test/clang_tidy_test.dart:537:11 - Omit the type annotation on a local variable when the type is obvious. Try removing the type annotation. - omit_obvious_local_variable_types

1 issue found.

It's complaining about final io.File tempFile = io.File(...). I don't know what the exact criteria for obvious is, but this meets that criteria according to the linter.

@gaaclarke

Copy link
Copy Markdown
Member Author

It's complaining about final io.File tempFile = io.File(...). I don't know what the exact criteria for obvious is, but this meets that criteria according to the linter.

Yea, I had a local change that fixed it that wasn't pushed, so i was pulling out my hair trying to figure out why it wasn't happy.

@gaaclarke
gaaclarke requested a review from b-luk July 27, 2026 20:53
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 30, 2026
…12318)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@0f02463...c83f80b

2026-07-29 srawlins@google.com Use super-parameter in two_dimensional_utils (flutter/flutter#189957)
2026-07-29 brunocorona.alcantar@gmail.com Scope SemanticsTester per test in scrollable_semantics_test (flutter/flutter#189800)
2026-07-29 engine-flutter-autoroll@skia.org Roll Skia from d78865e708ad to 70733f74d415 (2 revisions) (flutter/flutter#190168)
2026-07-28 chris@bracken.jp iOS: Fix use-after-free race during shell teardown (flutter/flutter#190132)
2026-07-28 engine-flutter-autoroll@skia.org Roll Skia from 62442d6cf0ec to d78865e708ad (30 revisions) (flutter/flutter#190152)
2026-07-28 30870216+gaaclarke@users.noreply.github.com Made linter more robust to non-utf8 files (flutter/flutter#190012)
2026-07-28 engine-flutter-autoroll@skia.org Roll Packages from 6969329 to 3e63635 (6 revisions) (flutter/flutter#190142)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants