Skip to main content

A language server, formatter, and linter for LaTeX

Project description

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.

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

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

badness-0.5.0.tar.gz (745.7 kB view details)

Uploaded Source

Built Distributions

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

badness-0.5.0-py3-none-win_arm64.whl (2.3 MB view details)

Uploaded Python 3Windows ARM64

badness-0.5.0-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

badness-0.5.0-py3-none-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

badness-0.5.0-py3-none-musllinux_1_2_aarch64.whl (2.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

badness-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

badness-0.5.0-py3-none-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

badness-0.5.0-py3-none-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file badness-0.5.0.tar.gz.

File metadata

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

File hashes

Hashes for badness-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bc2460bfdf5d4280da954effdd47fbce14d0b08a389e250793f4dfca1ea8d2cc
MD5 aea4a0bcda3560e013e0fad4a0848ad5
BLAKE2b-256 3d07972c7894f8abd5ec9db0a09499821e5070637fd21e8a9adfc24da9e1c09b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.5.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.3 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.5.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 2a34ea7cdf813a175753b07fde12984751f6b497fee9d56bfaafd3206648fdbf
MD5 a326d0b00a9fa525ddcdf6c95ff191d0
BLAKE2b-256 6dc452460828e9be83a0aa2cdf7279cec35dac99a07abfa775aa303937bfbba0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.5.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 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.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9ee5950d28e45125371056619d713f67c007686417456d2e92188d463484cbd4
MD5 5475a241e37a59f5b55b742daed27554
BLAKE2b-256 a15a71a94abc0bd0145e80118fe73b651d0f02674e278623def48e91d7c63372

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cc0ab9402a84d9de1440a9fb9e0f742c068b6120e095a28b6c87337b51240bff
MD5 b0273d32fbbd4a8d350c0f1802fa054a
BLAKE2b-256 d474c6292ed2b879d5a15859d9429e124608dc65d0387e31335fe0314a89c3c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5bbb800844730ec0c761e13d3c367326f562a0f478a07d37e0da964f3dda74b5
MD5 fdcefa1ac06e0a180c2073b129596ccc
BLAKE2b-256 473e060e7df63e3a12654a98229bc3734830bba7b21197c59335f1f343b68d80

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67cfe6dcb799498d5e93c310a160f551695991238036e00eadbc44dcc2d6e22c
MD5 955c7f9548290ee8e59a59f75695a6af
BLAKE2b-256 d9fe17858fdd2da808a35b2bcdba88d7ff1b7c9cf59084a2f3ec7d28f12c587d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 534eb5627d971f50656ca8fd151b4996d03f5d60d52285711c6d6a129da91dcb
MD5 d7134a2d17316cd3bcf4dceb068c9b4d
BLAKE2b-256 b6dc88ba040bec5aab4b2e9f380a37ecc31f3832cf42c15392c6a8e8a8d17287

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8842f12e582ce548e3300efa46894b3880daf6ad64aa268d2d81c5d858cedd39
MD5 fac97ed09b818062c3859e36c67ef0fb
BLAKE2b-256 6c892e6ac8415ba2e98f6603ccc3b0bfe375405428a2a416f56e1559ed1a6b27

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.5.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 22feaed6144ebd9e6f6bfe7cd436fd7cd10e0457e3c1230dd025382a5311cea4
MD5 48d0e063a5fd4b1c516e1389f93c2e6c
BLAKE2b-256 24b754fd1566a62b7eebfa3c9eb7cf5bcc29320a35192739f2b12c9cc3b2464c

See more details on using hashes here.

Provenance

The following attestation bundles were made for badness-0.5.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 Pingdom Monitoring Sentry Error logging StatusPage Status page