wayward-eagle
Lowers the cognitive complexity (SonarSource's metric, as clang-tidy's
readability-function-cognitive-complexity counts it) of C functions, as pycparser c_ast,
keeping what each function does. Each rewrite is made only where it
lowers the cost. wayward-eagle reduce FILE.c [-o OUT.c] [-I DIR] reduces every function of
a C file.
from wayward_eagle import c
# fd: a pycparser c_ast.FuncDef, from c.load(...).functions or built by hand
pieces = c.reduce_function(fd, noreturn={"trap"}, status=None)
print(c.render(c.prototypes(pieces) + pieces)) # the static pieces first, fd's own last
- C layer:
wayward_eagle.c.loadreads C through a pinned clang intoc_astwith clang's types, implicit casts, declarations and source ranges; queries, rendering andreduce_function. - Rewrites: what each rewrite does and when it applies.
- Census:
wayward-eagle census FILE.c... [-I DIR] [--json]lists C's readability defects by class (clang-tidy's checks and checks over clang's AST: dead stores, extraneous variables and casts, obscured control flow, meaningless names, raw memory blocks and hardware addresses, ...), each function's local variables (and their definitions by why they exist), lines and statements, and thewayward-censusvirtuous-cycles adapter ratchets them.
Install: pip install wayward-eagle. Development: pip install -e .[dev], then
pytest -n auto --cov=wayward_eagle.
Metadata
Release files for wayward-eagle 0.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wayward_eagle-0.5.6.tar.gz | 115.2 kB | With provenance | Details for wayward_eagle-0.5.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wayward_eagle-0.5.6-py3-none-any.whl | Python 3 | none | any | Details for wayward_eagle-0.5.6-py3-none-any.whl |
Total release size: 207.6 kB
Release files / wayward_eagle-0.5.6.tar.gz
| Download URL | wayward_eagle-0.5.6.tar.gz |
|---|---|
| Size | 115.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a068de6fe4523f54e07a6b88f4ad3a1bb59d983f5073abbcac2ea85ba9bcffc6
|
|
BLAKE2b-256 checksum How to use checksums |
cb2a9e56d43e8ad4b4d1509d4e8909e25de284485a0f94a0a6e27714a0c43b44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / wayward_eagle-0.5.6-py3-none-any.whl
| Download URL | wayward_eagle-0.5.6-py3-none-any.whl |
|---|---|
| Size | 92.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61d9d3117b74d989197ed1a4a26b92ec4c5d9b0a33a0b6916bce42e461b01d68
|
|
BLAKE2b-256 checksum How to use checksums |
e2ed3286fbc0df1fdf5abeb18729541c67c7d2c5b961bd0866f44b5e56d6ceaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for wayward-eagle 0.5.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for wayward_eagle-0.5.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.