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.2.0.tar.gz (314.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.2.0-py3-none-win_arm64.whl (877.4 kB view details)

Uploaded Python 3Windows ARM64

badness-0.2.0-py3-none-win_amd64.whl (919.5 kB view details)

Uploaded Python 3Windows x86-64

badness-0.2.0-py3-none-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

badness-0.2.0-py3-none-musllinux_1_2_aarch64.whl (1.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

badness-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (963.5 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

badness-0.2.0-py3-none-macosx_11_0_arm64.whl (949.5 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

badness-0.2.0-py3-none-macosx_10_12_x86_64.whl (982.8 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: badness-0.2.0.tar.gz
  • Upload date:
  • Size: 314.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.2.0.tar.gz
Algorithm Hash digest
SHA256 e1d924b3b3654d7153a594f5967dd1cc7f64559f89fbc4706455c0dd79993385
MD5 00e01c45b9f0c754b278f776d0a8f6b5
BLAKE2b-256 320f48fe517a22102a7be7739328e8cdc44e40c28398d8cd52047a5b34d06fb1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.2.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 877.4 kB
  • 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.2.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 60f3321cbdc14c1533f020648d0ea5cabc0de50dbe318e6d241e892c1d7c1fbd
MD5 6658c04aad228a6ef64e9e114e9805df
BLAKE2b-256 13df2328b49b501806a9872fc25ee42dc6cc3465dc3edade484bb21f0bcebea4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.2.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 919.5 kB
  • 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.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b5ce4e5ee719dadc5e50862d28887a7bc75e95e6086251e4cb2b0df27bdeb7a7
MD5 d276263c1c9d68117dc97404158bfd06
BLAKE2b-256 4e8b6eaec94183c79e210ab7958c0ec255516a938b11921b231b4dc49f616676

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bbc4370a31b96e3d1ebd0ca0e8aaa8b27ce6057cb875054961a6942716e66d16
MD5 ad294b451d71c29fed5a6e4de5f52644
BLAKE2b-256 efc116e8bfc00eaba233572f703dbd48e9b2d6853415304e20364c609d43df79

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0a5375285585e4e3287edaf86cd1f21d6633a7a7df981d1681658fa9cf7fb9ab
MD5 b4fa65624d2a137b6c27a20bfb2bfced
BLAKE2b-256 27675643272c580bb52ebb67a720f580b988ac6d8c9ab1f7939ce0048918ff11

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 579c25e035c15fa0db1f726edebe9e814bd82dc743d46ad2162a742f50a3f94b
MD5 1c9b7330f6ac55466a864cd12d0fa33e
BLAKE2b-256 34857d4e59145f847ffe8515b13d2cd6ad16ce5377e9ea42b64678aef3d983c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 33a61adf661ca27d48786620016cf3d0159c06ac3ca031105332018299bda9ff
MD5 325e3ead2568ab50ea7d0dc697e13a5c
BLAKE2b-256 33bfa43dcd60af7817d049fead864e0ad4d70b64cd7199079fffc515da10ff40

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 008ef5e984e75ba6a40885f1e25e5d5ef6e6a35470a459cfa660431c6e09d5a8
MD5 49a470d2cc237f0325cf877a4ac2ce87
BLAKE2b-256 00ce21556bb4fb63cfe196a647252138f01573e7dd79e89dafbcbbcc4a33c1a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.2.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fe9989b55e2acb700d32505cff347b7f512b3d0250eab263af3c6f5fa67977c9
MD5 437ba377c5599ebee400a36a56c52584
BLAKE2b-256 0233ef3ab78249b59933cd146b6177c949e7444c1fd57efaa8ec3f8588abcd57

See more details on using hashes here.

Provenance

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