Metadata-Version: 2.5
Name: busirocket-baseline-py
Version: 0.1.10
Summary: Structural linter and config scaffolder for Python: atomic files, placement, size caps, no inline SQL
Project-URL: Homepage, https://github.com/BusiRocket/baseline
Project-URL: Issues, https://github.com/BusiRocket/baseline/issues
Author: Cristian Deluxe
License: MIT License
        
        Copyright (c) BusiRocket
        
        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
Keywords: architecture,ast,code-quality,linter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Requires-Dist: click<9,>=8.1
Requires-Dist: tomlkit<1,>=0.13
Description-Content-Type: text/markdown

# baseline-py

Structural linter and config scaffolder for Python: atomic files, placement,
size caps, no inline SQL. Brings the same discipline as
`@busirocket/eslint-config` and `cargo-baseline` to Python projects.

- **Design spec:**
  [docs/superpowers/specs/2026-08-31-python-baseline-design.md](https://github.com/BusiRocket/baseline/blob/main/docs/superpowers/specs/2026-08-31-python-baseline-design.md).

## Install

```bash
uv add --dev busirocket-baseline-py
```

## Usage

```bash
baseline-py init [--check|--apply|--force]  # scaffold ruff, mypy, deptry,
                                            # pytest, coverage and CI config
baseline-py check [PATH...]                 # run the structural rules
baseline-py gate                            # run the whole quality chain
baseline-py baseline create|update|check    # track migration debt
```

`init` never overwrites: it merges into existing configuration, or reports a
conflict. `check` never writes. `gate` fails when a required tool is absent
rather than skipping it.

## Rules

| Code     | Rule                | Enforces                                                       |
| -------- | ------------------- | -------------------------------------------------------------- |
| `BPY000` | `parse-error`       | A file that fails to parse is a finding, never a silent skip.  |
| `BPY001` | `one-primary-unit`  | Exactly one primary declaration per ordinary module.           |
| `BPY002` | `file-matches-unit` | File name is the snake_case of its primary declaration.        |
| `BPY003` | `no-grab-bag-names` | No `utils`, `helpers`, `misc` or `common` in any path segment. |
| `BPY004` | `max-file-lines`    | Code-line cap per file; tests get their own, looser cap.       |
| `BPY005` | `barrel-only-init`  | `__init__.py` holds imports, `__all__` and nothing else.       |
| `BPY006` | `no-inline-sql`     | SQL lives in resource files, not in string literals.           |

## Exit codes

| Code | Meaning                                                         |
| ---- | --------------------------------------------------------------- |
| 0    | All blocking checks passed.                                     |
| 1    | Policy findings.                                                |
| 2    | Invalid usage or invalid configuration.                         |
| 3    | Infrastructure failure: a required tool is missing or unusable. |

## License

MIT
