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 APItests/: package and server-mode coveragedocs/: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cd4aae22daec48599d8b0ee70d2614ccb08254290e94ee2e7130e4763e74ed4
|
|
| MD5 |
4476117c2df512fda73827de1a616b78
|
|
| BLAKE2b-256 |
94442b952e4ff7a2d07ababa3b3d0388c96442122922f36fbc0b28f510d94c57
|
Provenance
The following attestation bundles were made for xian_tech_linter-0.3.3.tar.gz:
Publisher:
release.yml on xian-technology/xian-linter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_linter-0.3.3.tar.gz -
Subject digest:
6cd4aae22daec48599d8b0ee70d2614ccb08254290e94ee2e7130e4763e74ed4 - Sigstore transparency entry: 1280265616
- Sigstore integration time:
-
Permalink:
xian-technology/xian-linter@273a6049f3273571c270ebe041ea4e9d0a19722b -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@273a6049f3273571c270ebe041ea4e9d0a19722b -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_linter-0.3.3-py3-none-any.whl.
File metadata
- Download URL: xian_tech_linter-0.3.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d550a9e87ccf7e7d4cd2ce8e14ae06b3ff27d368aafa268f5b0217b11693ab
|
|
| MD5 |
283a0f8f31f6232cc16eeaf021f52ade
|
|
| BLAKE2b-256 |
405aff6d2c02551b497df96f6fa70c74bf7a43f03cab1f1a5184048e4053908a
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_linter-0.3.3-py3-none-any.whl -
Subject digest:
94d550a9e87ccf7e7d4cd2ce8e14ae06b3ff27d368aafa268f5b0217b11693ab - Sigstore transparency entry: 1280265620
- Sigstore integration time:
-
Permalink:
xian-technology/xian-linter@273a6049f3273571c270ebe041ea4e9d0a19722b -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@273a6049f3273571c270ebe041ea4e9d0a19722b -
Trigger Event:
push
-
Statement type: