Skip to main content

A linting guardrail for LLM-generated Python code which raises structural doubts and a per-finding score before the code reaches a reviewer

Project description

humansays

CI PyPI Python

A linting guardrail for LLM-generated Python code which raises structural doubts and a per-finding score before the code reaches a reviewer.

humansays reads the standard-library AST and reports structural review leads — long parameter lists, deep nesting, mutable module state, lazy imports, methods that touch neither self nor the class. It does not tell you the code is wrong. It tells you where a reviewer should look, and asks a question about each site.

Rule identifiers are unstable until 0.1.0. The current HS### ids may be renamed before then. Do not pin against them.

Install

pip install humansays

# with rich terminal output
pip install 'humansays[terminal]'

humansays has no runtime dependencies. rich is an optional extra; without it the terminal output falls back to plain ANSI.

Requires Python 3.11 or newer.

Usage

humansays src/                     # scan a directory
humansays a.py b.py                # scan specific files
humansays --format json src/       # machine-readable output
git ls-files '*.py' | humansays    # read a path list from stdin

Useful flags:

Flag Effect
--format text|json Output format. Default text
--limit N Show at most N targets. 0 shows all. Default 200
--symbol NAME Restrict output to one symbol
--exclude PATTERN Skip matching paths. Repeatable
--fail-on never|warning|any Exit non-zero on findings. Default never
--min-score N Exit non-zero below this score
--config PATH Explicit configuration file

Exit codes: 0 clean, 1 findings exceeded the configured threshold, 2 --symbol not found, 3 no Python files found, 4 configuration file missing.

Configuration

Settings are read from humansays.toml, or from a [tool.humansays] table in pyproject.toml, whichever is found first. Command line flags override the file.

[tool.humansays.report]
format = "text"
limit = 50
fail_on = "warning"
min_score = 70.0

[tool.humansays.selection]
exclude = ["migrations", "generated"]

[tool.humansays.thresholds.functions]
max_arguments = 5
max_nesting = 4
max_branches = 12
max_lines = 60

[tool.humansays.thresholds.classes]
max_attributes = 10
max_base_classes = 2

[tool.humansays.thresholds.modules]
max_lines = 500

What it does not claim

It is not faster than Ruff, not more comprehensive than Pylint, and not a replacement for a type checker. It cannot prove runtime behavior from syntax, and it does not detect whether a model wrote your code — only whether the code carries the structure that usually needs a second reader.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

humansays-0.1.0a1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

humansays-0.1.0a1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file humansays-0.1.0a1.tar.gz.

File metadata

  • Download URL: humansays-0.1.0a1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for humansays-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 177d16091ce1c270a59fc7cb6671c204c6486edb9f74d7036c3ab966be1e8f12
MD5 61d73b89eb3b76fb3a083c2b0671049e
BLAKE2b-256 f85d18fc00d495f3bc0a821811636d96a0d5655c93eed7136b8b967aa7e01a53

See more details on using hashes here.

File details

Details for the file humansays-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: humansays-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for humansays-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0b547d8a8df03c91be9f6bc0ad1a3d81c0a7da7694b45058c33e61b4364a3d
MD5 ec6b636e9d9ea4202544be855b4e7f3f
BLAKE2b-256 b9f1b86c431d881b2b81eee5db9dcd3cfc1c9b773243b0e5ceddf8ec86740087

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page