Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ty-pre-commit

Official pre-commit hook for ty type checker.

Usage

Add this to your .pre-commit-config.yaml:

repos:
- repo: https://github.com/JacobCoffee/ty-pre-commitrev: v0.0.1hooks:
- id: ty

Configuration

The hook respects your project's pyproject.toml configuration:

[tool.ty]
[tool.ty.environment]
extra-paths = ["src/"]
[tool.ty.src]
exclude = ["tests/**/*.py"]

Custom Arguments

Pass additional arguments:

- id: tyargs: ["check", "--strict"]

Requirements

  • Python 3.8+
  • ty type checker (installed automatically as dependency)

Alternative Git Hook Managers

While this hook works with pre-commit, you might also consider:

  • prek - Fast, pure Rust implementation with better performance
  • lefthook - Fast Git hooks manager written in Go

Both support the same .pre-commit-config.yaml format and are drop-in replacements with improved speed.

License

MIT

Author

Jacob Coffee (@JacobCoffee)

About

Pre-commit hook for ty. I recommend using Prek instead of pre-commit.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors