Skip to main content

Smart contract linter for the Xian blockchain

Project description

xian-linter

xian-linter is a Python linter specifically for Xian smart contracts. It combines PyFlakes with the structured linter exposed by xian-contracting, so rule violations include stable error codes and source positions.

The published PyPI package name is xian-tech-linter. The import package and console command remain xian_linter and xian-linter.

Quick Start

Base package:

pip install xian-tech-linter

Inline use:

from xian_linter import lint_code_inline

errors = lint_code_inline("def transfer():\n    pass\n")

Structured sync API:

from xian_linter import LintErrorModel, lint_code_sync

errors: list[LintErrorModel] = lint_code_sync(
    "@export\ndef transfer():\n    return missing_name\n"
)

Principles

  • Keep the package focused on contract linting, not runtime execution.
  • Expose the same rule surface in both inline and server modes.
  • Prefer stable error codes and positions so tooling can build on top of the linter reliably.
  • Keep the structured result types importable from the package root so callers do not need to reach into internal modules.
  • Keep server mode optional. The core package should still be useful as a local linting dependency.

Key Directories

  • xian_linter/: package code, server entrypoints, and inline API
  • tests/: package and server-mode coverage
  • docs/: repo-local notes and backlog

Validation

uv sync --group dev
uv run ruff check .
uv run ruff format --check .
uv run pytest

Related Docs

Usage Modes

  • Inline/programmatic usage:
from xian_linter import lint_code_inline, lint_code_sync

inline_errors = lint_code_inline("def transfer():\n    pass\n")
sync_errors = lint_code_sync("def transfer():\n    pass\n")
  • Standalone server mode:
pip install "xian-tech-linter[server]"
xian-linter
uvicorn xian_linter.server:create_app --factory --host 0.0.0.0 --port 8000

Project details


Download files

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

Source Distribution

xian_tech_linter-0.3.3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

xian_tech_linter-0.3.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file xian_tech_linter-0.3.3.tar.gz.

File metadata

  • Download URL: xian_tech_linter-0.3.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xian_tech_linter-0.3.3.tar.gz
Algorithm Hash digest
SHA256 6cd4aae22daec48599d8b0ee70d2614ccb08254290e94ee2e7130e4763e74ed4
MD5 4476117c2df512fda73827de1a616b78
BLAKE2b-256 94442b952e4ff7a2d07ababa3b3d0388c96442122922f36fbc0b28f510d94c57

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_linter-0.3.3.tar.gz:

Publisher: release.yml on xian-technology/xian-linter

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

File details

Details for the file xian_tech_linter-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for xian_tech_linter-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94d550a9e87ccf7e7d4cd2ce8e14ae06b3ff27d368aafa268f5b0217b11693ab
MD5 283a0f8f31f6232cc16eeaf021f52ade
BLAKE2b-256 405aff6d2c02551b497df96f6fa70c74bf7a43f03cab1f1a5184048e4053908a

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_linter-0.3.3-py3-none-any.whl:

Publisher: release.yml on xian-technology/xian-linter

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