Skip to content
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

Configurations are applied in the wrong order #390

Closed
2 of 3 tasks
ozkutuk opened this issue Dec 4, 2023 · 0 comments · Fixed by #391
Closed
2 of 3 tasks

Configurations are applied in the wrong order #390

ozkutuk opened this issue Dec 4, 2023 · 0 comments · Fixed by #391
Labels
bug Something isn't working

Comments

@ozkutuk
Copy link
Contributor

ozkutuk commented Dec 4, 2023

Is your bug specific to Fourmolu?

  • Yes, I've verified that Ormolu does not have this bug

Did you try it on the web app?

Did you search for existing issues?

  • Yes, there are no open or closed issues related to my issue

Describe the bug

The Haddock documentation of resolvePrinterOpts states the following:

Apply the given configuration in order (later options override earlier).

However, this is not actually correct as it is currently implemented:

ghci> first :: PrinterOptsPartial = mempty {poIndentation = Just 2}
ghci> second :: PrinterOptsPartial = mempty {poIndentation = Just 4}
ghci> poIndentation $ resolvePrinterOpts [first, second]
Identity 2
@ozkutuk ozkutuk added the bug Something isn't working label Dec 4, 2023
ozkutuk added a commit to ozkutuk/fourmolu that referenced this issue Dec 4, 2023
Fixes fourmolu#390

The documentation of `resolvePrinterOpts` states that "later options
override earlier", but it is not the case. This commit the application
order such that it is inline with the documentation.
ozkutuk added a commit to ozkutuk/fourmolu that referenced this issue Dec 4, 2023
Fixes fourmolu#390

The documentation of `resolvePrinterOpts` states that "later options
override earlier", but it is not the case. This commit fixes the
application order such that it is inline with the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant