Commit Graph

44 Commits

Author SHA1 Message Date
Casey Rodarmor
1ea5e6ac31
Don't conflate recipes with the same name in different modules (#1825) 2024-01-08 13:26:33 -08:00
Casey Rodarmor
e2c0d86bdd
Optional modules and imports (#1797) 2023-12-29 12:16:31 -08:00
Casey Rodarmor
8ea278c58b
Override imported recipes (#1790) 2023-12-28 17:34:37 -08:00
Casey Rodarmor
94b3af6cb7
Allow mod statements with path to source file (#1786) 2023-12-28 12:23:58 +00:00
Casey Rodarmor
316ea01295
Add modules (#1782) 2023-12-28 04:27:15 +00:00
Casey Rodarmor
e9bec8d398
Stabilize !include path as import 'path' (#1771) 2023-12-20 12:31:51 +08:00
Casey Rodarmor
92bae080ab
List included recipes in load order (#1745) 2023-11-25 07:15:41 +00:00
Casey Rodarmor
09a39055ba
Rename Justfile::first → Justfile::default (#1741) 2023-11-22 18:33:55 +00:00
Casey Rodarmor
ab16c0493f
Don't default to included recipes (#1740) 2023-11-22 18:27:49 +00:00
Greg Shuflin
f745316e88
Move !include processing into compiler (#1618) 2023-11-21 11:28:59 -08:00
Casey Rodarmor
bfea1ae5f1
Remove VALID_ALIAS_ATTRIBUTES array (#1731) 2023-11-20 23:35:29 +00:00
Yuri Astrakhan
a1220c63e3
Cleanup (#1566) 2023-06-12 16:53:55 +00:00
Greg Shuflin
054d6672c5
Analyze and Compiler tweaks (#1534) 2023-01-27 03:03:04 +00:00
Greg Shuflin
6ab6588549
Borrow Ast in Analyser (#1527) 2023-01-25 04:06:33 +00:00
Casey Rodarmor
af54dafa77
Allow recipe parameters to shadow variables (#1480) 2023-01-10 00:59:02 +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
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
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
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
Michael Lohr
6cf95a7337
Add windows-powershell setting (#1057) 2022-01-18 19:02:15 +00:00
Casey Rodarmor
0ae91884e2
Add --dump-format json (#992) 2021-11-17 00:07:48 -08:00
Casey Rodarmor
629c75ff04
Use stable rustfmt instead of nightly (#967) 2021-09-16 13:44:40 +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
Oleksii Dorozhkin
8677492d56
Add --fmt subcommand (#837) 2021-06-08 01:01:27 -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
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
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
a14bc8c951
Implement Default for Table (#748) 2021-01-22 23:34:01 -08:00
Casey Rodarmor
3ec7dea4a3
Use unstable rustfmt configuration options (#592) 2020-02-10 20:07:06 -08:00
Casey Rodarmor
ed991cb509
Add additional continuous integration checks (#574)
Add GitHub Actions checks:

- Clippy is placated
- Rustfmt doesn't produce any changes
- Shell completion scripts are current
2020-01-15 02:16:13 -08:00
Casey Rodarmor
0931fa8dbf
Allow passing arguments to dependencies (#555)
Allow recipes that take parameters to be used as dependencies.
2019-12-07 04:03:03 -08:00
Casey Rodarmor
4f08bb4d77
Resolve alias targets (#548)
During analysis, resolve alias targets from `Name`s to `Rc<Recipe>`,
giving us type-level assurance that alias resolution was performed, and
avoiding the need to look up alias targets in a separate table when
running.
2019-11-21 09:39:32 -06:00
Casey Rodarmor
30c77f8d03
Resolve recipe dependencies (#547)
Make analysis resolve recipe dependencies from names (`Name`) to recipes
(`Rc<Recipe>`), to give type-level certainty that resolution was performed
correctly and remove the need to look up dependencies on run.
2019-11-21 08:23:32 -06:00
Casey Rodarmor
e80bf34d9a
Add shell setting (#525)
Add a `set SETTING := VALUE` construct.

This construct is intended to be extended as needed with new settings,
but for now we're starting with `set shell := [COMMAND, ARG1, ...]`,
which allows setting the shell to use for recipe and backtick execution
in a justfile.

One of the primary reasons for adding this feature is to have a better
story on windows, where users are forced to scrounge up an `sh` binary
if they want to use `just`. This should allow them to use cmd.exe or
powershell in their justfiles, making just optionally dependency-free.
2019-11-10 23:17:47 -08:00
Casey Rodarmor
b2285ce0e0
Reform Parser (#509)
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`.
2019-11-07 10:55:15 -08:00