Repository navigation
fix(codegen): normalize and validate CodeGenConfig::extern_paths in generate - #847
Open
dev-burnern wants to merge 1 commit into
Open
dev-burnern wants to merge 1 commit into
dev-burnern wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This branch has not been deployed
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.
Closes #703
Summary
generate_with_diagnostics(andgenerate) now normalize and validate every proto name inCodeGenConfig::extern_pathsvianormalize_extern_path_proto_name, matching the existingexclude_packagescheck right above it."my.common",".my.common."," my.common ") are normalized to canonical dotted form (".my.common") before buildingCodeGenContext, usingCow::Borrowedwhen every entry is already normalized so there is zero extra cloning forprotoc-gen-buffaandbuffa-buildcallers.".my..common","","my.123") returnCodeGenError::Otherwithnormalize_extern_path_proto_name's error message quoting the entry as given.CodeGenConfig::extern_pathsrustdoc to reflect thatgenerate/generate_with_diagnosticsnow normalize and validate entries (whileprotoc-gen-buffaandbuffa-buildkeep their upfront check beforeprotocruns)..changes/unreleased/fixed-20261122-175500.yamlchangelog fragment.Verification
cargo fmt --check— passedcargo test -p buffa-codegen --lib— 852 passed, 0 failed (including newgenerate_normalizes_extern_paths_for_direct_callersandgenerate_rejects_malformed_extern_paths_for_direct_callers)cargo clippy -p buffa-codegen --all-targets -- -D warnings— passedRUSTDOCFLAGS="-D warnings" cargo doc -p buffa-codegen --no-deps— passed