Commit Graph

83 Commits

Author SHA1 Message Date
Greg Shuflin
687831816d
Allow multiple attributes on one line (#1537) 2023-01-27 07:54:24 +00:00
Josh Soref
50f3750842
Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
Casey Rodarmor
157862d398
Merge imports (#1462) 2022-12-28 04:16:18 +00:00
Greg Shuflin
fbe1c4c7a3
Allow private attribute on aliases (#1434) 2022-12-20 00:44:19 -08:00
Cameron Steffen
216df31543
Eliminate lazy_static (#1442) 2022-12-15 16:53:21 -08:00
Casey Rodarmor
73777f7183
Add OS Configuration Attributes (#1387) 2022-10-31 00:52:03 -07:00
David Matos
beeaa6ce2d Add tempdir setting (#1369) 2022-10-25 16:57:32 -07:00
Gökhan Karabulut
8b7640b633
Add [no-exit-message] recipe annotation (#1354)
When a recipe wraps cli tool and the tool exits with a non-zero code,
just adds its own extra exit error message along with the messages
from the tool. Introduce the `[no-exit-message]` attribute to suppress
this additional message.
2022-10-25 16:32:36 -07:00
Casey Rodarmor
28be873dfc
Require set fallback := true to enable recipe fallback (#1368) 2022-10-19 19:00:09 -07:00
Greg Shuflin
e445cfb47d
Add skip-comments setting (#1333)
Add a new setting "skip-comments", which defaults to true. If unset,
this causes lines internal to a non-shebang recipe beginning with the
character '#' (including '#!' internal to a non-shebang recipe; that is,
any such instances occurring after the first line of a recipe) to be
treated as comments of the justfile itself. They will not be echoed to
stderr when the recipe executes.
2022-10-05 00:32:30 +00:00
Casey Rodarmor
c115b3f317
Allow fewer lints (#1340) 2022-09-11 09:25:38 +00:00
Greg Shuflin
7b7efcabc2
Fix issues reported by nightly clippy (#1336) 2022-09-11 08:41:24 +00:00
Erik Krieg
154930cc8a
Allow constructing absolute paths with / operator (#1320) 2022-09-11 07:48:02 +00:00
Casey Rodarmor
baaa8cb194
Allow comments on same line as settings (#1339) 2022-09-10 15:19:49 -07:00
Nick Kocharhook
e1f729efbc
Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
Casey Rodarmor
a46be41699
Add / operator (#1237) 2022-06-25 09:39:06 +00:00
Evan Richter
bfceb8f9c9
Prevent unbounded recursion when parsing expressions (#1248) 2022-06-22 15:00:13 -07:00
Casey Rodarmor
01fae9b1e4
Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
Casey Rodarmor
c24a194602
Add windows-shell setting (#1198) 2022-05-31 13:01:59 -07:00
Casey Rodarmor
c87909c220
Fix a bunch of typos (#1204) 2022-05-29 02:07:53 +00:00
Greg Lutostanski
bcdaa95a66
Allow duplicate recipes (#1095) 2022-02-15 02:37:06 +00:00
Casey Rodarmor
27cd8fd554
Remove call to sed in justfile (#1078) 2022-01-30 20:16:10 +00:00
Michael Lohr
6cf95a7337
Add windows-powershell setting (#1057) 2022-01-18 19:02:15 +00:00
Casey Rodarmor
8b49c0cbd1
Ignore leading byte order mark in source files (#1021) 2021-11-05 04:35:57 +00:00
Casey Rodarmor
58a196f434
Make join accept two or more arguments (#1000) 2021-10-15 00:00:58 +00:00
Casey Rodarmor
39301e9f8b
Remove deprecated equals error (#985) 2021-10-02 01:37:28 +00:00
Casey Rodarmor
0db4589efe
Implement regular expression match conditionals (#970) 2021-09-16 23:45:56 +00:00
Casey Rodarmor
09af9bb5e5
Change MSRV to 1.46.0 (#968) 2021-09-16 14:51:45 +00:00
Casey Rodarmor
629c75ff04
Use stable rustfmt instead of nightly (#967) 2021-09-16 13:44:40 +00:00
Casey Rodarmor
9ee1a63e99
Deduplicate recipe parsing (#923) 2021-07-28 05:51:46 +00:00
Casey Rodarmor
1b0fafea75
Add loader and refactor errors (#917)
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.
2021-07-26 01:26:06 -07:00
Casey Rodarmor
98457c05d7
Rename: Module → Ast (#915) 2021-07-24 03:26:27 +00:00
Casey Rodarmor
77bba3ee0e
Add subsequent dependencies (#820)
Subsequents are dependencies which run after a recipe instead of prior.
Subsequents to a recipe only run if the recipe succeeds. Subsequents
will run even if a matching invocation already ran as a prior
dependencies.
2021-07-22 00:20:25 -07:00
Casey Rodarmor
c76805ab9e
Implement else if chaining (#910) 2021-07-20 01:21:46 +00:00
Oleksii Dorozhkin
8677492d56
Add --fmt subcommand (#837) 2021-06-08 01:01:27 -07:00
Casey Rodarmor
7bc9d3986e
Fix bang lexing and placate clippy (#821) 2021-05-07 00:14:38 -07:00
Casey Rodarmor
67bd318bf9
Add positional-arguments setting (#804)
Allow recipe arguments to be passed as positional arguments to commands.
2021-04-24 18:29:58 -07:00
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
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
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
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
7ae890ce61
Note shebang line splitting inconsistency in readme (#757) 2021-02-15 01:18:31 -08:00
Casey Rodarmor
19f7ad09a7
Add conditional expressions (#714)
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 `==`.
2020-10-26 18:16:42 -07:00
Casey Rodarmor
3643a0dff0
Add Parser::forbid (#712) 2020-10-25 23:57:08 -07: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
Richard Berry
1ff619295c
Add variadic parameters that accept zero or more arguments (#645)
Add "star" variadic parameters that accept zero or more arguments,
distinguished with a `*` in front of the parameter name.
2020-06-13 01:49:13 -07:00
Casey Rodarmor
9731278d2a
Wrap comments at 80 characters (#593)
I think 70 is too agressive, especially since it includes indentation
when determining line length.
2020-02-14 04:49:25 -08:00
Casey Rodarmor
3ec7dea4a3
Use unstable rustfmt configuration options (#592) 2020-02-10 20:07:06 -08:00