Skip to main content

Badness

Build and Test Lint Documentation Open VSX VS Code

Badness is a language server, formatter, and linter for LaTeX, built on a lossless concrete syntax tree.

It parses LaTeX once and serves three tools from that tree:

  • Formatter (badness format): deterministic, rule-based layout.
  • Linter (badness lint): diagnostics with source snippets.
  • Language server (badness lsp): both, live in your editor.

The architecture follows rust-analyzer: a generic, error-tolerant, hand-written parser produces a lossless tree, semantics are layered on top as a separate concern, and recomputation is incremental. badness never requires resolving macros or catcodes to succeed—anything it cannot statically recognize degrades to generic nodes rather than a crash. Two properties hold by construction and are enforced as tests: losslessness (the tree reconstructs the input byte-for-byte) and idempotence (formatting an already formatted file changes nothing).

Installation

Badness is available from several sources:

  • crates.io: cargo install badness
  • npm: npm install -g badness (bundles a prebuilt binary)
  • PyPI: uv tool install badness/pipx install badness
  • Prebuilt binaries: from the releases page
  • VS Code/Open VSX: the Badness extension (also works in Positron and Cursor)
  • From source: cargo install --path . in a checkout

The VS Code/Open VSX extension bundles the badness binary and starts the language server automatically when you open a .tex file.

Usage

# Format a file in place (or stdin → stdout with no path)
badness format paper.tex

# Verify formatting without writing—exits non-zero if anything would change
badness format --check paper.tex

# Lint, reporting parse diagnostics
badness lint paper.tex

# Run the language server over stdio
badness lsp

Formatter style is set through flags: --line-width (default 80), --indent-width (default 2), and --wrap (reflow by default; also preserve, sentence, and semantic). Persistent settings live in a badness.toml. See the documentation for the full reference.

The language server runs over stdio (badness lsp); see the editor setup guide for Neovim and VS Code wiring.

Documentation

Full documentation lives at https://badness.dev/ (built with mdBook from docs/).

Contributing

Architecture, tenets, and conventions are documented in AGENTS.md, written for both human and AI contributors. In short: keep the syntactic layer free of semantic knowledge, every parser feature needs corpus and snapshot tests plus a losslessness assertion, and code stays rustfmt-clean with clippy warnings treated as errors.

License

MIT

Download files

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

Source Distribution

badness-0.9.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

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

badness-0.9.0-py3-none-win_arm64.whl (2.9 MB view details)

Uploaded Python 3Windows ARM64

badness-0.9.0-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

badness-0.9.0-py3-none-musllinux_1_2_x86_64.whl (3.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

badness-0.9.0-py3-none-musllinux_1_2_aarch64.whl (2.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.9.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

badness-0.9.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

badness-0.9.0-py3-none-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

badness-0.9.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 badness-0.9.0.tar.gz.

File metadata

  • Download URL: badness-0.9.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for badness-0.9.0.tar.gz
Algorithm Hash digest
SHA256 462b5a858227a60f617128bee151614526c98d1d371bc695cf4a9b8042a625fb
MD5 aac5d4dc919047ae1928fb3dd9692d41
BLAKE2b-256 4e29b757ac47ca81d5f36a076b3d9bab661324cba7fec2579dfdc05171a7fab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0.tar.gz:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: badness-0.9.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for badness-0.9.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 428683e29a117e86a69ffd6b37a9293c1b6822a2f895eeb3ae262f2826a1322c
MD5 764fddb2b7955663d0d41e871dd438cd
BLAKE2b-256 16a5418784e6b065bab5017a0e9732cc8536c72c84c4725626cf5e6ec2f6ae43

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-win_arm64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: badness-0.9.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/6.1.0 CPython/3.13.12

File hashes

Hashes for badness-0.9.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2dd032c6a687f0babe334df9a7a2c37688624cbfd799231c75e786637c430d76
MD5 da0993db736b3837f292cb210e714c02
BLAKE2b-256 720d1c07a77a915e0e03c1d88be83f25c65c07e5f11c2cf4e9fff12230fc176a

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-win_amd64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 875255ddd0ecef465ca66b9af630426423e59246597060821cc95daee0d8a3bc
MD5 7334b6a0d399a2af1241c6a4ac8e6075
BLAKE2b-256 328c7295bc5b5c847ca6a628e55862ef25bde421cede5f2df5ab5cc3b23f4c55

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 20c7d359a0c6b2fc9b9399ee926e480af862f081bf077efa5d6ce7d13b20ab6c
MD5 3c04a0057ff3c7cd280fce3109570f0e
BLAKE2b-256 a20f07f120a7a9de4c52af5c6f3a9acf405be148173d4b4079e4a8123011c552

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-musllinux_1_2_aarch64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 395c401988b6980821fb9727c7a4c47ff5f50b5a965090a7c20d3eefffca75eb
MD5 343c0e490cd6ccffd8e91363500035b8
BLAKE2b-256 4f4ff536742ca4290abdbeedbafefc63fad5c7742899e8a9b34fe3cbdbcf55bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d9c40cf69fbb4ce4a383248f69558f5a205b0c38d72023fd41e32510ef575b22
MD5 f8cd264306f32609feb31704d70a48b4
BLAKE2b-256 92c935dc8b3236201a80e70d5a3bbe90bdfec6c9ff7f1a6b7baf46525404f1f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f4bf01165bb602a76593a958d967fae48b78fce6efc825bf21aba23f637d730
MD5 0f1b51469ef938921abf4a7335f3b292
BLAKE2b-256 cda915067e1594cd5eba6a486093de30c8703688d630791767cf712bfd62a255

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on jolars/badness

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

File details

Details for the file badness-0.9.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.9.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8c905f4ea8a7f3a221aae983f52d8a9a2415f72541d19a06513baa377c8a5d38
MD5 542bad1f7ba1f938809987fa4396f6b3
BLAKE2b-256 1b3f3d86201dd1248866aa5e1d3a812f30bd6e043fedcda4c169160c4d59217e

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.9.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: publish-pypi.yml on jolars/badness

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 Sentry Error logging StatusPage Status page