Metadata-Version: 2.4
Name: true-formatter
Version: 0.1.0
Summary: The uncompromising Python formatter.
Author: True Contributors
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# True — The Uncompromising Python Formatter

[![Python](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**True** is an opinionated Python source-code formatter inspired by [Black](https://github.com/psf/black).
It enforces a consistent style so you never have to think about formatting again.

---

## Features

- Normalises string quotes (`'hello'` → `"hello"`)
- Removes trailing whitespace from every line
- Enforces two blank lines before top-level `def` / `class`
- Fixes spacing around `=` and binary operators
- Guarantees a single trailing newline
- Pluggable rule system — extend or disable any rule
- Zero dependencies (pure stdlib)

---

## Installation

```bash
pip install true-formatter
```

Or from source:

```bash
git clone https://github.com/yourname/true-formatter
cd true-formatter
pip install -e .[dev]
```

---

## Quick start

### As a CLI tool

```bash
# Format a file in-place
true my_script.py

# Check without modifying
true --check my_script.py

# Show a unified diff
true --diff my_script.py

# Format an entire directory
true src/

# Read from stdin
echo "x=1" | true -
```

### As a library

```python
import true_formatter

code = "x=1\ny=  'hello'\n"
result = true_formatter.format_str(code, mode=true_formatter.Mode())
print(result)
# x = 1
# y = "hello"
```

---

## Documentation

| Document | Description |
|---|---|
| [API Reference](docs/api.md) | Full public API — `format_str`, `Mode`, `RuleSet`, exceptions |
| [CLI Reference](docs/cli.md) | All command-line flags and examples |
| [Architecture](docs/architecture.md) | How the formatter pipeline works internally |
| [Contributing](docs/contributing.md) | Writing rules, running tests, sending PRs |

---

## License

MIT © True Contributors
