C2: export KOTLIN_BANNER and merged_file_path - #13
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes two previously-internal but pub items (KOTLIN_BANNER and merged_file_path) at the crate root so downstream consumers can reference the default banner and predict output paths without writing files.
Changes:
- Re-export
file::merged_file_pathandrender::KOTLIN_BANNERfromsrc/lib.rs. - Expand public-facing doc comments for
KOTLIN_BANNERandmerged_file_path. - Update tests to use the public crate-root paths and add a compile-guard test ensuring both remain exported.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib.rs | Re-exports merged_file_path and KOTLIN_BANNER from the crate root. |
| src/file.rs | Expands docs for merged_file_path now that it’s part of the public API. |
| src/render.rs | Expands docs for KOTLIN_BANNER now that it’s part of the public API. |
| src/tests.rs | Updates path helper calls to the public export and adds a test to prevent accidental un-exporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+18
| /// [`KtFile::banner`] overrides it per file, and `""` suppresses it entirely; | ||
| /// this constant is what an override falls back to, and what a consumer | ||
| /// prepending its own header should match against. |
This was referenced Aug 6, 2026
Both were marked `pub` but sit in private modules and were never re-exported, so they were reachable from inside the crate and from nowhere else. An audit of every `pub` item confirms these are the only two. They are worth having: KOTLIN_BANNER is what `KtFile::banner` falls back to, so a consumer prepending its own header has nothing to match against without it; merged_file_path is how write_files lays out its output, and predicting those paths without writing anything is a reasonable thing to want. The new test is written against the public paths, so it stops compiling if either is un-exported again.
milyin
force-pushed
the
step/c2-export-stranded
branch
from
August 6, 2026 11:40
069bd24 to
3c1dfab
Compare
milyin
force-pushed
the
step/c1-ident-utilities
branch
from
August 6, 2026 11:40
a84bed6 to
00a7282
Compare
milyin
changed the base branch from
step/c1-ident-utilities
to
docs/validation-umbrella
August 6, 2026 11:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step C2 of #6. Stacked on #12. Small one.
Both items were marked
pubbut sit in private modules and were neverre-exported — reachable from inside the crate and from nowhere else. An audit of
every
pub fn/pub const/pub struct/pub enumacross all seven modulesconfirms these are the only two.
They are worth having rather than demoting:
KOTLIN_BANNERis whatKtFile::bannerfalls back to. A consumer thatwants to prepend its own header, or check whether a file on disk is one of
ours, has nothing to compare against without it.
merged_file_pathis howwrite_filesdecides its layout(
io.zenoh.jni.bytes→io/zenoh/jni/bytes.kt). Predicting those pathswithout writing anything — to report them, or post-process them — is a
reasonable thing to want.
Doc comments expanded for both, since they are now API rather than internals.
The new test is deliberately written against the public paths
(
kotlin_codegen::KOTLIN_BANNER,kotlin_codegen::merged_file_path) ratherthan the module-internal ones, so it stops compiling if either is un-exported
again.