Skip to main content

Badness

Build and Test Lint Documentation Open VSX VS Code License: MIT

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 written in Rust. Build from a checkout:

git clone https://github.com/jolars/badness
cd badness
cargo install --path .

VS Code extension

If you use VS Code or a compatible editor (such as Positron or Cursor), install the Badness extension from the VS Code Marketplace or the Open VSX extension. It 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, with sentence/semantic planned). 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.7.0.tar.gz (1.1 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.7.0-py3-none-win_arm64.whl (2.9 MB view details)

Uploaded Python 3Windows ARM64

badness-0.7.0-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

badness-0.7.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.7.0.tar.gz.

File metadata

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

File hashes

Hashes for badness-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c970c78f56fea20761a0324f8a8d0ca9899137a903215bc24b280a52a794d41d
MD5 8b5048348b535d874d8f3a20bc9fdac0
BLAKE2b-256 741b16af96b8e186cd7c3f4916c88eab26823298d6d88f5705b04c2e778460d4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.7.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.7.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 eb18dc4a0e2cc0c5a8c7c08082923fb0c917278274b991fc2a9117ddcad35301
MD5 b786a01a7c2841db69dac6a732386f21
BLAKE2b-256 6eab93e4c5052cc85e99fd46af51006ec324049fb340fd3eb222f83c3875c116

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.7.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.0 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.7.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a2f858e26c70934a19341a3704b18d585c19ca5b40c5aa33b88704b6fefff27e
MD5 ef03f43a0bcf4e4a2f839f7a65ad9ece
BLAKE2b-256 5c0843d2c2bcedaa04af080914de2d40e5c9bb3936d98da65c6fe97feb2867d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a8d043e7ea496cf1a1e8dbf2bcdbac07e38b6b3259587b41d2e4112ad88b6711
MD5 76af76e2bbac6fb4811d8c63ae1232da
BLAKE2b-256 ae10f98ca780189d13e8842f5cb7d175b1f5525d278e3a9b67b834eef0365ec8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 af40ec3966dc48a6bc7b46857217cc2679fb9eb7f34d5c128c97c1920a8b5dd0
MD5 6cc9035c4ffb69d83a4f185d41aeec54
BLAKE2b-256 bee8ff926ea18efd553227353cb6209abab66edf19373a3ba2e4352d069ae209

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24e7725bd018e6cfe00ce52f113c97c068bca5cc2c13dfac3bfc922770bbf7a7
MD5 de90ed40286c8d1bff7fae065ddd7617
BLAKE2b-256 0143ff5734de02dc620b39b77240b99e897dd3e6eec8febc4b02db4a430d1bc1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f81668cf3e6dfbcf0bbb01d02b03db1ab3fb9a090db6bb6b450740d0f0fd0df5
MD5 05ab8e4044a8198797e2dd1aa35c89f4
BLAKE2b-256 bc91142875d5bca2dd051c641815cdf9725348a05be84ebb4c1fa8aedf792290

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a57b44ed62b488c77bf6ffe6097f4045aa0c11ea157498eee55f28eb72e48cdb
MD5 8b90fa006a75040e8bed38bd92a2c1f8
BLAKE2b-256 e187271eb08b7012c49572d961560a2dc086bbd1f3634be4dd34190d98a33ef8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.7.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 066bec0ff05d6b12ae0d5be99dc4a7cab832f708c58834e709397b4dfa3b74a4
MD5 3664748b61d3950d1f9d4b6dd8f4f544
BLAKE2b-256 98f7d60876f3c655e74d550aa050c7c5742dc8a8b5b16465878aedaf63c81d9f

See more details on using hashes here.

Provenance

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