Skip to content

allganize/ty-pre-commit

Repository files navigation

ty-pre-commit

Ty image image image Actions status

A pre-commit hook for Ty, an extremely fast Python type checker written in Rust.

Distributed as a standalone repository to enable installing Ty via prebuilt wheels from PyPI.

Warning: Ty is currently in preview and not ready for production use. Expect bugs and missing features.

Using Ty with pre-commit

To run Ty's type checker via pre-commit, add the following to your .pre-commit-config.yaml:

repos:
- repo: https://github.com/allganize/ty-pre-commit
  # Ty version.
  rev: v0.0.1a22a21a20
  hooks:
    # Run the type checker.
    - id: ty-check

To run Ty with additional arguments:

repos:
- repo: https://github.com/allganize/ty-pre-commit
  # Ty version.
  rev: v0.0.1a22a21a20
  hooks:
    # Run the type checker with verbose output.
    - id: ty-check
      args: [ --verbose, --output-format=full ]

To run only on specific file types:

repos:
- repo: https://github.com/allganize/ty-pre-commit
  # Ty version.
  rev: v0.0.1a22a21a20
  hooks:
    # Run the type checker.
    - id: ty-check
      types_or: [ python, pyi ]

Ty is a type checker and can be run alongside other tools like Black, isort, and Ruff for formatting and linting. Since Ty only performs type checking, it doesn't conflict with formatters and can be placed anywhere in your pre-commit hook chain.

License

ty-pre-commit is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ty-pre-commit by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages