Skip to content

do not revert Fourmolu magic comments to Ormolu form#90

Merged
georgefst merged 1 commit intofourmolu:masterfrom
kukimik:70_magic_comment
May 20, 2021
Merged

do not revert Fourmolu magic comments to Ormolu form#90
georgefst merged 1 commit intofourmolu:masterfrom
kukimik:70_magic_comment

Conversation

@kukimik
Copy link
Copy Markdown
Contributor

@kukimik kukimik commented May 20, 2021

Closes #70.

After looking at the code I've decided not to add another option, and not to track which of the comments was used to disable the formatter. I just treat the two styles of comments as equivalent (e.g. after using {- ORMOLU_DISABLE -} we may use {- FOURMOLU_ENABLE -} to re-enable formatting), but I do not change the style of the comment used in the original file.

Adding an extra option just for this seemed weird. It's easy, but it adds much noise.
Tracking could be useful in some scenarios, but do we really need this?

This solution is simple, keeps Ormolu compatibility and is consistent with the current behavior.

However, if you think it's wrong this way, feel free to close the PR.

@georgefst
Copy link
Copy Markdown
Collaborator

Yeah, this is actually a better idea!

@georgefst georgefst merged commit 9129edc into fourmolu:master May 20, 2021
wldhx pushed a commit to wldhx/fourmolu that referenced this pull request Jul 11, 2021
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.

Disable pragmas always revert to Ormolu form

2 participants