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.3.0.tar.gz (556.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.3.0-py3-none-win_arm64.whl (1.8 MB view details)

Uploaded Python 3Windows ARM64

badness-0.3.0-py3-none-win_amd64.whl (1.9 MB view details)

Uploaded Python 3Windows x86-64

badness-0.3.0-py3-none-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

badness-0.3.0-py3-none-musllinux_1_2_aarch64.whl (1.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

badness-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

badness-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

badness-0.3.0-py3-none-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

badness-0.3.0-py3-none-macosx_10_12_x86_64.whl (2.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: badness-0.3.0.tar.gz
  • Upload date:
  • Size: 556.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.3.0.tar.gz
Algorithm Hash digest
SHA256 34596b9841fac63872157a2f31af7d85ae102e14d0fd8a0166973412cfd6bf51
MD5 a181dc25169a5746b8cd8e92815af149
BLAKE2b-256 4d7e4c1ece61f485dbd02a3fe177a96bba17082f96c48694f7a8c47c6e20709d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.3.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 1.8 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.3.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 2a522bf91ead7fb6c002f4471dc3785a3f0af222df5931f5f73b9d88dab5fb85
MD5 57beb3322ab55786779cd49be76a6a90
BLAKE2b-256 3444a8ffae23ced58e2fd9aa9e605020737306c15c88137f85290d1248ad0ae1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: badness-0.3.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.9 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.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 734c9a63bd5c0f3281b81bd947aabf0ec0476a176000d4dbd561076974a09eb9
MD5 468c9d1a17e746980f012df614846163
BLAKE2b-256 d82aa3fbaad2473194b6bf703074a46b51ffa85dff7c3c89e964166e7d41dc19

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 876baeac4d8a6833431ce55f57c439d42a07b54e71e5420b1ba395ee0b50b1b1
MD5 936b6a9fea809e8eec0936c93d239f8a
BLAKE2b-256 d6b05f377ecdca428357373fb65696ba7e66a7483b63bab91f51038075b9e346

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3c367644fe836f7fb094740cbde6bc94ac251742cbf14ae689e07588660a2261
MD5 2ba4ed8637acfe19d2f9ca9a13986b6b
BLAKE2b-256 ce556c7e9871f5f8c22d683bbd33c49e19bb418c3d6734beb66f0ef19abe3752

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 182f2fa2d31cdae6907419d972c9134b9fcb9a3998d8f27d123bfce8812f4fef
MD5 6164b658d25a4a438845bc87c9d76651
BLAKE2b-256 78bda6333055a7c3983f34c8a997557df8a5d3a87da6fbc1ee6d4ea626d30e1e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0d07d642bf63b5fee5d2012ddb48432ca18e91015ae552cc369a517184bfc6c2
MD5 8cb712036d4d2820de8874fe53a70e7f
BLAKE2b-256 f9eea97031c84ca45f3b28ed5fc31add4ffa779342b88242909dce6e5fdf48b1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 766e9d44de83217bdd96ae4aad44a68705ce34165694477b8c3f5391b90cedef
MD5 3c3864cde6dc41a6d12a9063b512a838
BLAKE2b-256 7ff797b279493a13b651b8eaa9f0d5be547f026e62c22e5f66870ec0f6319f82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for badness-0.3.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b18a4e3b794d7627cd301fba0851cc74acf81e4a02007cf261cec71e23d8bd04
MD5 e0652aa2bb1af1499bbcd78129e07565
BLAKE2b-256 b9501fd6c229e36caf1da16a749a1ddecb9481b747776dd3a43eada58383fc99

See more details on using hashes here.

Provenance

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