Metadata-Version: 2.4
Name: autofmt
Version: 0.1.1
Summary: Watchdog-based Python auto-formatter using Ruff and Black
Project-URL: Homepage, https://github.com/shaileshpandit141/autofmt
Project-URL: Repository, https://github.com/shaileshpandit141/autofmt
Project-URL: Issues, https://github.com/shaileshpandit141/autofmt/issues
Author-email: shaileshpandit141 <shaileshpandit141@gmail.com>
License: # MIT License
        
        Copyright (c) 2025 Shailesh Pandit
        
        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.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Utilities
Requires-Python: >=3.13
Requires-Dist: black>=25.1.0
Requires-Dist: rich>=14.1.0
Requires-Dist: ruff>=0.12.5
Requires-Dist: watchdog>=6.0.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# 🧼 autofmt

A lightweight, extensible, and colorful CLI tool for automatically formatting Python files using **Black** and **Ruff**, triggered by real-time file changes via **Watchdog**. Ideal for developers who want instant feedback, enforced formatting, and smoother workflows.

## 🚀 Features

* 🎯 Watches `.py` files in real time
* 🧹 Auto-formats using **Black** and **Ruff**
* 🧠 Runs Python syntax checks before formatting
* 🎨 Beautiful, structured logs with **Rich**
* 🔧 Supports user-defined config via `pyproject.toml`
* 📂 Designed for easy integration and extension

## 📦 Installation

Install using your preferred Python package manager:

### With `uv`

```bash
uv add autofmt
````

### With `pip`

```bash
pip install autofmt
```

## ⚙️ Configuration

Configure behavior directly in your `pyproject.toml` under `[tool.autofmt]`:

```toml
[tool.autofmt]
watch_path = "."                 # Directory to watch
formatters = ["black", "ruff"]   # Tools to use
cooldown_seconds = 1.0           # Cooldown between re-runstrue)
```

## 🧠 Usage

### Start the watcher

```bash
autofmt
```

It will:

1. Watch for changes in Python files.
2. Run syntax checks.
3. Auto-format using Ruff and Black.
4. Show you real-time logs and success/error messages.

## 📁 Example Output

```bash
starting autofmt watcher...
At: .

Detected change:
  src/autofmt/configurations/load_config.py

Ruff logs:
  src/autofmt/configurations/load_config.py
  All checks passed!

Formatted path:
  src/autofmt/configurations/load_config.py

Detected change:
  src/autofmt/configurations/load_config.py

Detected change:
  src/autofmt/configurations/load_config.py
^C
Stopping watcher...

```

## ❗ Requirements

* Python `>=3.13`
* OS Independent

---

## 🧪 Testing

Run tests using:

```bash
pytest
```

## 🛠️ Planned Features

* 🧩 Plugin support for more formatters
* 🧪 Test coverage reporting
* 📊 Per-file formatter summary
* ⌨️ Command-line flags (e.g., `--path`)
* 📁 Multi-folder watch support

## 🤝 Contributing

Contributions are welcome! Please:

1. Fork the repo
2. Create a branch
3. Submit a PR
4. Discuss features in the [issues](https://github.com/shaileshpandit141/autofmt/issues)

## 📄 License

MIT License. See the [LICENSE](LICENSE) file for full details.

## 👤 Author

For questions or assistance, contact **Shailesh** at [shaileshpandit141@gmail.com](mailto:shaileshpandit141@gmail.com)
