Skip to main content

A fast, opinionated linter for structlog log calls in Python. Written in Rust.

Project description

structloglint

A fast, opinionated linter for structlog log calls in Python. Written in Rust.

Status: Early development (v0.1.0)

Installation

uv pip install structloglint

From source

uv venv
source .venv/bin/activate
uv pip install maturin
maturin develop --release

Usage

structloglint --path src/ --verbose

See RULES.md for the full list of rules (SL001--SL009) and planned configuration options.

Roadmap (MoSCoW)

Done

Area Detail
Linting rules SL001--SL009 fully implemented with unit tests
AST walker Recursive Python AST traversal via rustpython-parser with parent context tracking (19 block types)
Logger detection Naming-convention heuristic (matches log, logger, LOG, *_logger, etc.)
CLI --path, --verbose, --output-format full|concise via clap
Output Colored diagnostics with source context, gutter markers, and underline spans
Fix data model Fix struct exists, SL008 generates fix suggestions
Test data Per-rule Python fixtures (test_data/SL00x.py) + comprehensive e-commerce example
Python packaging maturin build so uv pip install structloglint works

Must Have

Area Detail Status
pyproject.toml config Parse [tool.structloglint] for include/exclude, case style, max length, per-rule severity not started (values hardcoded)
--fix flag Apply auto-fixes in-place (SL008 fix model already exists) not started
CLI parity --file single-file mode, --event-case-style, --loop-log-level flags not started
Pre-commit hook .pre-commit-hooks.yaml so repos can add the linter to .pre-commit-config.yaml not started
CI/CD GitHub Actions: lint, test, build on push/PR not started
Release management release-please for automated changelogs, version bumps, and GitHub releases not started
Cross-platform builds CI matrix for Linux, macOS, Windows (x86_64 + aarch64) not started
Binary distribution Publish wheels per platform to PyPI via maturin not started
Exit codes Non-zero exit on findings for CI gating not started
Integration tests End-to-end tests that invoke the binary against test_data/ and assert output/exit code not started
Inline suppression # noqa: SL001 style comments to suppress per-line not started

Should Have

Area Detail Status
CHANGELOG Auto-generated via release-please not started
SARIF / JSON output Machine-readable output for CI integrations (GitHub code scanning, etc.) not started
--diff mode Show fixes as unified diffs without applying not started
SL010 rule Event string should use past tense not started
Benchmarks Performance regression tracking in CI not started

Could Have

Area Detail
GitHub Action Marketplace action for direct use in workflows
Editor integration VSCode extension / LSP server
Custom rule plugins User-defined rules via config or scripting
Watch mode Re-lint on file change

Won't Have (for now)

Area Reason
Full type inference Would require a Python type checker; naming heuristic is sufficient
Auto-fix for all rules Some rules (SL005, SL007) require structural refactoring that can't be automated safely
flake8 plugin mode Targeting standalone tool distribution like ruff instead

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

structloglint-0.1.1-py3-none-win_amd64.whl (1.6 MB view details)

Uploaded Python 3Windows x86-64

structloglint-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

structloglint-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

structloglint-0.1.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

structloglint-0.1.1-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

structloglint-0.1.1-py3-none-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file structloglint-0.1.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3d806d4915b211cfa60f61a2bcb684f44762bde0cf05d525778ed690a8bbae63
MD5 10b4b869dcca78fec774d3ec529f1204
BLAKE2b-256 6e4c4c632f15634bbea0d8aef21c661fe4cbc288a63904b012ceef2f8207f14c

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-win_amd64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file structloglint-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be3ec923350e0007c5277d8d6964ee772cd0a54443445ef75af5d664e5e11327
MD5 958e6c073362139b8a82a84c88f4aaa8
BLAKE2b-256 edfba8d67070f80dfe53238e983484590af05552a6280918307210dc9aaee886

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file structloglint-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c1aa61b3678abd3feec2f67de83a86fa03d4b2b0f1fc36732da3e2daa2899104
MD5 3c69c30a8af99d0e94e99e617b343ed8
BLAKE2b-256 7e36d5b1c8889fa5282ea7dd44785ed4a98b761cd50487c1483258ae5adc2c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file structloglint-0.1.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 da34926d554475ac2a94d8e53cac9f093ec70097f76d9a61616e285bf44cdf0d
MD5 6a0b8a77fa83eae8cf5801ad92780c1b
BLAKE2b-256 99fcb894e00e2ff6c39cd78e43db8f3588af183f9387a1152fff816c329ab793

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file structloglint-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07334458bb0e0952d6fbe0489a0c675201a227f76aa902d31bcdb875c4fca3fa
MD5 4b75a95ce8c97220bd9da4c1ede5956b
BLAKE2b-256 1f51f8499701d54111fd7760e8f8d716d104a084636482249d15150eeff9e3b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file structloglint-0.1.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.1.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0a63bfb3fe0fd07d5cc8f055ea1cee48c674d25a5c4ae2f40b1d7216ee533f01
MD5 4052e20ae7a20f53d9a0c3428ec25a59
BLAKE2b-256 645845b74fe58b084919242b39e5564c4902cdbea5cebaf8586e153370045445

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.1.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on maxilar20/structloglint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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