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

Problem with comment ;; and key-value-options both present #269

Closed
arichiardi opened this issue Oct 18, 2022 · 3 comments
Closed

Problem with comment ;; and key-value-options both present #269

arichiardi opened this issue Oct 18, 2022 · 3 comments

Comments

@arichiardi
Copy link
Contributor

arichiardi commented Oct 18, 2022

Hey Kim,
I really struggled to find a good title for this one 😄

I have a bb.edn that I want to format:

;;!zprint {:map {:sort? true :key-value-options {:tasks {:map {:sort? true :justify? true}}} :key-order [:min-bb-version :paths :deps :tasks] :respect-bl? false}}
{:min-bb-version "0.10.0"
 :paths ["src/bb"]
 :deps {local/deps {:local/root "."}}
 :tasks {
         ;; Check
         fmt-check
         {:doc     "Check code for formatting errors"
          :task (shell "make" "-C" ".." "clj-format-check")}
         fmt-fix
         {:doc     "Fix code formatting errors"
          :task (shell "make" "-C" ".." "clj-format-fix")}
         }
 :pods {org.babashka/postgresql {:version "0.1.1"}}}

Zprint spits out

Failed to format file: /home/cokap/git/cohesic/acuity/scripting/bb.edn because java.lang.Exception: Unable to parse the string ';; Check' because of 'clojure.lang.ExceptionInfo: unsupported operation {}'.  Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}

If I remove :key-value-options (or the comments) it seems to succeed.

@kkinnear
Copy link
Owner

Thank you so much for reporting this! You did just about all of the debugging for me as well!! I have found and fixed the problem, and it will be in the next release 1.2.5. There were related bugs with two other advanced map options, so you actually caused three bugs to be fixed. Unfortunately there isn't any workaround. Removing the comment is about the only thing you can do at this point, I'm sorry to say. Thanks again for taking the time to report this so clearly!

@arichiardi
Copy link
Contributor Author

My pleasure!

@kkinnear
Copy link
Owner

This is fixed in 1.2.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants