Update justfile, notes

This commit is contained in:
Casey Rodarmor 2016-10-02 22:31:15 -07:00
parent 0c29b55df6
commit 1a7a61acbc
2 changed files with 30 additions and 86 deletions

View File

@ -1,8 +1,5 @@
# just a makefile with no special magic
test: test:
cargo build cargo test
./target/debug/j args -- a b c
# list all recipies # list all recipies
list: list:
@ -31,9 +28,3 @@ compile:
# clean up # clean up
clean: clean:
rm -r tmp rm -r tmp
a: b
echo a
b: a
echo b

105
notes
View File

@ -1,98 +1,51 @@
notes notes
----- -----
- add tests
. test all existing behavior
. add parsing tests
. check dependency ordering
- allow leading tabs or leading spaces, but not a mix
after leading tabs, additional spaces or tabs are allowed
for line continuation
after leading spaces, only additional spaces are allowed
for line continuation
- parsing tests
. --list: make sure the right dependencies are listed
. --show: make sure the recipe contents is parsed
- make sure that bad names are disallowed
- trigger all errors
- make sure that extra whitespace is not a parse error
- look through all justfiles for features of make that I use. so far: - look through all justfiles for features of make that I use. so far:
. phony . phony
. SHELL := zsh . SHELL := zsh
. quiet . quiet
. make variables . make variables
- ask travis for his justfiles
- ask travis for his justfile command line arguments:
- --show recipe: print recipe information
- --list if there's a bad recipe given
execution:
- indent for line continuation
- use sh -c to execute lines
- remove make dependency polyglot:
. recipes must be '[a-z][a-z0-9-]*' - recipes can have shebangs
. only allow tabs or spaces, but not both in a recipe - extract and run script
. simple, but with recipe dependencies - preserve line numbers
. increased indentation for line continuations - whole file can have shebang
. be as strict as possible, to make future additions . allow launching binaries from cargo
backwords compatible . script until --
. all recipes are then in that language?
- add optional shebangs to recipes extras:
. extract and run script - args
. preserve line numbers - ~/.justfile:
. pass args as real args
- ~/.justfile
. is this for non-project specific commands, so that when you . is this for non-project specific commands, so that when you
type .j in any directory, it uses it as a justfile? type .j in any directory, it uses it as a justfile?
. or is it for commands which are useful across projects? . or is it for commands which are useful across projects?
- super complex recipe lines:
- allow a top-level shebang to script in whatever language a: b c # run b and c, then a
you like. all recipes are now implicitly in that language b | a: c # run c, then b, and pipe output of b into a
. extract script up until -- a >> a.log: # run a and append output to a.log
. this may be ill-advised a B C: # a takes B and C as command line args, like j a HELLO BOB
. how do i deal with running the prelude multiple times? # can enforce at command line
. multiple top level shebangs?
#!/usr/bin/env python3
... python prelude
---
python-recipe:
print("hello")
#!/usr/bin/env perl
... perl prelude
---
perl-recipe:
print "hello"
- what is the story for allowing justfiles in subdirectories? - what is the story for allowing justfiles in subdirectories?
use a different name, like 'subjustfile' or 'jfile'. use a different name, like 'subjustfile' or 'jfile'.
recurse up to the justfile, but add recipes in any jfile recurse up to the justfile, but add recipes in any jfile
that you find along the way. recipes in justfile are accessible, that you find along the way. recipes in justfile are accessible,
and run from the justfile dir. recipes in jfile are run from jfile and run from the justfile dir. recipes in jfile are run from jfile
dir. refuse to run if a recipe in justfile and jfile conflict dir. refuse to run if a recipe in justfile and jfile conflict
- add a command for fanning out?
`j --all build` fans out into subdirectories and builds
- rust is a given, so one option is to write a very simple shell - rust is a given, so one option is to write a very simple shell
language and only call binaries from cargo. include some kind command parser and use that instead of the system shell. this
of dependency description, and install those binaries. should would make recipes work across systems with incompatible shells.
look at rc for inspiration. 'cargo cult' is a great name. additionally, we could also define a mode where it will only call
perhaps it could avoid barewords, and actually have types that commands from cargo, which would make recipes work across systems
map to rust types. with incompatible userlands 'rc' or 'cargo cult' is a great name
- mascot?
. tower of babel
. howl's moving castle
. testuo
. thoth
. kali
- would it be useful to expose original directory to j recipes?
- comedy option: super complex recipe lines:
a: b c # run b and c, then a
b | a: c # run c, then b, and pipe output of b into a
a >> a.log: # run a and append output to a.log
a B C: # a takes B and C as command line args, like j a HELLO BOB
# can enforce at command line