Skip to content

feat: add zprint formatter for clojure #130

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

Merged
merged 1 commit into from
Jan 8, 2020
Merged

Conversation

agriffis
Copy link
Contributor

@agriffis agriffis commented Nov 11, 2019

This pull request adds a formatter for Clojure using zprint.

zprint unfortunately lacks the ability to format a range, so we implement :FormatLines by sending only the lines to be formatted. I've opened a PR to add range formatting to zprint, see kkinnear/zprint#122

Doc is updated by vimdoc, with a special section *codefmt-mappings-zprint* suggesting an alternative mapping for top-level forms which depends on also having vim-sexp installed:

autocmd FileType clojure nmap <buffer> <silent> <leader>== <leader>=iF

Copy link
Contributor

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! A few suggestions.

@agriffis agriffis force-pushed the master branch 2 times, most recently from 6ac19e2 to 95635c9 Compare December 30, 2019 01:15
@agriffis
Copy link
Contributor Author

@dbarnett Thanks for the review. I've squashed the commits and this should be ready to merge unless you have any other concerns.

@agriffis agriffis marked this pull request as ready for review December 30, 2019 01:16
@agriffis
Copy link
Contributor Author

If you pull #131 before this, then I'll rebase this PR to resolve the minor merge conflict

@agriffis
Copy link
Contributor Author

agriffis commented Jan 1, 2020

Rebased to resolve merge conflict with #131

Verified

This commit was signed with the committer’s verified signature.
agriffis Aron Griffis
zprint unfortunately lacks the ability to format a range, so we
implement `:FormatLines` by sending only the lines to be formatted.
See kkinnear/zprint#122
@agriffis
Copy link
Contributor Author

agriffis commented Jan 7, 2020

@dbarnett In case this was lost in code review comments, I updated the tests to use fake I/O fully, and removed the zprint install from travis. Let me know if there's anything else...

Copy link
Contributor

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for bearing with me on the nitty gritty stuff. =)

@dbarnett dbarnett merged commit 037707f into google:master Jan 8, 2020

""
" @section Recommended zprint mappings, mappings-zprint
" @parentsection mappings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Build a new vimdoc release. I just found that the @parentsection directive isn't supported yet in the latest vimdoc 0.6.0 release.

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

Successfully merging this pull request may close these issues.

None yet

3 participants