chore(pre-commit): add ty pre-commit repo#57
Merged
sahiljhawar merged 4 commits intoGFZ:mainfrom Feb 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates the ty type checker into the project’s developer workflow (pre-commit) and updates various inline ty suppression comments across the IO modules to match ty’s current rule naming.
Changes:
- Update
.pre-commit-config.yamlto use newerruff-pre-commitand add thety-pre-commitrepository. - Add
tyandrufftorequirements.txt. - Adjust multiple inline
# ty: ignore[...]directives across the codebase (rule renames / new suppressions).
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
swvo/io/utils.py |
Updates a ty ignore rule for pandas index timestamp conversion. |
swvo/io/solar_wind/swift.py |
Adds/updates ty ignores for Path(...) and DataFrame index typing. |
swvo/io/solar_wind/dscovr.py |
Updates ty ignore rules for index/date attribute access and Path(...). |
swvo/io/solar_wind/ace.py |
Updates ty ignore rules for index/date attribute access and Path(...). |
swvo/io/omni/omni_low_res.py |
Adds ty ignore for Path(...) constructor argument typing. |
swvo/io/omni/omni_high_res.py |
Adds ty ignores for Path(...) and DataFrame construction typing. |
swvo/io/kp/swpc.py |
Updates ty ignore rules for regex match .group() and DataFrame index typing. |
swvo/io/kp/omni.py |
Updates ty ignore rule for DatetimeIndex.hour access. |
swvo/io/kp/niemegk.py |
Adds ty ignore for Path(...) constructor argument typing. |
swvo/io/kp/ensemble.py |
Adds ty ignore for Path(...) constructor argument typing. |
swvo/io/hp/gfz.py |
Adds ty ignore for Path(...) and removes an unnecessary ignore in exception handling. |
swvo/io/hp/ensemble.py |
Adds ty ignore for Path(...) and removes ignores around numeric comparisons. |
swvo/io/f10_7/swpc.py |
Adjusts ty ignores around pandas datetime/CSV parsing. |
swvo/io/f10_7/omni.py |
Updates ty ignore rule for DatetimeIndex.hour access. |
swvo/io/dst/wdc.py |
Adds ty ignore for float(...) argument typing during parsing. |
swvo/io/RBMDataSet/scripts/create_RBSP_line_data.py |
Moves a ty ignore to the expression triggering the typing issue. |
requirements.txt |
Adds ty and ruff dependencies. |
.pre-commit-config.yaml |
Bumps ruff hook revision and adds ty pre-commit hook. |
Comments suppressed due to low confidence (1)
.pre-commit-config.yaml:24
- The
ty-pre-commithook is configured withlanguage: systemand a customentry, which makes therepo/revpin effectively irrelevant and requires contributors/CI to havetyinstalled globally. If the intent is to use the pinned pre-commit hook, drop thelanguage: systemoverride (and usually the customentry) so pre-commit can manage the environment/version forty-check.
- repo: https://github.com/allganize/ty-pre-commit
rev: v0.0.17
hooks:
- id: ty-check
name: Type check
entry: ty check .
language: system
types: [python]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.