Skip to content

Import types instead of writing them out in full, and make the check blocking - #260

Merged
parawanderer merged 3 commits into
mainfrom
ci/java-imports-blocking
Oct 15, 2026
Merged

parawanderer merged 3 commits into
mainfrom
ci/java-imports-blocking

Conversation

@parawanderer

Copy link
Copy Markdown
Owner

Follow-up to #256, now that the PRs it was waiting on are merged.

  • 1st commit: the output of python scripts/check_java_imports.py --fix over app/src. 280 names in 77 files are shortened and their imports added. Nothing else changed. Names that would clash with another type of the same name keep their long form.
  • 2nd commit: removes continue-on-error from the static-checks.yml step, and runs the check in .githooks/pre-commit whenever Java is staged. The hook scans the whole tree, because whether a long name is needed depends on the other classes in its package. CONTRIBUTING and AGENTS.md describe both.

Verified: a re-check after --fix reports nothing. The added imports include no android.R and no file imports two types with the same short name.

Not verified locally: compilation. No Android toolchain here; this PR's build and emulator run are what check that the shortened names still resolve.

🤖 Generated with Claude Code

parawanderer and others added 2 commits October 13, 2026 15:32
The output of python scripts/check_java_imports.py --fix: 280 names in 77 files, shortened, with their imports added. No other change. Long names that would clash with another type of the same name are left as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tree is clean after the --fix commit, so the static-checks step no longer continues on error. The pre-commit hook runs it whenever Java is staged, over the whole tree, because whether a long name is needed depends on the other classes in its package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GoogleMapProvider implements IMapProvider, which nests its own
CameraPosition. Inside the class body an inherited member type beats a
single-type import, so --fix shortened Google's CameraPosition into the
interface's and the build failed. The check now collects types nested
in the project's own supertypes, transitively, and treats them as a
clash. Supertypes outside the scanned sources are still invisible to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@parawanderer
parawanderer deployed to Android Build October 13, 2026 13:37 — with GitHub Actions Active
@parawanderer
parawanderer deployed to Android Build October 13, 2026 13:37 — with GitHub Actions Active
@parawanderer
parawanderer merged commit 29846fa into main Oct 15, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Android Build — 10c8e221 Deployed Oct 13, 2026 by parawanderer via Instrumented tests (emulator) #328
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