Skip to main content

A Vyper linter for fine sneks.

Project description

Natrix

Natrix is a vyper linter that checks for common mistakes in vyper contracts. It is designed to be your vyper copilot, helping you to write code that is more secure and efficient.

Installation

You can install Natrix using pip:

pip install natrix

Currently natrix requires uv to be installed to function correctly.

Usage

To check a contract:

natrix file_to_lint.vy

To check all vyper contract in the current directory:

natrix

Command Line Options

natrix --help                         # Show help message
natrix --version                      # Show version information
natrix --list-rules                   # List all available rules
natrix --disable NTX001 NTX002        # Disable specific rules
natrix --rule-config RuleName.param=value  # Configure rule parameters

Configuration

You can configure Natrix using a pyproject.toml file in your project root:

[tool.natrix]
# Files or directories to lint (relative to pyproject.toml)
files = ["contracts/", "tests/contracts/"]

# Rules to disable
disabled_rules = ["NTX001", "NTX002"]

# Rule-specific configurations
[tool.natrix.rule_configs.RuleName]
param = "value"

Pre-commit hook

Natrix can also be used as a pre-commit hook. This allows to have your contracts checked automatically before you can commit.

To add natrix just add the following lines to your pre-commit-config.yaml config file:

repos:
  - repo: https://github.com/albertocentonze/natrix
    rev: v0.1.4  # Use the latest version
    hooks:
      - id: natrix

and then install pre-commit in your repository by doing:

pre-commit install

Disclaimer

Natrix is highly experimental software, I do not take any responsibility for changes to the codebase suggested by this linter that might lead to loss of funds or any other issue.

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

natrix-0.1.4.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

natrix-0.1.4-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file natrix-0.1.4.tar.gz.

File metadata

  • Download URL: natrix-0.1.4.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for natrix-0.1.4.tar.gz
Algorithm Hash digest
SHA256 60626c34b0441bb2418efeca38144c3a18feaf3340051e21de81473e2a4334bf
MD5 040b802e2fa1da5bfa26a13ca4c2c93a
BLAKE2b-256 a12a8732d954f8c0e4340b06489c24dcd63b78dd2ef6870204d232db2bb01835

See more details on using hashes here.

Provenance

The following attestation bundles were made for natrix-0.1.4.tar.gz:

Publisher: release.yml on AlbertoCentonze/natrix

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

File details

Details for the file natrix-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: natrix-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for natrix-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 422f4d28bbe491488624e208be00edf1dd9d7219523b64437f99c429e3863e4a
MD5 1a8412665484532c67271c44cb4f9d6a
BLAKE2b-256 fbd5909a17764f1af0b0f912ddfa6b2b4bbd94e1bf984e7479cd0e3b712e8b36

See more details on using hashes here.

Provenance

The following attestation bundles were made for natrix-0.1.4-py3-none-any.whl:

Publisher: release.yml on AlbertoCentonze/natrix

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