#cargo #neovim #filter #wrapper #dedup

bin+lib cargo-limit

Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc

8 releases

0.0.9 Oct 14, 2021
0.0.8 Mar 22, 2021
0.0.7 Feb 16, 2021
0.0.5 Jan 28, 2021
0.0.2 Sep 14, 2020

#114 in Cargo plugins

Download history 10/week @ 2022-03-04 33/week @ 2022-03-11 40/week @ 2022-03-18 15/week @ 2022-03-25 4/week @ 2022-04-01 17/week @ 2022-04-08 6/week @ 2022-04-15 19/week @ 2022-04-22 23/week @ 2022-04-29 52/week @ 2022-05-06 139/week @ 2022-05-13 30/week @ 2022-05-20 65/week @ 2022-05-27 72/week @ 2022-06-03 9/week @ 2022-06-10 3/week @ 2022-06-17

150 downloads per month

MIT/Apache

77KB
2K SLoC

cargo-limit

Crates.io

Cargo with less noise:

  • errors have highest priority
    • they never appear in the middle of warnings
    • warnings are skipped by default until errors are fixed
    • all dependencies' warnings are skipped by default
  • all messages come in reversed order by default
    • to avoid extra scrolling
  • messages are grouped by filenames
  • number of messages can be limited
  • after encountering first error the rest of build time is limited by default
  • files can be automatically opened in your text editor on affected lines

This tool is especially useful in combination with cargo-watch.

asciicast

Installation

From crates.io

cargo install cargo-limit

From git

cargo install --force --git https://github.com/alopatindev/cargo-limit

Usage

Run any of these in your project directory:

cargo lbench
cargo lbuild
cargo lcheck
cargo lclippy
cargo ldoc
cargo lfix
cargo lrun
cargo lrustc
cargo lrustdoc
cargo ltest

Also llcheck, llrun, etc.

Neovim and other text editors/IDEs integration

See here.

Environment variables

  • CARGO_MSG_LIMIT
    • limit compiler messages number
    • 0 means no limit, which is default
  • CARGO_TIME_LIMIT
    • cargo execution time limit in seconds after encountering first compiling error
    • 1 is default
    • 0 means no limit
  • CARGO_ASC
    • show compiler messages in ascending order
    • false is default
  • CARGO_FORCE_WARN
    • show warnings even if errors still exist
    • false is default
  • CARGO_DEPS_WARN
  • CARGO_EDITOR
    • opens affected files in external app
    • empty ("") means don't run external app
    • "_cargo-limit-open-in-nvim" is default

Why "limit"?

Initially it was just a workaround for this issue.

License

MIT/Apache-2.0

Dependencies

~2–3MB
~62K SLoC