New option type `form`
- Dominant language
- Clojure
- Stars
- 1.7k
- Forks
- 178
- PR merge metrics
- No merged PRs in 30d
Description
Some tasks allow you to pass edn forms for evaluation. On the CLI you can pass those as string and we'll `read-string` them. If you pass a form in a string in Clojure code it will be interpreted as a string essentially resulting in a no-op. See #666 for details.
To prevent users from running into this issue a warning has been added in #666 but this only covers the :eval option of the repl task leaving any other `edn` options that expect forms as-is.
I think ideally there would be a specific type for options that expect forms (~= function invocations) to distinguish the case of passing data vs. passing a Clojure form.
The [Task Options DSL wiki page](https://github.com/boot-clj/boot/wiki/Task-Options-DSL#types) also mentions a `code` type but that implies evaluation of the form. As I understand this is most often used to pass symbols?
#### Preliminary todo list:
- [ ] extend `boot.cli/parse-atom` by a `form` option:
form (fnil read-string "nil")
- [ ] extend `boot.cli/assert-atom` by a `form` option:
form list?
- [ ] update docs on [Task Options DSL wiki page](https://github.com/boot-clj/boot/wiki/Task-Options-DSL#types)
#### Tasks affected
- `repl` `:eval`
Contributor guide
Research direction
Start in boot.cli at parse-atom and assert-atom, using the issue's proposed form behavior as the starting point. Then review the Task Options DSL wiki page's types section and the repl :eval handling. Done means the form option is supported consistently and the documented option type explains its use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100