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.1)
Installation
uv pip install structloglint
From source
uv venv
source .venv/bin/activate
uv pip install maturin
maturin develop --release
Usage
structloglint --path src/
structloglint --path . --select SL001,SL002 --ignore SL007 --output-format concise
structloglint --path . --max-event-length 40 --event-case-style camelCase
See RULES.md for the full list of rules (SL001--SL009) and configuration options.
Configuration
Add a [tool.structloglint] section to your pyproject.toml:
[tool.structloglint]
event-case-style = "snake_case"
max-event-length = 30
loop-log-level = "info"
select = ["SL001", "SL002", "SL003", "SL004", "SL005", "SL006", "SL007", "SL008", "SL009"]
[tool.structloglint.rules]
SL007 = "off" # disable loop check
SL009 = "error" # promote to error
Alternatively, create a standalone structloglint.toml in your project root (takes precedence over pyproject.toml). In standalone format, omit the [tool.structloglint] table wrapper:
# structloglint.toml (standalone)
event-case-style = "camelCase"
max-event-length = 50
[rules]
SL007 = "off"
See RULES.md for all 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 |
| CLI config overrides | --event-case-style, --max-event-length, --loop-log-level flags |
| Rule selection | --select / --ignore CLI flags + select / ignore config keys |
| Per-rule severity | [tool.structloglint.rules] for off / warning / error overrides |
| Output | Colored diagnostics with source context, gutter markers, and underline spans |
| Fix data model | Fix struct exists, SL008 generates fix suggestions |
| Configuration | pyproject.toml ([tool.structloglint]) and standalone structloglint.toml with directory-tree discovery |
| Integration tests | 18 integration tests using fixture Python packages with config variations |
| Python packaging | maturin build so uv pip install structloglint works |
| Pre-commit hook | .pre-commit-hooks.yaml for use in .pre-commit-config.yaml |
| CI/CD | GitHub Actions: fmt, clippy, test on push/PR |
| Release management | release-please for automated changelogs, version bumps, and GitHub releases |
| Cross-platform builds | CI matrix for Linux (x86_64, musl, aarch64), macOS (x86_64, aarch64), Windows (x86_64) |
| Binary distribution | Publish wheels per platform to PyPI via maturin |
| Exit codes | Non-zero exit on findings for CI gating |
Must Have
| Area | Detail | Status |
|---|---|---|
--fix flag |
Apply auto-fixes in-place (SL008 fix model already exists) | not started |
| Inline suppression | # noqa: SL001 style comments to suppress per-line |
not started |
Should Have
| Area | Detail | Status |
|---|---|---|
| JSON / SARIF output | Machine-readable output for CI integrations (GitHub code scanning, etc.) | not started |
| GitHub Actions output | --output-format github for inline PR annotations |
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
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 structloglint-0.3.0-py3-none-win_amd64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-win_amd64.whl
- Upload date:
- Size: 1.8 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 |
999994eb223bbcbd10baad4524c28075623c0d3dc6ed169f4ff7d13bae77faf5
|
|
| MD5 |
b3edb920427a2683392822b9c0bb1d90
|
|
| BLAKE2b-256 |
30a11e0417504fd7c446226a66eb99425d49f7b1919bdc37441f57e12167a5c7
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-win_amd64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-win_amd64.whl -
Subject digest:
999994eb223bbcbd10baad4524c28075623c0d3dc6ed169f4ff7d13bae77faf5 - Sigstore transparency entry: 1888580266
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file structloglint-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d6c5dab6c0ed46b89695834ae004a2315c2411275b5926aca8a0afb8820f43d
|
|
| MD5 |
2446e983854c3a61b1116680823b6f2e
|
|
| BLAKE2b-256 |
e3d2bb909cd0a13d8ec50df1ccc916aa28fd05329595f725f4bbd0f58452e972
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
8d6c5dab6c0ed46b89695834ae004a2315c2411275b5926aca8a0afb8820f43d - Sigstore transparency entry: 1888579997
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file structloglint-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1c79ae63f3a37d9513dcf376775b2061b5f239adcf28789d3da4dc09dd39ba
|
|
| MD5 |
9c4418377007c3cfd363a7767d908132
|
|
| BLAKE2b-256 |
e34d4f592890e696f1a5a57d891ae617dc0d912adefbb757e792541ca2cd78cb
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
3d1c79ae63f3a37d9513dcf376775b2061b5f239adcf28789d3da4dc09dd39ba - Sigstore transparency entry: 1888580080
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file structloglint-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
169cb2ebaedf2616eb0d24fba63999f0e7ffaf9798e3993fa645507e6e04deb9
|
|
| MD5 |
9dcbfa93826bc2f8d4fbbde10037a2bd
|
|
| BLAKE2b-256 |
a620134e751a3856696e9119acf1cad08767d2e8e9a31398337574776caacfad
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl -
Subject digest:
169cb2ebaedf2616eb0d24fba63999f0e7ffaf9798e3993fa645507e6e04deb9 - Sigstore transparency entry: 1888580425
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file structloglint-0.3.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 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 |
6ef71a67df4f388b4c986497c2a40b1f65b1da245107d63c5a99cb3ce654ef96
|
|
| MD5 |
9fb38eceb32a8ccae23dc47f9d2072a1
|
|
| BLAKE2b-256 |
e006355dfc8193d406d7150051f23f589104eace9fc3ebdad377fd9632bbf5ce
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
6ef71a67df4f388b4c986497c2a40b1f65b1da245107d63c5a99cb3ce654ef96 - Sigstore transparency entry: 1888580180
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file structloglint-0.3.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: structloglint-0.3.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b53d191e508889aa92e1049ecd86a77e756fdf083d2c6c09db39609a587eece
|
|
| MD5 |
65e6e005e0d66a01acb462ffe82b587f
|
|
| BLAKE2b-256 |
f2b6430de47535bf82bf869c7017a45557e1dc81f0c5839fe0615c09e873e5a3
|
Provenance
The following attestation bundles were made for structloglint-0.3.0-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on maxilar20/structloglint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structloglint-0.3.0-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
1b53d191e508889aa92e1049ecd86a77e756fdf083d2c6c09db39609a587eece - Sigstore transparency entry: 1888580357
- Sigstore integration time:
-
Permalink:
maxilar20/structloglint@2d015884b65e0aab386bd40798035e77a00066c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/maxilar20
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d015884b65e0aab386bd40798035e77a00066c3 -
Trigger Event:
push
-
Statement type: