`cargo-limit` provides cargo command wrappers that only print warnings
if no errors are encounter, print the first warning last so it's easy to
see, and more.
This PR modifies the just recipe to use the `cargo-limit` versions of
commands where applicable.
Cargo limit can be installed with:
cargo install cargo-limit
This commit adds a `Loader` type, which can be used to load multiple
source strings. This was done to support the work on modules, but
coincidentally enabled consolidating errors, since now `Config::run`
can take a `&Loader`, and in the event of an error, return and `Error`
that borrows from loaded strings. Multiple error types have been
consolidated, and a bunch of ad-hoc error printing was removed.
Remove the `summary` feature and make the `summary` module always build.
It's a small module, so it shouldn't hurt compile times, and it should
prevent accidental breakages that are only caught on CI.
Add conditional expressions of the form:
foo := if lhs == rhs { then } else { otherwise }
`lhs`, `rhs`, `then`, and `otherwise` are all arbitrary expressions, and
can recursively include other conditionals. Conditionals short-circuit,
so the branch not taken isn't evaluated.
It is also possible to test for inequality with `==`.
Add a subcommand that prints out a space-separated list of the names of
top-level variables in the justfile.
The syntax is:
$ just --variables
a b c
This can be used for any purpose, but is mostly intended for completion
scripts, so that they can get the names of variables without using
`--evaluate`.
Additionally:
- Add `bin/generate-completions` script to regenerate checked-in
completions
- Update dependencies
- Regenerate checked-in completions
- Instead of changing the current directory with `env::set_current_dir`
to be implicitly inherited by subprocesses, we now use
`Command::current_dir` to set it explicitly. This feels much better,
since we aren't dependent on the implicit state of the process's
current directory.
- Subcommand execution is much improved.
- Added a ton of tests for config parsing, config execution, working
dir, and search dir.
- Error messages are improved. Many more will be colored.
- The Config is now onwed, instead of borrowing from the arguments and
the `clap::ArgMatches` object. This is a huge ergonomic improvement,
especially in tests, and I don't think anyone will notice.
- `--edit` now uses `$VISUAL`, `$EDITOR`, or `vim`, in that order,
matching git, which I think is what most people will expect.
- Added a cute `tmptree!{}` macro, for creating temporary directories
populated with directories and files for tests.
- Admitted that grammer is LL(k) and I don't know what `k` is.
Just's first parser performed both parsing, i.e the transformation of a
token stream according to the language grammar, and a number of consistency
checks and analysis passes.
This made parsing and analysis quite complex, so this diff introduces a
new, much cleaner `Parser`, and moves existing analysis into a dedicated
`Analyzer`.
Until github.com/rust-lang/cargo/pull/7333 makes it into stable rust,
we'll be forced to publish using nightly, due to our unpublished dev
dependency on `test-utilities`.
Checks that we build and pass tests with the minimal dependency versions
declared declared in Cargo.toml, as part of the `publish-check` recipe
run before publishing a new version of Just.
The generated man page doesn't look great by default, so this also adds the
help4help2man feature, which makes Just print a help message that produces
a better man page.
The old version often failed due to rebase conflicts if the feature branch to delete had multiple commits and was squash-merged into master.
This version just checks that the up-to-date master branch matches the feature branch and uses -D to delete the feature branch. This guarantees that we don't lose any work, and avoids bad rebases from squash merges to master.