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.2.0.tar.gz (6.2 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.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ruffit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9a6e7837a6c33090172f1f680891d10073cbdd1b81a093d1e26d8eccc047154f
MD5 e80f9b98f42bd9905376566237b524cb
BLAKE2b-256 9e728933b363250499f284991e38e791b36e1282e48e31dc4af1763474c08031

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ruffit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 047f85d35c9743a7967aa2fddf4b9f990ea2656e3091d24fcabe9a5a1b6047ee
MD5 5a33bf8950a21ff64725ab030b232d0c
BLAKE2b-256 6d7f2b1e4ef7bddfc97dfcbaceeb9012edbc083726fcfaf3f83ca2a3f0872c3f

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