Vertical alignment support#117
Open
robhanlon22 wants to merge 1 commit intogreglook:mainfrom
Open
Conversation
837fa65 to
278bbce
Compare
Contributor
Author
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
==========================================
+ Coverage 89.94% 91.98% +2.04%
==========================================
Files 20 28 +8
Lines 1929 2459 +530
Branches 59 64 +5
==========================================
+ Hits 1735 2262 +527
+ Misses 135 133 -2
- Partials 59 64 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9ba794c to
dcded9a
Compare
This introduces a new `:align` formatting rule for projects that prefer vertical column alignment in associative forms. The rule is disabled by default, so existing formatting behavior is unchanged unless a project opts in. The implementation lives under `src/cljstyle/format/align/*` and follows a structured pipeline: walk blank-line groups, build an alignment model, plan column targets, and apply spacing edits. The rule covers maps, let-like binding vectors, clause-style forms, and reader conditionals. Projects can tune behavior with `:targets`, `:extra-binding-forms`, `:extra-clause-forms`, and `:exclude-forms`. Comment and continuation handling received focused treatment so alignment stays predictable in real code. Standalone comments are not treated as alignment columns, opener-line comments keep their spacing, and `:indent-comments?` (default `true`) controls whether standalone comments follow the next substantive line in multiline groups. `reformat-form` now runs alignment as an explicit opt-in pass after indentation, followed by trailing-whitespace cleanup, which keeps target-column planning stable across repeated runs. Configuration support was extended in `src/cljstyle/config.clj`, and docs were updated in `doc/configuration.md` and `README.md` to show defaults and opt-in usage. Test coverage was expanded in `test/cljstyle/format/align_test.clj`, with additional integration and config validation in `test/cljstyle/format/core_test.clj` and `test/cljstyle/config_test.clj`, including cases for custom forms, reader conditionals, continuation/comment placement, blank-line boundaries, and idempotence. Also add common macOS artifacts to `.gitignore`.
dcded9a to
5895b7a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #47.
This introduces a new
:alignformatting rule for projects that prefer vertical column alignment in associative forms. The rule is disabled by default, so existing formatting behavior is unchanged unless a project opts in.The implementation lives under
src/cljstyle/format/align/*and follows a structured pipeline: walk blank-line groups, build an alignment model, plan column targets, and apply spacing edits. The rule covers maps, let-like binding vectors, clause-style forms, and reader conditionals. Projects can tune behavior with:targets,:extra-binding-forms,:extra-clause-forms, and:exclude-forms.Comment and continuation handling received focused treatment so alignment stays predictable in real code. Standalone comments are not treated as alignment columns, opener-line comments keep their spacing, and
:indent-comments?(defaulttrue) controls whether standalone comments follow the next substantive line in multiline groups.reformat-formnow runs alignment as an explicit opt-in pass after indentation, followed by trailing-whitespace cleanup, which keeps target-column planning stable across repeated runs.Configuration support was extended in
src/cljstyle/config.clj, and docs were updated indoc/configuration.mdandREADME.mdto show defaults and opt-in usage.Test coverage was expanded in
test/cljstyle/format/align_test.clj, with additional integration and config validation intest/cljstyle/format/core_test.cljandtest/cljstyle/config_test.clj, including cases for custom forms, reader conditionals, continuation/comment placement, blank-line boundaries, and idempotence.Also add common macOS artifacts to
.gitignore.