Pre commit additions - #5
Open
iwanicki92 wants to merge 8 commits into
Open
Conversation
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
- Ruff combines and extends capabilities of both of those tools, - add `ty` type checker hook - would likely work even better if the type hinting improved in the codebase, currently there are too many Any/Unknowns detected. Maybe consider using MonkeyType to generate stub files from types detected at runtime. Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
iwanicki92
force-pushed
the
pre-commit-additions
branch
from
July 31, 2026 17:51
6fc657f to
b57d963
Compare
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Pre-commit validates every changed model using new YAML schema. In case schema itself changes, additional pre-commit validates all models to make sure they still conform to the schema. Add `# $schema: ./schema/model_schema.yml` to every model. It is used by various IDE to give you hints or show errors if YAML doesn't conform to the schema. Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Add pre-commit that keeps Python model in sync with schema changes Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
Signed-off-by: iwanicki92 <iwanicki92@gmail.com>
iwanicki92
force-pushed
the
pre-commit-additions
branch
from
August 1, 2026 22:17
b5e55ab to
4f92bda
Compare
iwanicki92
marked this pull request as ready for review
August 11, 2026 20:30
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.
Most of changes are in
.lockfiles (uv/poetry), around 2.2kSome changes
pyproject.tomlconfig.tytype checker hookAnd probably biggest changes:
add YAML model schema with pre-commit validation - create YAML schema, based of Python schema that was already defined. Add
# $schema: ./schema/model_schema.ymlto every model, thanks to that your IDE of choice should hint you about possible fields and their values and also immediately show you if you made an mistake.While this schema is way more complicated than the minimalistic
voluptuousit offers much more in other ways. The same commit added pre-commit which validates models on each change and also validates every model in case schema changes. This is also expanded in next commitGenerate Python pydantic model from the YAML schema. Use
datamodel-code-generatorfor the conversion and wire it up into pre-commit, so it never is out of sync with schema. This is autogenerated Python file and shouldn't be modified manually.Migrate current
voluptuousconfig, which loads data into untyped dict to newly generated Python model. This allows much easier reasoning about what each value in the model is or can be and also increasestypre-commit usability with better type hint coverage (which previously was I thinkdict[Any, Any]for model data). Also much better hinting in your IDE of choice:What's left:
What's next: