- 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.
Also add check that current version appears in CHANGELOG in `publish` recipe, so hopefully I remember to update the CHANGELOG for the current release when bumping versions, not afterward :P
- Switch to asciidoc, since it supports an auto-generated table of contents
- Re-organize into sections
- Document private recipes
- Document windows dependencies
- Document doc comments
The grammar now permits blank lines in recipes.
Note that inside of recipes, the token `NEWLINE` is used instead of the
non-terminal `eol`. This is because an `eol` optionally includes a
comment, whereas inside recipes bodies comments get no special
treatment.
Causes all recipe lines to be printed, regardless of --quiet or `@`.
Prints the name of each recipe before running it. Hopefully useful for
diagnosing problems.
If a `#...` comment appears on the line immediately before a recipe, it
is considered to be a doc comment for that recipe.
Doc comments will be printed when recipes are `--list`ed or `--dump`ed.
Also adds some color to the `--list`ing.
Fixes#84
Input may contain tabs and other characters whose byte widths do not
correspond to their display widths. This causes error context
underlining to be off when lines contain those characters
Fixed by properly accounting for the display width of characters, as
well as replacing tabs with spaces when printing error messages.
This is a pretty gross commit, since it also includes a lot of
unrelated refactoring, especially of how error messages are printed.
Also adds a lint recipe that prints lines over 100 characters
To test, I added a `--color=[auto|always|never]` option that defaults to
auto in normal use, but can be forced to `always` for testing. In `auto`
mode it defers to `atty` to figure out if the current stream is a
terminal and uses color if so.
Color printing is controlled by the `alternate` formatting flag.
When printing an error message, using `{:#}` will print it with colors
and `{}` will print it normally.
Surround variables with backticks, capitalize first letter of error
message, inflect properly depending on number of unknown overrides, and
improve wording.
Also added build dependency to `filter` recipe.