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.8.0.tar.gz (1.4 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.8.0-py3-none-win_arm64.whl (2.9 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.8.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.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

badness-0.8.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.8.0.tar.gz.

File metadata

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

File hashes

Hashes for badness-0.8.0.tar.gz
Algorithm Hash digest
SHA256 b7310d593f7f05a0a9eb26db3a799971105a50e9426c7a08494143a0359ca508
MD5 53a6f77b016c9a39e3a13cb20a836f21
BLAKE2b-256 8cdcea9670d47a6440c2d2812280cf11abe5bff2cfd83c6b34f932244e9f2557

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: badness-0.8.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.8.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 0fca20977940f061d0e189b9be6e27380e5738a16a7edc2b69aa03fe0d5b4e70
MD5 41e2f8d509d2fc6aa985581ffd5ed8a4
BLAKE2b-256 b117ac57c4db1ae064a42a9dd6c96b35682156f56c842cb4dfcfe51c72030033

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: badness-0.8.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.8.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b93db85fe54029e34ff74cc90673121b5b15bc86edf7bc2db810c61582678893
MD5 73eb408183b0fa2deb6cfcf10da07248
BLAKE2b-256 6efc6411d8944f0a4419a343393eb20ec566055e4263eb52996eef2493eac51a

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 28c0930f9fe766603323d1b9c7d048df269d37f1a1a22d5dd83942656cdf83a7
MD5 d6dede72a1c97f6cf9637f664a4b2c80
BLAKE2b-256 a8edea6c1abcf6bd7b174ffc3d760c1b80de11edc1f8573d72e221281150d0ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3c0b2956fe895fb58ee3b63fef030e624ef0b2ce507e5c6192c6cd247b897c0e
MD5 6b2dcaf2bd5ee1d1a1b0e90773bf8201
BLAKE2b-256 10c9309097f1f03797cdd831e67257deff2eeff6a0abc969c620e71aa152a588

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65c836299abf3c3ebd09d31b38dad6a475f1d8c24136cec958583c3ef5b7d377
MD5 14bc27824363c82308b041cf7bde8395
BLAKE2b-256 8df1cac43aad8970c5e34f86dec2c6ed1c2da0e30fea9b5cf45a2cac35eec479

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aabd641403e151438a6bbc3e1d077a9870f20e840c91b882a42f16ea0f880f13
MD5 295ac4cae15b3886dc823b6168417443
BLAKE2b-256 efc23acc728a060e65841ae4db64b2434151d99f3be87be01e2eac8e36c62449

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6f4fb16eb7835a44b330093c6cd26c1dc8e06da97ad6c71d771b3a4e218bb987
MD5 011cd147dc1bbfbaf47d0cf524c2cdf3
BLAKE2b-256 1a694fc2db742122e6755abf9fce40d69f5aca009502d5eb2e8e7ef62bd4dfe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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.8.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for badness-0.8.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 24f394dbf19157a5179991e7f5a48d88dfd2a422c34a9a94f8c8d4e2ec411b61
MD5 fddbfbdfe9b61b59859862fd23a6d517
BLAKE2b-256 09a6fe6314b705b3de0fd171f0d47c96916b63c77edea3b019b023093fc62bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.8.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