Skip to content

Add styler:disable_alias_lifting comment directive#12

Merged
JesseHerrick merged 1 commit intomainfrom
directive-disable-alias-lifting
May 6, 2026
Merged

Add styler:disable_alias_lifting comment directive#12
JesseHerrick merged 1 commit intomainfrom
directive-disable-alias-lifting

Conversation

@JesseHerrick
Copy link
Copy Markdown
Member

@JesseHerrick JesseHerrick commented May 6, 2026

Adds the # styler:disable_alias_lifting comment directive to allow disabling alias lifting in certain files.

Note

Low Risk
Low risk: change is gated behind an explicit # styler:disable_alias_lifting comment and otherwise preserves existing alias lifting behavior; impact is limited to formatter output for opted-out files/snippets.

Overview
Adds a per-file opt-out for alias lifting via a # styler:disable_alias_lifting comment, which prevents Styler from auto-creating new aliases while still applying any existing aliases.

Implements this by propagating a lifting_disabled? flag through ModuleDirectives and short-circuiting lift_aliases/1 when set, with new test coverage for modules, nested modules, and snippets, plus updated documentation.

Reviewed by Cursor Bugbot for commit 59d7b65. Bugbot is set up for automated code reviews on this repo. Configure here.

@JesseHerrick JesseHerrick self-assigned this May 6, 2026
@JesseHerrick JesseHerrick changed the title Add styler:disable_alias_lifting directive Add styler:disable_alias_lifting comment directive May 6, 2026
@JesseHerrick JesseHerrick merged commit 1bfe301 into main May 6, 2026
11 checks passed
@JesseHerrick JesseHerrick deleted the directive-disable-alias-lifting branch May 6, 2026 04:14
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.

1 participant