Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves error message when user tries to create multi-arity tasks. #627

Merged
merged 2 commits into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `set-env!` works even if the user has set `*print-level*` or `*print-length*` to non-nil in their `$BOOT_HOME/profile.boot`. [#587][587] [#586][586]
- `tmpfile` "Commit: adding..." messages now only appear with `-vv` which eases debugging tasks with `-v` [#557][557]
- Pod tests pass and can be run with `make` [#567][567]
- Improved error message when a user tries to use a multi-arity format for tasks.
- Sift now outputs meaningful things on debug [#581][581]
- `file-filter` (called by all `by-*` functions) throws an error if no criteria are specified.

Expand Down
6 changes: 6 additions & 0 deletions boot/core/src/boot/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@
(with-meta ~varmeta)))))

(defmacro defclifn [sym & forms]
(let [no-doc-string-forms (if (string? (first forms))
(rest forms)
forms)]
(if (and (list? (first no-doc-string-forms))
(vector? (first (first no-doc-string-forms))))
(throw (IllegalArgumentException. "Multiple arity format not supported for tasks. Use single arity format. Ex (deftask build [x y ...] ;commands)"))))
`(let [var# (def ~sym (clifn ~@forms))
fmtdoc# (comp string/trim (#'indent 2))
meta# (update-in (meta ~sym) [:doc] fmtdoc#)]
Expand Down