Add iteration to user actions
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Hi,
AFAIK, it's not currently possible to iterate (à la for f in *.md, in bash for instance), in a user action, over a set of file names matched by a glob. Considering how it's frequent to resort to this in scripts, I would argue it's useful. Of course, a counter-argument is to avoid user actions to become a full-featured shell...
Use case: iterate over files to perform a given action, e.g. running expect (ocaml-mdx) tests; tentative syntax:
(alias
(name regression)
(deps
(package mypackage)
(:mds (glob_files *.md))
)
(action (foreach %{f} %{mds}; <-- iterate one by one over files matching the glob above
(progn
(run ocaml-mdx test %{f})
(diff? %{f} %{f}.corrected)))))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files or tests; start by tracing the user-action handling and the proposed glob_files/foreach syntax. Clarify iteration semantics and use the ocaml-mdx example as the acceptance case, with tests covering matched files and the resulting per-file actions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100