Metadata-Version: 2.4
Name: swarmauri_tests_loc_tersity
Version: 0.11.0.dev1
Summary: Pytest plugin enforcing line count limits
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: swarmauri_tests_loc_tersity,swarmauri,experimental
Author: Jacob Stewart
Author-email: jacob@swarmauri.com
Requires-Python: >=3.10,<3.15
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.14
Description-Content-Type: text/markdown

![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)

<p align="center">
    <a href="https://pepy.tech/project/swarmauri_tests_loc_tersity/">
        <img src="https://static.pepy.tech/badge/swarmauri_tests_loc_tersity/month" alt="PyPI - Downloads"/></a>
    <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_tests_loc_tersity/">
        <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_tests_loc_tersity.svg"/></a>
    <a href="https://pypi.org/project/swarmauri_tests_loc_tersity/">
        <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
    <a href="https://pypi.org/project/swarmauri_tests_loc_tersity/">
        <img src="https://img.shields.io/pypi/l/swarmauri_tests_loc_tersity" alt="PyPI - License"/></a>
    <a href="https://pypi.org/project/swarmauri_tests_loc_tersity/">
        <img src="https://img.shields.io/pypi/v/swarmauri_tests_loc_tersity?label=swarmauri_tests_loc_tersity&color=green" alt="PyPI - swarmauri_tests_loc_tersity"/></a>
    <a href="https://discord.gg/N4UpBuQv8T">
        <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>

## Overview

`swarmauri_tests_loc_tersity` is a [pytest](https://docs.pytest.org/) plugin that
keeps modules small and readable. It scans a package for Python files and
asserts that each file stays under a configurable line-of-code (LOC) limit
(docstrings included). The default limit is **400 lines**.

The plugin runs in *parameterized* mode by default, turning every file into an
individual test case. You can also switch to an *aggregate* mode that reports
all failures as a single test.

## Installation

```bash
pip install swarmauri_tests_loc_tersity
```

`pytest` automatically discovers the plugin once it is installed.

## Usage

### Parameterized (default)

Run `pytest` normally to create one LOC check per Python file:

```bash
pytest
```

Example failure:

```
E   AssertionError: pkg/example.py has 425 lines (>400)
```

### Aggregate

Use the `--loc-mode=aggregate` flag to consolidate checks into one test that
lists every file exceeding the threshold:

```bash
pytest --loc-mode=aggregate
```

Example output:

```
E   pkg/example.py has 425 lines (>400)
E   pkg/other.py has 410 lines (>400)
```

### Customizing

* `--loc-root PATH` ? directory to scan (defaults to the package root)
* `--loc-max-lines N` ? change the maximum line count

```bash
pytest --loc-root=src --loc-max-lines=200
```

## License

Licensed under the [Apache 2.0 License](LICENSE).




