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"

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

konform-0.1.0-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.0.tar.gz.

File metadata

  • Download URL: konform-0.1.0.tar.gz
  • Upload date:
  • Size: 100.3 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.0.tar.gz
Algorithm Hash digest
SHA256 e05834341e553e939a4f2118c5795a5a897adcfab15b2ea98961d1da7342f13b
MD5 6425c164d1d2c1b25fd49942fca742a9
BLAKE2b-256 cf2849a864be71012dda2fc6ccda139d965ee03c773faad29185995c3330563e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: konform-0.1.0-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.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5f69eec9440b5c156c25ca1dde356d00b9c31b0159e5f3db8e01b3a8a1521728
MD5 8b6c0758620c9b17211471fe1215cce5
BLAKE2b-256 3740a4992bf53c2c1d2605d0d6297c1fd37db8ba97a57fab4cccb296f1e3238c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: konform-0.1.0-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.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 36566ab17060e131b5973ec6eb8c589fa45cacf6241cd4eab8e8c1057c503024
MD5 7249f007ef9e09891a9bf6529be1e546
BLAKE2b-256 f1312b67e3a1ba8b9045a6fdc10f6ff41de038c2db55afb27150f0cb5df425c9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 addb7bcabbbc294fd4571a1615220f6e75b50326d17b3d6948548dd5472657fa
MD5 03a40cfd4009b91f05fc4ba2e45470d3
BLAKE2b-256 fe22b9cc275e1c80f3a26dbd5c4b7293b4e47057cb2f98fc7559f55540126f92

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 384477b3ca87a9c11f78691cd535ff419377999527da2fb2ee419d55192490ff
MD5 a6ba5abbec2d6d0e4ae228c423920c6e
BLAKE2b-256 0c76dda8806f31d02d53d96017241a7b06bbf689f541b366201b38266ca1a6f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53678a06bbaa4b988a84eabd0b9385d2ebb4767f551665983febe006930f5cac
MD5 1e5bdccc152a7924f3bb72a24d0c99bd
BLAKE2b-256 c21fabbbe8194bc6a56d1e5f7a2234f76a2fea8a040afc1aa5c8b2ec7f49da00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1a65a721f87bf4b02fc6578b30ee80a85fce53d699c32db9e55536a838ad597a
MD5 48ef1548be5a512f0cccdae6461c4616
BLAKE2b-256 5c960c28739be155078177fc26ec570f3d3fffe91642c60318c84b6ae017ad59

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 107bcd01ee81c308811a665061c83b4793cf81a499e1575877bd7455ae0e7b1a
MD5 e57dd70d1b82b7ec52505d0efc78cafc
BLAKE2b-256 4c8af78a66adce81465a52f406e0d3204753aa07b318a96a81931139bb600580

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5480b3980258a5d73498d0583663e31941d8c0f386027b887cd97d9b08accb3d
MD5 fbbb8e8e30b3b7511aad40113929f177
BLAKE2b-256 1b461ef0cd998d51c4fd982307db5bf5c4446ea21541ec75b7bad86718b6285d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 171c342b6b37ddfe4d85af4e1e7938bfb669d01d616eab7f158d69925aa4c91d
MD5 854a33f3c00b33a089fc4b41690de2d5
BLAKE2b-256 9bf485e29be5139c75c6a845fb817a07b7b9948371fdadcb73df6778776c1b2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for konform-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 43959562fc0eef7d6d9a88f36396a91ad26a706f276c42452ecc3e3e3301b189
MD5 6b8ff922c7b770b702efdd20d427a069
BLAKE2b-256 3ce744fa278ce8f7b8b339f35b41da6e9dca5e74cce45178414f7f23de2f4aa9

See more details on using hashes here.

Provenance

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

0.1.1

11 files

This release

0.1.0 This release

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