Skip to content

Add refer-map support for custom indentation rules#393

Merged
weavejester merged 1 commit intoweavejester:masterfrom
jramosg:fix-refer-indentation-368
Feb 26, 2026
Merged

Add refer-map support for custom indentation rules#393
weavejester merged 1 commit intoweavejester:masterfrom
jramosg:fix-refer-indentation-368

Conversation

@jramosg
Copy link
Copy Markdown
Contributor

@jramosg jramosg commented Jan 22, 2026

This change introduces a :refer-map option that allows users to define mappings of referred symbol names to their fully qualified namespace names. This is particularly useful for applying indentation rules to unqualified symbols that need to match against qualified indent rules, enhancing the flexibility of the formatting tool.

Fixes #368

@jramosg jramosg force-pushed the fix-refer-indentation-368 branch 3 times, most recently from a1c4063 to a4102e5 Compare January 22, 2026 12:06
@jramosg jramosg changed the title Fix-refer-indentation-368 Add refer-map support for custom indentation rules Jan 22, 2026
Comment thread cljfmt/src/cljfmt/core.cljc Outdated
Copy link
Copy Markdown
Owner

@weavejester weavejester left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in reviewing this. Overall great work - I just have some small suggestions about naming functions.

Comment thread cljfmt/src/cljfmt/core.cljc Outdated
Comment thread cljfmt/src/cljfmt/core.cljc Outdated
Comment thread cljfmt/src/cljfmt/core.cljc Outdated
Comment thread cljfmt/src/cljfmt/core.cljc Outdated
Comment thread cljfmt/src/cljfmt/core.cljc Outdated
@weavejester
Copy link
Copy Markdown
Owner

Great work! I think this PR is ready to be squashed down and merged.

@jramosg jramosg force-pushed the fix-refer-indentation-368 branch from f4ff63b to 61f87bd Compare February 24, 2026 18:29
@jramosg jramosg closed this Feb 24, 2026
@jramosg jramosg force-pushed the fix-refer-indentation-368 branch from 61f87bd to 646b593 Compare February 24, 2026 18:35
@jramosg jramosg reopened this Feb 24, 2026
@jramosg jramosg force-pushed the fix-refer-indentation-368 branch 3 times, most recently from bd8d2d3 to c7f07ff Compare February 24, 2026 18:52
Support indentation rules for vars introduced via :refer in namespace
declarations. When a var is referred into the namespace, cljfmt now
looks up its original module and applies any configured indentation
rules for that fully-qualified name.

Fixes weavejester#368
@jramosg jramosg force-pushed the fix-refer-indentation-368 branch from c7f07ff to 102cd86 Compare February 24, 2026 18:54
@jramosg
Copy link
Copy Markdown
Contributor Author

jramosg commented Feb 24, 2026

thanks! squashed

@weavejester weavejester merged commit 64b99dc into weavejester:master Feb 26, 2026
1 check passed
@weavejester
Copy link
Copy Markdown
Owner

Merged! I'll cut a release soon with this added.

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.

Format vars that are introduced with :refer

2 participants