Skip to main content

konform

Multi-rule Python linter and language server — fast, configurable, and CI-ready.

Rules

KIS001 — Google-style imports

Checks that every from X import Y only imports a sub-module, not an object (function, class, or constant), following the Google Python Style Guide §2.2.

# Bad — KIS001: `join` is a function, not a module
from os.path import join

# Good
import os.path
from os import path       # `path` is a module

KPT — User-defined pattern rules

Load regex patterns from konform_patterns.toml (auto-discovered next to pyproject.toml) or inline in pyproject.toml:

[[tool.konform.KPT.rules]]
id      = "KPT001"
message = "Use the project logger instead of bare print()."
pattern = '^\s*print\s*\('
files   = ["src/**/*.py"]
level   = "warning"

Installation

pip install konform

Wheels ship a pre-compiled Rust binary — no Rust installation needed at runtime.

Usage

# Lint all Python files under src/
konform check src/

# Lint and apply auto-fixes in one pass
konform check --fix src/

# Apply fixes only (no lint report)
konform check --fix src/

# Show a unified diff of what format would change
konform check --diff src/

# Output violations as JSON (e.g. for tooling)
konform check --output-format json src/

# Suppress hints and summary (violations only)
konform check -q src/

# No output — just exit 1 on violations
konform check -s src/

# List all rules
konform rule --list

# Explain a rule
konform rule --explain KIS001

# Clear the local cache
konform clean

Configuration

Add a [tool.konform] section to pyproject.toml (or a standalone konform.toml):

[tool.konform]
select    = []        # [] = all rules; prefix match: "KIS" = all KIS* rules
ignore    = []
level     = "error"   # "warning" | "error"
cache_dir = ".konform_cache"
workers   = 0         # 0 = os.cpu_count()

# ── KIS — import style ────────────────────────────────────────────────────
[tool.konform.KIS]
exceptions = [
    "__future__", "typing", "typing_extensions", "collections.abc",
    "mycompany.compat",
]
level = "error"
unresolved_level = "warning"   # "warning" (default) | "error" | "off"
                                # Used when a package isn't installed in this
                                # environment, so KIS001 can't tell whether the
                                # imported name is a module or not.

# ── KPT — user-defined patterns ───────────────────────────────────────────
[tool.konform.KPT]
level = "warning"
# Optional: load patterns from an external file instead of inline rules.
# rules_file = "konform_patterns.toml"

[[tool.konform.KPT.rules]]
id      = "KPT001"
message = "Use the project logger instead of bare print()."
pattern = '^\s*print\s*\('
files   = ["src/**/*.py"]
level   = "warning"

# Sub-rules are attached to this rule entry. This inline form makes the
# parent/child relation explicit and avoids table-order confusion.
sub_rules = [
  {
    pattern = ['print\(.*password', 'print\(.*secret'],
    message = "Never print credentials.",
    help = "Use redaction helpers before logging.",
  },
]

When using [[tool.konform.KPT.rules.sub_rules]], TOML binds each sub-rule to the most recently declared [[tool.konform.KPT.rules]] entry.

Pattern files

Patterns can also live in a standalone konform_patterns.toml placed next to pyproject.toml. konform auto-discovers it (no config key needed):

# konform_patterns.toml
[[rules]]
id      = "KPT002"
message = "Remove breakpoint() — debugging artefact."
pattern = '^\s*breakpoint\s*\(\s*\)'
level   = "error"

Suppressing violations

from os.path import join   # noqa: KIS001   ← exact rule
from os.path import join   # noqa: KIS       ← whole category
from os.path import join   # noqa             ← everything on this line

Aliasing noqa codes

