Skip to main content

Monitor Python files and auto-run ruff, ty, and formatting checks on change. Fast, colorful, and easy CLI for code quality automation.

Project description

ruffit

A modern Python CLI tool to monitor .py files and automatically run code quality checks and formatting on change.

Features

  • Watches for changes to Python files in any folder you specify
  • Debounces rapid file events to avoid duplicate triggers
  • On modification, automatically runs:
    • ruff format to auto-format code
    • ruff check to lint and check for code issues (with optional autofix)
    • ty check to check type annotations
  • Rich terminal output for clear, colorful feedback
  • Flexible CLI: monitor any folder or the whole project
  • Easy to extend and test (modular code, pytest support)

Installation

pip install ruffit

Or, for local development:

pip install -e .

Usage

Monitor all Python files in the project:

ruffit all

Monitor only a specific folder (e.g., tests):

ruffit tests

Enable autofix with ruff check:

ruffit . --autofix

If the folder does not exist, ruffit will give an error and exit.

CLI Options

  • folder (argument): Folder to monitor (default: current directory). Use all to monitor the whole project, or just leave it blank.
  • --autofix: Enable autofix with ruff check.

Development & Testing

  • Tests are in the tests/ folder and use pytest.
  • To install test dependencies:
    pip install .[test]
    
  • To run tests:
    pytest
    

Contributing

Pull requests and issues are welcome!

License

MIT

Troubleshooting: Command Not Found

If you see an error like:

'ruffit' is not recognized as the name of a cmdlet, function, script file, or operable program.

This usually means the Python Scripts directory is not in your PATH, or you are not in the correct virtual environment.

  • If you are using a virtual environment, make sure it is activated before installing and running ruffit:
    .venv\Scripts\Activate
    pip install ruffit
    ruffit
    
  • If you still see the error, you can always run ruffit with:
    python -m ruffit
    

See the Python documentation for more on PATH and script locations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruffit-0.1.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ruffit-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ruffit-0.1.3.tar.gz.

File metadata

  • Download URL: ruffit-0.1.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruffit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 55b503bb6405194e54d5831c559f20be231354fceccc6d4607fffb40dd0f2a0d
MD5 4000198fb5434eadc0ec7ba63d2648a4
BLAKE2b-256 fc7d6a0e2e387e31c0dc564356d0c220a48bf0e23bc4b37065ac28cc544424e7

See more details on using hashes here.

File details

Details for the file ruffit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ruffit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruffit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef1c25b92fd711f9d64d73b59955ebe5efdf99854068b169fc469e303684a757
MD5 dd3b9bc043886c9b5167306ae7341aa4
BLAKE2b-256 2bef463db71a037bcefec34a9c8d6c119472dcf9df518e4732ab02a275fc12c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page