Skip to content

style(lint, android): format+ignore version file to avoid flaky lint exit#9101

Open
mikehardy wants to merge 1 commit into
mainfrom
deflake-java-format
Open

style(lint, android): format+ignore version file to avoid flaky lint exit#9101
mikehardy wants to merge 1 commit into
mainfrom
deflake-java-format

Conversation

@mikehardy

Copy link
Copy Markdown
Collaborator

Summary

  • Emit ReactNativeFirebaseVersion.java from genversion in google-java-format-compatible layout (no leading newline; blank line after package).
  • Exclude the gitignored generated version file from lint:android so --set-exit-if-changed cannot fail when tracked sources are already clean.

Motivation

lint:android could fail intermittently (~1 in 20–30 runs) with google-java-format exit 1 and an empty git diff. Investigation showed the gitignored generated ReactNativeFirebaseVersion.java was included in the formatter pass after prepare regenerated it with slightly non-compliant whitespace.

Test plan

  • node packages/app/scripts/genversion-android.js then google-java-format --set-exit-if-changed on the version file exits 0
  • 30× loop of regen + yarn lint:android passes
  • CI lint checks green

Checklist

  • I read the Contributor Guide and followed the process for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

@mikehardy mikehardy force-pushed the deflake-java-format branch from 8979aaa to 788acbd Compare July 11, 2026 18:24
@mikehardy mikehardy changed the title lint(android): format+ignore version file to avoid flaky lint exit style(lint, android): format+ignore version file to avoid flaky lint exit Jul 11, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the summary. You can try again by commenting /gemini summary.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.19%. Comparing base (1bad118) to head (788acbd).

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #9101       +/-   ##
=============================================
- Coverage     58.66%   46.19%   -12.47%     
+ Complexity     1617     1616        -1     
=============================================
  Files           503      503               
  Lines         39180    39184        +4     
  Branches       5807     5744       -63     
=============================================
- Hits          22981    18097     -4884     
- Misses        14800    19807     +5007     
+ Partials       1399     1280      -119     
Flag Coverage Δ
android-native 53.56% <ø> (-<0.01%) ⬇️
e2e-ts-android 49.98% <ø> (-0.02%) ⬇️
e2e-ts-ios 18.79% <ø> (-35.15%) ⬇️
e2e-ts-macos 41.48% <ø> (-<0.01%) ⬇️
ios-native 18.79% <ø> (-35.15%) ⬇️
jest 49.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant