Skip to content

Fix cljfmt options serialization for format-code#3866

Merged
bbatsov merged 2 commits intoclojure-emacs:masterfrom
kovan:fix/3209-preserve-cljfmt-options
Mar 11, 2026
Merged

Fix cljfmt options serialization for format-code#3866
bbatsov merged 2 commits intoclojure-emacs:masterfrom
kovan:fix/3209-preserve-cljfmt-options

Conversation

@kovan
Copy link
Contributor

@kovan kovan commented Feb 27, 2026

Fixes #3209.

Summary

cider--nrepl-format-code-request-options was dropping non-map cljfmt options.
As a result, options like remove-consecutive-blank-lines? and
remove-multiple-non-indenting-spaces? never reached the format-code nREPL op.

This change preserves all options, while keeping special nREPL-dict encoding for
nested map options like indents and alias-map.

Checks done

  1. Reproduced on pre-fix code (75dc57ae):

    • Evaluating formatter option serialization with
      (("remove-consecutive-blank-lines?" t) ("remove-multiple-non-indenting-spaces?" t))
    • Result: (nil nil (dict))
  2. Applied the fix and re-ran the same evaluation:

    • Result: (t t (dict "remove-consecutive-blank-lines?" t "remove-multiple-non-indenting-spaces?" t))
  3. Ran focused tests after the fix:

    • eldev -dtT -p test test --file test/cider-client-tests.el .
    • Result: Ran 17 specs, 0 failed

@bbatsov
Copy link
Member

bbatsov commented Mar 10, 2026

The changes look good. Don't forget to reflect them in the changelog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kovan
Copy link
Contributor Author

kovan commented Mar 10, 2026

Done, added a changelog entry. Thanks!

@bbatsov bbatsov merged commit 735fc40 into clojure-emacs:master Mar 11, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

Setting options to customize cljfmt does not take effect

2 participants