Closed squaremo closed 4 years ago
I was thinking of a (new :scream:) flag to lift read limits:
--read-root top level directory read are constrained to
This would allow to restrict reads to the subtree defined by that root directory. For instance the root of a git checkout even if the script is in a subdirectory.
That said, I also feel the current way of handling input directories and limits is quite confusing. Not sure how to make it better, introducing a new flag isn't likely to be a good way to simplify things.
Yes, I have still not internalised how input directories work, and have to think it through every time ..
Implementation notes:
/
-- but only those files. The hurdle here is that there's an explicit check that disallows absolute and parent file paths.
jk validate
accepts path directly as arguments on the command line; however, it usesstd.read
to load them for validation, and that can only read things in the "input directory". The input directory is deliberately not a flag forjk validate
, since it's intended the files are supplied via e.g.,find
.This gives us a bit of a conundrum! We could turn the directory limiting off for read, but that lets a validation function (or any other code) also read from anywhere.