Allow hand-polishing individual exceptions by overriding templates. Fix #37.#38
Merged
Conversation
c59fb2f to
a68f4eb
Compare
#37. Drop a file into `generate_patches/templates` parallel to an exception module from `fastly_compute/exceptions`, and you can add improved exception implementations there. Disable the generation of stock ones by passing their names in the `generated_exception()` call, e.g. `generated_exceptions(omit=["SomeException", "SomeOtherException"])`. * Move almost all templating into Jinja templates. * Break generated exception code into named chunks that can be omitted individually by a customizing template. * Slightly improve `BufferLen` exception as an example.
b3d77ee to
9daab77
Compare
This innately gives us diffs to look at, filling the role of tests. Also... * Make all but `patches.py` pass `ruff lint` and `ruff format`. (`ruff format` does complex line wrapping to `patches.py`.) * Add interface-level docstrings to packages' `__init__.py`s. `Interface` becomes a `DocsHaver` to support this.
Merged
posborne
approved these changes
Feb 18, 2026
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.
Drop a file into
generate_patches/templatesparallel to an exception module fromfastly_compute/exceptions, and you can add improved exception implementations there. Disable the generation of stock ones by passing their names in thegenerated_exception()call, e.g.generated_exceptions(omit=["SomeException", "SomeOtherException"]).BufferLenexception as an example.