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.2.tar.gz (110.9 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.2-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

konform-0.1.2-py3-none-win32.whl (2.9 MB view details)

Uploaded Python 3Windows x86

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

konform-0.1.2-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.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

konform-0.1.2-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.2.tar.gz.

File metadata

  • Download URL: konform-0.1.2.tar.gz
  • Upload date:
  • Size: 110.9 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.2.tar.gz
Algorithm Hash digest
SHA256 8a01f574b6bd0d0a0c0815a92aa6d33472f1b27c53fdcd223ff65a79a96cedec
MD5 a43e782bec0247ae1d4217c559f2417a
BLAKE2b-256 54204c96302c933467cf7d87b87111b0f4dec78e4e01614f0ab02f90da9479f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2.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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: konform-0.1.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e3599ee0b590a07588b5f0d2d9a8a2569f00b0bee24f58d3060c638bf10fd4da
MD5 9c639d100d039dcafecde93ef8e96731
BLAKE2b-256 224873cf57fe498b6693bd4b7750f8788a398450eaf3d395b80f11d6b4cb2ff5

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-win32.whl.

File metadata

  • Download URL: konform-0.1.2-py3-none-win32.whl
  • Upload date:
  • Size: 2.9 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.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 c6c7f6096c9a129bf06dfc6192b6c1175b9f21cad3fa9d1aabd7ae2557ef29ab
MD5 7ffb8a3f3bee865c4e8f9f718d46b3c1
BLAKE2b-256 28ae0e11cec94888db27dc8207d825b3c5f4c49fb980d1eaac73047e9dc8e970

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2267573570701b0089192ec7125f5a48a22f53c39d08d0dd87446490d4b24b08
MD5 74031017690126ef76a2e87774103f50
BLAKE2b-256 b64d0e4cc66fb7c8a2ab5822d606ddfbd040a366743e20d46cc18a48cee40a9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4074dc96602eda4050a5ef56ae56cbdca266ff9d4be38f8dd682c5318173276c
MD5 45b623714cd498fa7175dbdcba141d02
BLAKE2b-256 e1d87aebacae6b87fdbd93638e73e6583f5b16ec76898f60542574866471faf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d9f6d8d1c85b13d481c4581e977e478f3297aafff3eaba0b1ed666a371a634b
MD5 98317b41864825b8129c1dc0af035708
BLAKE2b-256 1083940c94395908abf112ec60c9803a5824615259ca01353e27255ca69e4b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b7e2ef305fc7d617724768ae6aa1dfefd0d70e75eb1db019640caf5a89f9575c
MD5 7e8f5bc99f747d53dfe71071e2ec99dd
BLAKE2b-256 da4e152f2acfff261232c0b61ad9b1b8d740fd707280b9f3fa72b3a58ed91023

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e7f5c52abd5bab33707455f25b504209da98c8d331de9eb079e3b87773aa3976
MD5 c76117d46615661d53e9d1b8d47083e8
BLAKE2b-256 faa84f48d42f483591199b05d08b577702bfce702e30bb77766abbe5541c570f

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3564824572ec1b76bb2c0c19f890b129f6775c4fb7ec49ea97374a6f59cfb67b
MD5 92e3d72c00732a58c6a897c6ef413d9a
BLAKE2b-256 6f8dd4b9860cd24cd19bbca1e43ff982fead47c7104aebf88714a2cb6a6105fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f80c4e4d500d3c259098984a0879fadc52d39b649ecd94a14d202a03330325bc
MD5 114bfb907677abdf24ab39053c50a6c4
BLAKE2b-256 61a31ca5ea98032f5c48c222a20f5b96e2d17c57df78c0b26efc657b9582142b

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for konform-0.1.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5070b381fe77a95ea44c6643f4581aa8437d02df2c8478813f75897fb1b22da7
MD5 784a45ff407b343d709375c2956def99
BLAKE2b-256 25f2ebeecf0db94f1340cd3cfe41a6f2184e8d835d2c5dffd81f90829e37a8b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for konform-0.1.2-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

This release

0.1.2 This release

11 files

0.1.1

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