Skip to main content

An LSP, formatter, and linter for LaTeX

Project description

Badness

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

Badness is a formatter, linter, and language server 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://jolars.github.io/badness/ (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.4.0.tar.gz (683.9 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.4.0-py3-none-win_arm64.whl (2.1 MB view details)

Uploaded Python 3Windows ARM64

badness-0.4.0-py3-none-win_amd64.whl (2.3 MB view details)

Uploaded Python 3Windows x86-64

badness-0.4.0-py3-none-musllinux_1_2_x86_64.whl (2.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

badness-0.4.0-py3-none-musllinux_1_2_aarch64.whl (2.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

badness-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

badness-0.4.0-py3-none-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

badness-0.4.0-py3-none-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for badness-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4d181661af86b5401fa0e7303e9d8eb4a28cc72d7c02025f80cb7f4e7f3b4caa
MD5 8e932eab6381c69a313a14e8690893f0
BLAKE2b-256 7af45a623d2e198e30b5cf731bff033a4e989641fb763fd9bbf3d3fb3a31a268

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.4.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.1 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.4.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 9bfb5e463fca16c61b453d626198c3b33db9076f2b647fab4a506bffceb79541
MD5 6b6bb5d2889a3973d7eed05ac90b89e9
BLAKE2b-256 780051e1ce26fd85b5952d5a7abc7c848fd8a482abb4ef2e6ab12c9c98541cbc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.4.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.3 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.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6b43ca43f1d2f18d832ee568e11a42a3e7d81b1dda00124e46e96864ac41fccd
MD5 f0173278890d05b1a5da6abf8843605f
BLAKE2b-256 9e1a4e25ee34f6832ed5438a8158dd1c4e53e89e266621de2cce3956601e4364

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6279854c55893497dfc881ee86a889c57c7c36a5731568a4605848d24654ee75
MD5 2b9bda90faf69b58ef2d207a9a4f6944
BLAKE2b-256 78e70ca0c7662c316550cb530dda073f48160afbde461ac0d92d1ae4929d5e0f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5f0889a382ea511c67577a0dd3e03ecbbf4614d67d023c0e1f7bc19e0ffb5935
MD5 7bfeaf613bfd871d213faa78064265ce
BLAKE2b-256 6cb78881176c328705741ba712485537159fc1a506450805ca7193e390abf7df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c66fcdc4968df90022afae5291be7e88d30d942d339f4c8a0678d9b6f9b8001
MD5 342a51fff4533ef7ac8029173867206f
BLAKE2b-256 fc8a9a330093994244d53a90b8aafba6b5c6f048f1f7c19cd63bf47f75646e89

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b6e432c12414cf0959f7e0a2e1e72b130bf3af038222fbbbe7edab87aefcba4e
MD5 a2ca82b4cb77866ba9e137f5144792b7
BLAKE2b-256 c333d72451f18ef2e48b5b659de553d583bf745ace26002336986c42834baf5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a30e3a0ffcfccc8b8948284ed171bbad97ea09d04ed33530181c23a30b5dfd5f
MD5 53145834478682bc50e5b70c1536409a
BLAKE2b-256 ddd25afce06f16bd405904976554908901c6c89f293bef1c9ef87d9d86fa5f6f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.4.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e2ef72ddbb9b1cc9cf09c2188286f85b4a438de81e8593059820c1595d3f9695
MD5 6ed613947d341094aecbcd782189fc83
BLAKE2b-256 5799f407e039e09dd3813ca3ac96b089bd4e65cabce978f141beaa6b8e5fc669

See more details on using hashes here.

Provenance

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