Skip to content

Commit

Permalink
Improves error message when user tries to create multi-arity tasks.
Browse files Browse the repository at this point in the history
Fixes issue boot-clj#574
  • Loading branch information
Daniel Manila committed Jun 27, 2017
1 parent 743eb05 commit 0cbaeab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- `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.

#### Fixed

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

0 comments on commit 0cbaeab

Please sign in to comment.