When a rule code changes (e.g. a rule is renamed, or a project migrates from another linter's codes), old # noqa comments would otherwise stop working. Define aliases in your config so they keep suppressing the renamed/canonical rule:

# pyproject.toml
[tool.konform.noqa_aliases]
IS001 = "KIS001"
IS    = "KIS"
from os.path import join   # noqa: IS001   ← suppresses KIS001 via alias

Language Server (LSP)

konform ships a built-in LSP server that shares the same rule engine as the CLI — no second process, no stale results.

konform server   # starts the LSP over stdin/stdout

Neovim (nvim-lspconfig)

vim.api.nvim_create_autocmd("FileType", {
  pattern = "python",
  callback = function()
    vim.lsp.start({
      name = "konform",
      cmd  = { "konform", "server" },
      root_dir = vim.fs.dirname(
        vim.fs.find({ "pyproject.toml", "konform.toml" }, { upward = true })[1]
      ),
    })
  end,
})

VS Code (settings.json)

Add via the generic None ls or any client that supports a custom LSP command:

{
  "nls.server": {
    "command": ["konform", "server"]
  }
}

Zed

{
  "lsp": {
    "konform": {
      "binary": {
        "path": "konform",
        "arguments": ["server"]
      }
    }
  }
}

Development

# Compile the Rust binary and install it in the dev venv (required before tests)
hatch run develop

# Run tests with coverage
hatch test -c

# Build release wheels for all platforms
hatch run maturin:build-all

CLI reference

konform check  [OPTIONS] <PATHS>…    Lint files (default subcommand)
konform check --fix-only [OPTIONS] <PATHS>…  Apply all auto-fixes in-place, exit 0
konform server                       Start the LSP server (stdin/stdout)
konform rule   --list                List all rules
konform rule   --explain <CODE>      Show full rule documentation
konform clean  [--config PATH]       Delete the cache directory
konform version                      Print konform's version

Global options (available on all subcommands):
  --color auto|always|never          Colour output control
  --isolated                         Ignore all config files
  -v / --verbose                     Extra output
  -q / --quiet                       Violations only (no summary/hints)
  -s / --silent                      No output; exit code only

Download files

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

Source Distribution

konform-0.1.1.tar.gz (101.7 kB view details)

Uploaded Source

Built Distributions

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

konform-0.1.1-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

konform-0.1.1-py3-none-win32.whl (2.8 MB view details)

Uploaded Python 3Windows x86

konform-0.1.1-py3-none-musllinux_1_2_x86_64.whl (3.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

konform-0.1.1-py3-none-musllinux_1_2_aarch64.whl (3.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

konform-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

konform-0.1.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

konform-0.1.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

konform-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

konform-0.1.1-py3-none-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

konform-0.1.1-py3-none-macosx_10_12_x86_64.whl (3.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file konform-0.1.1.tar.gz.

File metadata

  • Download URL: konform-0.1.1.tar.gz
  • Upload date:
  • Size: 101.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for konform-0.1.1.tar.gz
Algorithm Hash digest
SHA256 626de6cb65f83ec45add3051976bc967ec6ede0aac53eae53ff74e15ca27cfd9
MD5 f2d060cd23f6f61dfdf8acc553a4c4d4
BLAKE2b-256 0683f16e258cddce9682185104459c2e78d79b38877df366e5cd17ee7096bb59

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1.tar.gz:

Publisher: release.yml on benediktziegler/konform

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

File details

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

File metadata

  • Download URL: konform-0.1.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for konform-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e6670aa4ab5f2b633c6621b6741193c38c2ca924b1ea58d88492f18813684113
MD5 3d8a224ff90836430eda5049e6f1db5f
BLAKE2b-256 4a223de05343b8d6b97a3e779cfc3a68c2460693a89ffd9a9e5882864cb38ee4

See more details on using hashes here.

Provenance

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

Publisher: release.yml on benediktziegler/konform

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

File details

Details for the file konform-0.1.1-py3-none-win32.whl.

File metadata

  • Download URL: konform-0.1.1-py3-none-win32.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for konform-0.1.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 6201120fbd5b559eb8fb13cbce7265e67d469bbeba4ec3c4f0be1b6f1bf4d13c
MD5 18263806aa678f285c3c53a439fc5fbb
BLAKE2b-256 13627a88cd853629eae466b0c79814da449eb8697b8af6b163da70d6290ab8ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1-py3-none-win32.whl:

Publisher: release.yml on benediktziegler/konform

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

File details

Details for the file konform-0.1.1-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7765abc23d7e4b126f21a4eb5de81694120f94c602107ba22bebcf8090159fc
MD5 79a944866cd82cfcd78d76b2e90868b8
BLAKE2b-256 d541fd3c98d65f53fec17cd8bafc3b9f90a173915a9824bf4d44655cbf22fc5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on benediktziegler/konform

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

File details

Details for the file konform-0.1.1-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e2640744886443eda49af2bee27e42ee0e3c5951d4961066bd557bbd56b1c0ba
MD5 aa2cbb4b44207b394312ad9b400a797c
BLAKE2b-256 3e0d8151bf45d5cbc2eb729bbf44fe1890a73fd48c12bbd648aa059c8b9c7f94

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release.yml on benediktziegler/konform

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

File details

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

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e638310612bc862ecf3c68745f36f47f5021df9ecc2497a75c461fade3002207
MD5 e55eaa9b3f0e7b2d0515d06c4a663bc1
BLAKE2b-256 0a3120110cd25181951c35a0cfc5bd7cbb4d84bc528c97853f7107e5e9651aba

See more details on using hashes here.

Provenance

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

Publisher: release.yml on benediktziegler/konform

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

File details

Details for the file konform-0.1.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e4a567a77e4aec5050e142714c4284d41968e30d8b523d6b9f0ab3e81250c2ea
MD5 47fee20c3f9fc1fef788f4fd693868e6
BLAKE2b-256 201b5ae5840cc5eea7004db1d8f15f685f5fb011bb6644f05f931b74c8eb18a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on benediktziegler/konform

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

File details

Details for the file konform-0.1.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 bf36127a6a9f141284dc67743407fa25fc723ec4a4d9ff92e60e6010a21a2ed3
MD5 bdfbccbcfb6320ee24acc2ce648fc136
BLAKE2b-256 f352c08f429e36bab39043b873a67e4e6cd1f65d6ec3c4ffb1d4f9f72f4dd101

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: release.yml on benediktziegler/konform

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

File details

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

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c1ed86df02a2a9758f5542de15726d00496de42febcd56f7ce5d429b94c8ee86
MD5 7d96f96ec635fec3c3ee32b854ae31d9
BLAKE2b-256 ec794a26de413c99d7191c3559a83d5e33ee8e42890ec71a6434cf54a88405af

See more details on using hashes here.

Provenance

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

Publisher: release.yml on benediktziegler/konform

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

File details

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

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6df82746fd1f1d2a7b2d33b1d321290d3d83f6bcec27fa9e80d1c07ef8c76441
MD5 ec05b95fb7bd7ae3f836c5942a66d4e2
BLAKE2b-256 21093f929ec92629157c005be09bb00651d5f3bc908eb44849515f12d8a7cb1e

See more details on using hashes here.

Provenance

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

Publisher: release.yml on benediktziegler/konform

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

File details

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

File metadata

File hashes

Hashes for konform-0.1.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3d43584c42e30d0b521840359a7fd486c1ef1297302467a48893f743ba975724
MD5 1930930aa189471a4325aad8c41c933a
BLAKE2b-256 04a8bd477e4f2d5e825cbd06921ba388c5dc540ff7569cc5cfaf683d1af94797

See more details on using hashes here.

Provenance

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

Publisher: release.yml on benediktziegler/konform

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

Release history Release notifications | RSS feed

0.2.0

11 files

0.1.2

11 files

This release

0.1.1 This release

11 files

0.1.0

11 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page