Metadata-Version: 2.4
Name: strict-kwargs
Version: 2026.5.16.post1
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Dist: check-wheel-contents==0.6.3 ; extra == 'release'
Provides-Extra: release
License-File: LICENSE
Summary: Enforce using keyword arguments where possible.
Keywords: lint,keyword-arguments,ty,mypy
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/adamtheturtle/strict-kwargs/blob/main/CHANGELOG.rst
Project-URL: Source, https://github.com/adamtheturtle/strict-kwargs

# strict-kwargs

Fast enforcement of **keyword arguments at call sites**, without mypy or ty plugins.

Companion to [mypy-strict-kwargs](https://github.com/adamtheturtle/mypy-strict-kwargs) for teams that type-check with [ty](https://docs.astral.sh/ty/) (or want a fast standalone linter).

## Example

```python
def add(a: int, b: int) -> int:
    return a + b

add(a=1, b=2)  # OK
add(1, 2)  # strict-kwargs error: too many positional arguments
```

## Install

From PyPI:

```bash
pip install strict-kwargs
# or
uv tool install strict-kwargs
```

From source:

```bash
cargo install --path .
# or
pip install .
```

## Usage

```bash
strict-kwargs .                 # check a directory
strict-kwargs src/foo.py        # check a file
strict-kwargs --project-root .  # explicit project root for config
```

With ty:

```bash
ty check
strict-kwargs .
```

Exit codes: `0` = clean, `1` = violations found, `2` = internal error.

## Configuration

In `pyproject.toml`:

```toml
[tool.strict_kwargs]
ignore_names = ["main.func", "builtins.str"]
debug = false
```

The same `ignore_names` entries as mypy-strict-kwargs work (fully-qualified names like `package.module.func`).

## Limitations

This tool uses static analysis (Ruff's Python parser), not a type checker. It resolves many calls within a project but will not catch every case mypy's plugin handles (dynamic callables, complex overloads, etc.).

## License

MIT

