Skip to main content

plain.code

Preconfigured code formatting and linting.

Overview

Plain.code provides comprehensive code quality tools with sensible defaults:

  • Ruff - Python linting and formatting
  • ty - Python type checking
  • oxlint - JavaScript and TypeScript linting
  • oxfmt - JavaScript, TypeScript, JSON, and CSS formatting

Ruff and ty are installed as Python dependencies. oxlint and oxfmt are managed automatically as standalone binaries (npm is not required).

Commands

plain fix

The most used command is plain fix, which automatically fixes linting issues and formats your code:

plain fix

You can also apply unsafe fixes or add noqa comments to suppress errors:

# Apply Ruff's unsafe fixes
plain fix --unsafe-fixes

# Add noqa comments instead of fixing
plain fix --add-noqa

plain code check

To check your code without making changes (including type checking):

plain code check

You can skip specific tools if needed:

# Skip type checking during rapid development
plain code check --skip-ty

# Only run type checks
plain code check --skip-ruff --skip-oxc

# Skip oxlint and oxfmt checks
plain code check --skip-oxc

# Skip annotation coverage checks
plain code check --skip-annotations

If plain.dev is installed, plain code check will be run automatically as a part of plain pre-commit to help catch issues before they are committed.

plain code annotations

Check the type annotation coverage of your codebase:

plain code annotations

This outputs a summary like 85.2% typed (23/27 functions).

To see which functions are missing annotations:

plain code annotations --details

You can also output the results as JSON for use in CI or other tools:

plain code annotations --json

Settings

Default configuration is provided by ruff_defaults.toml.

You can customize the behavior in your pyproject.toml:

[tool.plain.code]
exclude = ["path/to/exclude"]

[tool.plain.code.ty]
enabled = true  # Set to false to disable ty

[tool.plain.code.oxc]
enabled = true  # Set to false to disable oxlint/oxfmt
version = "1.43.0"  # Pin to a specific version

[tool.plain.code.annotations]
enabled = true  # Set to false to disable annotation checks
exclude = ["migrations"]  # Exclude specific patterns

For more advanced configuration options, see get_code_config.

Generally you won't need to change the configuration. The defaults are designed to "just work" for most projects. If you find yourself needing extensive customization, consider using the underlying tools (Ruff, ty, oxlint, oxfmt) directly instead.

FAQs

How do I install or update oxlint/oxfmt manually?

oxlint and oxfmt are installed automatically when you run plain fix or plain code check. If you need to manage them manually:

# Install oxlint/oxfmt (or reinstall if corrupted)
plain code install

# Force reinstall even if up to date
plain code install --force

# Update to the latest version
plain code update

Why are test files excluded from annotation coverage?

Test files (test_*.py, *_test.py, and files in tests/ or test/ directories) are excluded by default because they typically contain many small helper functions where type annotations add noise without providing significant value. You can customize this behavior via the exclude option in the annotations configuration.

How do I check a specific directory?

All commands accept a path argument:

plain fix path/to/directory
plain code check path/to/directory
plain code annotations path/to/directory

Installation

Install the plain.code package from PyPI:

uv add plain.code

Download files

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

Source Distribution

plain_code-0.23.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

plain_code-0.23.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file plain_code-0.23.1.tar.gz.

File metadata

  • Download URL: plain_code-0.23.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_code-0.23.1.tar.gz
Algorithm Hash digest
SHA256 8b890f13c949e52d2ee82cb829729cd5d42e2f5c4f11ea7fbb4f28d37ad60c64
MD5 b839a9da112a88cb431af129880c410e
BLAKE2b-256 5e0a84dc4de1fcf5cab2caf1445032741600b8a991c8215bccd9b94d4c783ef1

See more details on using hashes here.

File details

Details for the file plain_code-0.23.1-py3-none-any.whl.

File metadata

  • Download URL: plain_code-0.23.1-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_code-0.23.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b7f1a3985d20104fcaacf154d6b7dd053dda178fc71d4c7803e8e960792387f
MD5 9bf5d15f4716ca01b64d82193619b13c
BLAKE2b-256 c76a7e1953fd9c8312646113404a1622b0c069fc646eb84c2ca4a2c076cdf664

See more details on using hashes here.

Release history Release notifications | RSS feed

0.24.0

2 files

This release

0.23.1 This release

2 files

0.23.0

2 files

0.22.0

2 files

0.21.8

2 files

0.21.7

2 files

0.21.6

2 files

0.21.5

2 files

0.21.4

2 files

0.21.3

2 files

0.21.2

2 files

0.21.1

2 files

0.21.0

2 files

0.20.3

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.0

2 files

0.18.1

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page