Enforce using keyword arguments where possible.
Project description
strict-kwargs
Fast enforcement of keyword arguments at call sites, without mypy or ty plugins. Companion to mypy-strict-kwargs; a fast standalone linter for teams that type-check with ty.
def add(a: int, b: int) -> int: ...
add(a=1, b=2) # OK
add(1, 2) # error: too many positional args -> fix rewrites to add(a=1, b=2)
Install
uv tool install strict-kwargs # or: pip install strict-kwargs
Usage
strict-kwargs . # check a directory (exit 0 = clean, 1 = violations, 2 = error)
strict-kwargs fix . # rewrite positional args to keyword args in place
strict-kwargs fix --diff . # preview the rewrite, write nothing
strict-kwargs --python .venv . # point the ty fallback at an environment
fix is conservative: it never rewrites a call it would not report, and leaves overloaded callees, *args/**kwargs unpacking, and ty-only-resolved calls untouched (reporting how many it declined).
--python accepts an interpreter, venv, or sys.prefix (mirrors ty check --python) for third-party packages outside an activated venv or <project>/.venv.
pre-commit
repos:
- repo: https://github.com/adamtheturtle/strict-kwargs-pre-commit
rev: 2026.5.16.post1 # pin to a release tag
hooks:
- id: strict-kwargs
Use the mirror (prebuilt wheel, no Rust toolchain).
Pointing repo: at this repository works too but builds from source.
Configuration
In pyproject.toml:
[tool.strict_kwargs]
ignore_names = ["main.func", "builtins.str"] # fully-qualified, as in mypy-strict-kwargs
debug = false
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strict_kwargs-2026.5.18-py3-none-win_amd64.whl.
File metadata
- Download URL: strict_kwargs-2026.5.18-py3-none-win_amd64.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c90ae750b5754176e943bebaee42d34e51433ead05da60908159b42059ccea75
|
|
| MD5 |
8b7990390b58569b4271cefa2e3faeeb
|
|
| BLAKE2b-256 |
2bea8c711d39423fa503f94a4afd5913e3d5ae2f87d1e9009d2219e47c78c473
|
Provenance
The following attestation bundles were made for strict_kwargs-2026.5.18-py3-none-win_amd64.whl:
Publisher:
release.yml on adamtheturtle/strict-kwargs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strict_kwargs-2026.5.18-py3-none-win_amd64.whl -
Subject digest:
c90ae750b5754176e943bebaee42d34e51433ead05da60908159b42059ccea75 - Sigstore transparency entry: 1566821641
- Sigstore integration time:
-
Permalink:
adamtheturtle/strict-kwargs@48fcb5f494c202ee56db123d9685b0f96a031761 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48fcb5f494c202ee56db123d9685b0f96a031761 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file strict_kwargs-2026.5.18-py3-none-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: strict_kwargs-2026.5.18-py3-none-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ce07d85420eed40e51b0a61681db39fd56ed2be97f73780ef2be97ef9373c1b
|
|
| MD5 |
b36a6478c999d75a5b39c8d8801acc67
|
|
| BLAKE2b-256 |
790d989af3f5eda8cd14bd80488e449f8f40d81709de44dd376f309df83bb726
|
Provenance
The following attestation bundles were made for strict_kwargs-2026.5.18-py3-none-manylinux_2_39_x86_64.whl:
Publisher:
release.yml on adamtheturtle/strict-kwargs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strict_kwargs-2026.5.18-py3-none-manylinux_2_39_x86_64.whl -
Subject digest:
2ce07d85420eed40e51b0a61681db39fd56ed2be97f73780ef2be97ef9373c1b - Sigstore transparency entry: 1566821653
- Sigstore integration time:
-
Permalink:
adamtheturtle/strict-kwargs@48fcb5f494c202ee56db123d9685b0f96a031761 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48fcb5f494c202ee56db123d9685b0f96a031761 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file strict_kwargs-2026.5.18-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: strict_kwargs-2026.5.18-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e60f890d25dde613b337eef035b96ed820acafdca46ec3349b35f4d5af55c5ac
|
|
| MD5 |
3670894e77f5b0da5bcad5a4f99bf55b
|
|
| BLAKE2b-256 |
e35f214c7046d4fdb7562db842baeeb8b3dda4521c2736f4ac5fb10ab3397f0c
|
Provenance
The following attestation bundles were made for strict_kwargs-2026.5.18-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on adamtheturtle/strict-kwargs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strict_kwargs-2026.5.18-py3-none-macosx_11_0_arm64.whl -
Subject digest:
e60f890d25dde613b337eef035b96ed820acafdca46ec3349b35f4d5af55c5ac - Sigstore transparency entry: 1566821621
- Sigstore integration time:
-
Permalink:
adamtheturtle/strict-kwargs@48fcb5f494c202ee56db123d9685b0f96a031761 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48fcb5f494c202ee56db123d9685b0f96a031761 -
Trigger Event:
workflow_dispatch
-
Statement type: