Commit Graph

17 Commits

Author SHA1 Message Date
Casey Rodarmor
fec979c2c6
Reform and improve string literals (#793)
- Combine and simplify string and backtick lexing.
- Allow newlines in strings and backticks.
- Add triple-delimited indented strings and backticks. Common indented literal non-blank line leading whitespace is stripped.
- If a literal newline is escaped, it will be suppressed.
- Backticks starting with `#!` are reserved for a future upgrade.
2021-04-05 21:28:37 -07:00
Casey Rodarmor
da97f8d7dd
Allow evaluating justfiles with no recipes (#794) 2021-04-05 21:17:53 -07:00
Casey Rodarmor
dd578d141c
Unify string lexing (#790)
Unify lexing of backticks, cooked strings, and raw strings. Also allow
newlines in backticks and cooked strings, since I can't think of a reason
not to.
2021-04-04 16:41:02 -07:00
Casey Rodarmor
78b67f6cae
Test multi-line strings in interpolation (#789)
The behavior here is strange, and unintentional, but not obviously wrong.
Add a test to make sure I don't accidentally break it in the future.
2021-04-03 19:59:13 -07:00
Casey Rodarmor
e4ebf6dad9
Warn if .env file loaded and dotenv-load unset (#784) 2021-03-30 17:30:32 -07:00
Casey Rodarmor
10282bd636
Turn = deprecation warning into a hard error (#780)
It's been around two and a half years, and many versions, since this
warning was first introduced, so it feels reasonable to finally turn it
into a hard error. It will remain a special-cased error for a little
while.
2021-03-28 23:39:23 -07:00
Casey Rodarmor
18b9799e8d
Add dotenv-load setting (#778)
The `dotenv-load` setting controls whether or not a `.env` file will be
loaded if present. It currently defaults to true.
2021-03-28 22:38:07 -07:00
Benoit de Chezelles
13e9f406c8
Add just_executable() function (#775)
The `just_executable()` function returns the absolute path of the
currently running `just` executable.
2021-03-28 15:44:02 -07:00
Casey Rodarmor
6f42c8b737
Prefix parameters with $ to export to environment (#773)
If a parameter is prefixed with an `$`, it will be exported as an
environment variable.
2021-03-25 18:35:24 -07:00
Casey Rodarmor
b66a979c08
Add set export to export all variables as environment variables (#767)
Add a setting that exports all variables by default, regardless of
whether they use the `export` keyword. This includes assignments as well
as parameters.

Just does dependency analysis of variable uses, allowing variables to be
used out of order in assignments, as long as there are no circular
dependencies.

However, use of environment variable is not known to Just, so exported
variables are only exported to child scopes, to avoid ordering dependencies,
since dependency analysis cannot be done.
2021-03-25 17:00:32 -07:00
Casey Rodarmor
86c2e52dc6
Suppress all output to stderr when --quiet (#771)
Suppress all warnings and error messages when `--quiet` is passed.
2021-03-25 16:51:29 -07:00
Casey Rodarmor
d3b277c04c
Allow escaping double braces with {{{{ (#765) 2021-03-24 19:46:53 -07:00
Casey Rodarmor
bac851ff68
Add options to control list formatting (#753)
Add the `--list-heading` option, to override the heading text printed
before a list, defaulting to `Available recipes:\n`, and
`--list-prefix`, to override the indentation before each list item.
2021-02-09 01:00:20 -08:00
Casey Rodarmor
bdf1c92251
Automatically track expected tokens while parsing (#711)
Remove all manual tracking of which tokens would have been accepted by
the parser in favor of having the parser add tokens that it checks for
to a set of expected tokens, clearing them when it accepts a token, and
using the current contents of the set in error messages.

This is a massive improvement, and will make the parser easier to
modify going forward.

And, this actually solves my sole issue with hand-written parsers.

Thanks to matklad on reddit for suggesting this!
2020-10-25 19:37:26 -07:00
Will Speak
9bd0720aa1
Allow suppressing failures with - prefix (#687)
If a command in a linewise recipe is prefixed with `-`, then the exit
status is ignored and execution continues.
2020-10-03 13:54:19 -07:00
Casey Rodarmor
9d0246998d
Add the --choose subcommand (#680)
The `--choose` subcommand runs a chooser to select a recipe to run. The
chooser should read lines containing recipe names from standard input,
and write one of those names to standard output.

The chooser defaults to `fzf`, a popular fuzzy finder, but can be
overridden by setting $JUST_CHOOSER or passing `--chooser <CHOOSER>`.
2020-09-17 19:43:04 -07:00
Casey Rodarmor
55985aa242
Combine integration tests into single binary (#679)
Combine all integration test binaries into a single binary with the root
in `tests/lib.rs`. This also turns of automatic test discovery, so
when adding another set of integration tests, a mod statement will need
to be added to `tests/lib.rs`.
2020-09-17 17:59:46 -07:00