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.2.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.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ruffit-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 bdaa5516dcbc25576a3dae29ec5a3b4e55c776c8a9395cc8431f84b6cb504f16
MD5 1108807e7873299b98e67a9d25dd6b32
BLAKE2b-256 73524b0046b00d86a685a42f0d9d70935891579d85f53a98a6d19de3d8a0679f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ruffit-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e72c52e7e851e44bc16e29bea6c733b11a092224ee412a6e28a78ac115ee6563
MD5 a87505fa0122bf688be2642c2c9533cb
BLAKE2b-256 06d86bfccb02e0a89452904515ad79a7fb01e3963265e3c7d4d98ee6366c9aa1

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