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 developmentGitHub

Installation

pip install structloglint

Usage

structloglint --path src/
structloglint --path . --select SL001,SL002 --ignore SL007 --output-format concise
structloglint --path . --max-event-length 40 --event-case-style camel_case

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 string rules
event-case-style = "snake_case"
max-event-length = 30

# Loop logging
loop-log-level = "info"

# Rule selection (omit to run all)
select = ["SL001", "SL002", "SL003", "SL004", "SL005", "SL006", "SL007", "SL008", "SL009"]
ignore = []

# File discovery
include = ["src/**/*.py", "app/**/*.py"]
exclude = ["tests/**", "migrations/**"]
extend-exclude = ["generated/**"]

# Import detection
check-imports = true

# Per-rule severity overrides
[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 = "camel_case"
max-event-length = 50
loop-log-level = "info"
select = ["SL001", "SL002", "SL003", "SL004", "SL005", "SL006", "SL007", "SL008", "SL009"]
ignore = ["SL007"]
exclude = ["tests/**"]
check-imports = true

[rules]
SL007 = "off"

See RULES.md for all configuration options and rule descriptions.

See ROADMAP.md for the project plan.

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.5.0-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

structloglint-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

structloglint-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

structloglint-0.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

structloglint-0.5.0-py3-none-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

structloglint-0.5.0-py3-none-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a90b9194e2d04d18b140483b520525133820d98a190eb840ad37b9ec896d3a49
MD5 f640fd8aa12d5b324b0636decfd9d78f
BLAKE2b-256 9459c5c9dd0dcc2407e42b2ffd024f50d1f54f2aaf790c3b0450376d4888472e

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fbe802f20f9c58b092458b4aea429dc992649b8f057f02acfbdff080ccfb002
MD5 192e32d5e15cdd4156f810f052ddcffb
BLAKE2b-256 6c6a652598e4759ad9cfa9b2d37de097257d6138a5cec7f93e2a0779f36a0e17

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e5ca4684408476db84c4bf86240517851f63b5024b237bf858db54408b3251cd
MD5 b635242e4114445342ced0eaf8127247
BLAKE2b-256 f133290395182a44d68796f951d1ec129febb3aa708c7b5eb6970d0a56d79be4

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 36c10e0cca83dc3bdd1076d7c8ca7c112f94aa7680aa410fade89f72c6dfc8b1
MD5 8cc5f53801a60fabcde30b7b0974a01c
BLAKE2b-256 4ddf0496a5e35ac6742c7be8a5c0f99fb5e08f45dca098d2ea4db4eac648a0cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a5d698162a3437ee388ae7a42b2aade451c80e0e0d10ab39b3e2bad4149aa33
MD5 72daca7c563f02dc2ff97c4590c0022d
BLAKE2b-256 2385e8ff74e6f82ea6e2e1b4b693e113f33eeb97f865d493fdead1a042b9da7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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.5.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for structloglint-0.5.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 13863866f491ca40dd161986cef56b7881356a3a3ca7fc7847da3d4441c674a0
MD5 a78ee13ba3ab0fa0865e05bfabd5c368
BLAKE2b-256 506cc5ac6f8191c037092504ff5e11662f19659ea78cc274d82da9b63be93956

See more details on using hashes here.

Provenance

The following attestation bundles were made for structloglint-0.5.0-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