Metadata-Version: 2.4
Name: ruffit
Version: 0.2.0
Summary: Monitor Python files and auto-run ruff, ty, and formatting checks on change. Fast, colorful, and easy CLI for code quality automation.
Author-email: Joseph Churchley <joseph.churchley@outlook.com>
License: # MIT License
        
        Copyright (c) 2025 Your Name
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich>=14.1.0
Requires-Dist: ruff>=0.12.9
Requires-Dist: ty>=0.0.1a18
Requires-Dist: typer>=0.16.1
Requires-Dist: watchdog>=6.0.0
Dynamic: license-file


# 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

```sh
pip install ruffit
```
Or, for local development:
```sh
pip install -e .
```

## Usage

Monitor all Python files in the project:
```sh
ruffit all
```

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

Enable autofix with ruff check:
```sh
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:
  ```sh
  pip install .[test]
  ```
- To run tests:
  ```sh
  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:
  ```powershell
  .venv\Scripts\Activate
  pip install ruffit
  ruffit
  ```
- If you still see the error, you can always run ruffit with:
  ```sh
  python -m ruffit
  ```

See the [Python documentation](https://docs.python.org/3/using/cmdline.html#environment-variables) for more on PATH and script locations.
