Metadata-Version: 2.3
Name: chine
Version: 0.1.2
Summary: A Python linting tool
Author: Joe Rixon
Author-email: Joe Rixon <joerixon8@gmail.com>
Requires-Dist: click>=8.1.0
Requires-Dist: ruff>=0.8.0 ; extra == 'dev'
Requires-Dist: mypy>=1.13.0 ; extra == 'dev'
Requires-Dist: pytest>=9.0.0 ; extra == 'dev'
Requires-Python: >=3.10
Provides-Extra: dev
Description-Content-Type: text/markdown

# chine

Chine is a static architecture checker for Python. It parses your code with `ast`, reads declared
architecture roles, and reports dependency violations without importing or executing your modules.

## What chine checks

Declare a role at module level:

```python
__architecture_role__ = "use_case"
```

Supported roles:

- `use_case`
- `domain_policy` (and `domain`)
- `adapter`

Current rules:

- `ARCH001`: use case modules must not import adapter modules
- `ARCH002`: domain/domain_policy modules must not import adapter modules
- `ARCH003`: domain/domain_policy modules must not import use case modules

Modules without `__architecture_role__` are treated as untyped (`Any`) for architecture checks.

## Installation

Install from PyPI:

```bash
pip install chine
```

Or with pipx:

```bash
pipx install chine
```

## End-user usage

Show CLI help:

```bash
chine --help
```

Check the current directory:

```bash
chine check
```

Check a specific path:

```bash
chine check src/
```

Show version:

```bash
chine --version
```

When no violations are found, chine exits successfully. If violations are found, it prints each
`ARCH` rule violation with file and line number and exits with a non-zero status.

## Development

```bash
uv sync --all-extras
uv run ruff check src/
uv run mypy src/
uv run pytest
```

## License

See LICENSE for details.
